9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-19 15:09:17 +00:00

Compare commits

...

6 Commits

Author SHA1 Message Date
Will FP
2822acc1ac libreforge-updater 2025-10-06 08:57:36 +01:00
Will FP
1ec94615c9 Fixed drops being sent twice 2025-10-05 18:07:22 +01:00
Will FP
88192c6d8f Fixed massive bug with mob eggs 2025-10-05 15:26:32 +01:00
Will FP
f138127c27 Updated to java 21 2025-10-04 15:36:18 +01:00
Will FP
a808141dc2 libreforge-updater 2025-09-11 09:59:41 +01:00
Will FP
6bab63a50c libreforge-updater 2025-08-01 10:05:38 +01:00
5 changed files with 18 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ allprojects {
java { java {
withSourcesJar() withSourcesJar()
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) toolchain.languageVersion.set(JavaLanguageVersion.of(21))
} }
tasks { tasks {
@@ -57,7 +57,7 @@ allprojects {
compileKotlin { compileKotlin {
compilerOptions { compilerOptions {
jvmTarget.set(JvmTarget.JVM_17) jvmTarget.set(JvmTarget.JVM_21)
} }
} }

View File

@@ -11,6 +11,7 @@ import com.willfp.eco.core.fast.fast
import com.willfp.eco.core.items.CustomItem import com.willfp.eco.core.items.CustomItem
import com.willfp.eco.core.items.Items import com.willfp.eco.core.items.Items
import com.willfp.eco.core.items.builder.modify import com.willfp.eco.core.items.builder.modify
import com.willfp.eco.core.items.toSNBT
import com.willfp.eco.core.recipe.Recipes import com.willfp.eco.core.recipe.Recipes
import com.willfp.eco.core.recipe.parts.EmptyTestableItem import com.willfp.eco.core.recipe.parts.EmptyTestableItem
import com.willfp.eco.util.NamespacedKeyUtils import com.willfp.eco.util.NamespacedKeyUtils
@@ -263,7 +264,9 @@ internal class ConfigDrivenEcoMob(
CustomItem( CustomItem(
plugin.createNamespacedKey("${this.id}_spawn_egg"), plugin.createNamespacedKey("${this.id}_spawn_egg"),
{ item.fast().ecoMobEgg == this }, {
it.fast().ecoMobEgg == this@ConfigDrivenEcoMob
},
item item
).register() ).register()

View File

@@ -46,6 +46,9 @@ internal class LivingMobImpl(
override val ticksLeft: Int override val ticksLeft: Int
get() = mob.lifespan - tick get() = mob.lifespan - tick
// Fix for drops being sent twice
private var hasBeenKilled = false
fun addTickHandler(handler: TickHandler) { fun addTickHandler(handler: TickHandler) {
tickHandlers += handler tickHandlers += handler
} }
@@ -80,9 +83,13 @@ internal class LivingMobImpl(
override fun kill(player: Player?, removeTracking: Boolean) { override fun kill(player: Player?, removeTracking: Boolean) {
handleRemove(removeTracking = removeTracking) handleRemove(removeTracking = removeTracking)
if (!hasBeenKilled) {
mob.spawnDrops(entity.location, player) mob.spawnDrops(entity.location, player)
} }
hasBeenKilled = true
}
override fun despawn() { override fun despawn() {
entity.remove() entity.remove()
handleRemove() handleRemove()

View File

@@ -1,7 +1,7 @@
name: ${pluginName} name: ${pluginName}
version: ${version} version: ${version}
main: com.willfp.ecomobs.EcoMobsPlugin main: com.willfp.ecomobs.EcoMobsPlugin
api-version: 1.17 api-version: 1.21.4
authors: [ Auxilor ] authors: [ Auxilor ]
website: willfp.com website: willfp.com
depend: depend:

View File

@@ -1,5 +1,5 @@
#libreforge-updater #libreforge-updater
#Sat Jul 05 16:46:16 BST 2025 #Mon Oct 06 08:57:36 BST 2025
kotlin.code.style=official kotlin.code.style=official
libreforge-version=4.76.1 libreforge-version=4.79.0
version=10.21.1 version=10.24.0