diff --git a/common/src/main/kotlin/com/artillexstudios/axminions/minions/Minions.kt b/common/src/main/kotlin/com/artillexstudios/axminions/minions/Minions.kt index 365e48f..667b9b5 100644 --- a/common/src/main/kotlin/com/artillexstudios/axminions/minions/Minions.kt +++ b/common/src/main/kotlin/com/artillexstudios/axminions/minions/Minions.kt @@ -7,6 +7,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock import kotlin.concurrent.read import kotlin.concurrent.write import org.bukkit.Chunk +import org.bukkit.Location object Minions { internal val lock = ReentrantReadWriteLock() diff --git a/nms/v1_20_R1/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R1/DamageHandler.kt b/nms/v1_20_R1/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R1/DamageHandler.kt index 2740e70..730d40d 100644 --- a/nms/v1_20_R1/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R1/DamageHandler.kt +++ b/nms/v1_20_R1/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R1/DamageHandler.kt @@ -11,6 +11,7 @@ import net.minecraft.world.effect.MobEffects import net.minecraft.world.entity.EquipmentSlot import net.minecraft.world.entity.LivingEntity import net.minecraft.world.entity.MobType +import net.minecraft.world.entity.animal.Fox import net.minecraft.world.entity.decoration.ArmorStand import net.minecraft.world.item.AxeItem import net.minecraft.world.item.ItemStack @@ -28,13 +29,13 @@ import org.bukkit.entity.Player import org.bukkit.event.entity.EntityPotionEffectEvent object DamageHandler { - private var DUMMY_ENTITY: LivingEntity? = null + private var DUMMY_ENTITY: Fox? = null fun damage(source: Minion, entity: Entity) { val nmsEntity = (entity as CraftEntity).handle if (DUMMY_ENTITY === null) { DUMMY_ENTITY = - ArmorStand(net.minecraft.world.entity.EntityType.ARMOR_STAND, nmsEntity.level() as ServerLevel) + Fox(net.minecraft.world.entity.EntityType.FOX, nmsEntity.level() as ServerLevel) } synchronized(DUMMY_ENTITY!!) { @@ -132,7 +133,8 @@ object DamageHandler { val f4 = 1.0f + if (sweep > 0) SweepingEdgeEnchantment.getSweepingDamageRatio(sweep) else 0.0f * f val list: List = (source.getLocation().world as CraftWorld).handle - .getEntitiesOfClass(LivingEntity::class.java, nmsEntity.boundingBox.inflate(1.0, 0.25, 1.0)).filter { it !is Player } + .getEntitiesOfClass(LivingEntity::class.java, nmsEntity.boundingBox.inflate(1.0, 0.25, 1.0)) + .filter { it !is Player } val iterator: Iterator<*> = list.iterator() while (iterator.hasNext()) { diff --git a/nms/v1_20_R2/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R2/DamageHandler.kt b/nms/v1_20_R2/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R2/DamageHandler.kt index 8444e14..c44ab68 100644 --- a/nms/v1_20_R2/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R2/DamageHandler.kt +++ b/nms/v1_20_R2/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R2/DamageHandler.kt @@ -11,6 +11,7 @@ import net.minecraft.world.effect.MobEffects import net.minecraft.world.entity.EquipmentSlot import net.minecraft.world.entity.LivingEntity import net.minecraft.world.entity.MobType +import net.minecraft.world.entity.animal.Fox import net.minecraft.world.entity.decoration.ArmorStand import net.minecraft.world.item.AxeItem import net.minecraft.world.item.ItemStack @@ -28,13 +29,13 @@ import org.bukkit.entity.Player import org.bukkit.event.entity.EntityPotionEffectEvent object DamageHandler { - private var DUMMY_ENTITY: LivingEntity? = null + private var DUMMY_ENTITY: Fox? = null fun damage(source: Minion, entity: Entity) { val nmsEntity = (entity as CraftEntity).handle if (DUMMY_ENTITY === null) { DUMMY_ENTITY = - ArmorStand(net.minecraft.world.entity.EntityType.ARMOR_STAND, nmsEntity.level() as ServerLevel) + Fox(net.minecraft.world.entity.EntityType.FOX, nmsEntity.level() as ServerLevel) } synchronized(DUMMY_ENTITY!!) { diff --git a/nms/v1_20_R3/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R3/DamageHandler.kt b/nms/v1_20_R3/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R3/DamageHandler.kt index b7efb4e..38c7820 100644 --- a/nms/v1_20_R3/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R3/DamageHandler.kt +++ b/nms/v1_20_R3/src/main/kotlin/com/artillexstudios/axminions/nms/v1_20_R3/DamageHandler.kt @@ -8,9 +8,11 @@ import net.minecraft.server.level.ServerLevel import net.minecraft.util.Mth import net.minecraft.world.effect.MobEffectInstance import net.minecraft.world.effect.MobEffects +import net.minecraft.world.entity.EntityType import net.minecraft.world.entity.EquipmentSlot import net.minecraft.world.entity.LivingEntity import net.minecraft.world.entity.MobType +import net.minecraft.world.entity.animal.Fox import net.minecraft.world.entity.decoration.ArmorStand import net.minecraft.world.item.AxeItem import net.minecraft.world.item.ItemStack @@ -28,13 +30,13 @@ import org.bukkit.entity.Player import org.bukkit.event.entity.EntityPotionEffectEvent object DamageHandler { - private var DUMMY_ENTITY: LivingEntity? = null + private var DUMMY_ENTITY: Fox? = null fun damage(source: Minion, entity: Entity) { val nmsEntity = (entity as CraftEntity).handle if (DUMMY_ENTITY === null) { DUMMY_ENTITY = - ArmorStand(net.minecraft.world.entity.EntityType.ARMOR_STAND, nmsEntity.level() as ServerLevel) + Fox(EntityType.FOX, nmsEntity.level() as ServerLevel) } synchronized(DUMMY_ENTITY!!) {