Fixed refactoring bugs

This commit is contained in:
Auxilor
2022-03-02 18:45:34 +00:00
parent 9700aa7eac
commit 0be1f45edc
10 changed files with 12 additions and 12 deletions

View File

@@ -2,7 +2,7 @@ package com.willfp.eco.internal.spigot.proxy.common.ai.entity
import com.willfp.eco.core.entities.ai.entity.EntityGoalAvoidEntity
import com.willfp.eco.internal.spigot.proxy.common.ai.EntityGoalFactory
import com.willfp.eco.internal.spigot.proxy.common.ai.toBukkitEntity
import com.willfp.eco.internal.spigot.proxy.common.toBukkitEntity
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.PathfinderMob
import net.minecraft.world.entity.ai.goal.AvoidEntityGoal
@@ -13,7 +13,7 @@ object AvoidEntityGoalFactory : EntityGoalFactory<EntityGoalAvoidEntity> {
return AvoidEntityGoal(
entity,
LivingEntity::class.java,
apiGoal.fleeDistance.toFloat(),
apiGoal.distance.toFloat(),
apiGoal.slowSpeed,
apiGoal.fastSpeed
) { apiGoal.entity.test(it.toBukkitEntity()) }

View File

@@ -10,7 +10,7 @@ object BreakDoorsGoalFactory : EntityGoalFactory<EntityGoalBreakDoors> {
override fun create(apiGoal: EntityGoalBreakDoors, entity: PathfinderMob): Goal {
return BreakDoorGoal(
entity,
apiGoal.maxProgress
apiGoal.ticks
) { true }
}
}

View File

@@ -10,7 +10,7 @@ object OpenDoorsGoalFactory : EntityGoalFactory<EntityGoalOpenDoors> {
override fun create(apiGoal: EntityGoalOpenDoors, entity: PathfinderMob): Goal {
return OpenDoorGoal(
entity,
apiGoal.delayedClose
apiGoal.delayClosing
)
}
}

View File

@@ -11,7 +11,7 @@ object RangedAttackGoalFactory : EntityGoalFactory<EntityGoalRangedAttack> {
override fun create(apiGoal: EntityGoalRangedAttack, entity: PathfinderMob): Goal? {
return RangedAttackGoal(
entity as? RangedAttackMob ?: return null,
apiGoal.mobSpeed,
apiGoal.speed,
apiGoal.minInterval,
apiGoal.maxInterval,
apiGoal.maxRange.toFloat()

View File

@@ -16,7 +16,7 @@ object RangedBowAttackGoalFactory : EntityGoalFactory<EntityGoalRangedBowAttack>
return RangedBowAttackGoal(
entity,
apiGoal.speed,
apiGoal.attackInterval,
apiGoal.interval,
apiGoal.range.toFloat()
)
}

View File

@@ -3,7 +3,7 @@ package com.willfp.eco.internal.spigot.proxy.common.ai.target
import com.willfp.eco.core.entities.TestableEntity
import com.willfp.eco.core.entities.ai.target.TargetGoalHurtBy
import com.willfp.eco.internal.spigot.proxy.common.ai.TargetGoalFactory
import com.willfp.eco.internal.spigot.proxy.common.ai.toBukkitEntity
import com.willfp.eco.internal.spigot.proxy.common.toBukkitEntity
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.PathfinderMob
import net.minecraft.world.entity.ai.goal.Goal

View File

@@ -2,7 +2,7 @@ package com.willfp.eco.internal.spigot.proxy.common.ai.target
import com.willfp.eco.core.entities.ai.target.TargetGoalNearestAttackable
import com.willfp.eco.internal.spigot.proxy.common.ai.TargetGoalFactory
import com.willfp.eco.internal.spigot.proxy.common.ai.toBukkitEntity
import com.willfp.eco.internal.spigot.proxy.common.toBukkitEntity
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.PathfinderMob
import net.minecraft.world.entity.ai.goal.Goal

View File

@@ -2,7 +2,7 @@ package com.willfp.eco.internal.spigot.proxy.common.ai.target
import com.willfp.eco.core.entities.ai.target.TargetGoalNearestAttackableWitch
import com.willfp.eco.internal.spigot.proxy.common.ai.TargetGoalFactory
import com.willfp.eco.internal.spigot.proxy.common.ai.toBukkitEntity
import com.willfp.eco.internal.spigot.proxy.common.toBukkitEntity
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.PathfinderMob
import net.minecraft.world.entity.ai.goal.Goal

View File

@@ -2,7 +2,7 @@ package com.willfp.eco.internal.spigot.proxy.common.ai.target
import com.willfp.eco.core.entities.ai.target.TargetGoalNearestHealableRaider
import com.willfp.eco.internal.spigot.proxy.common.ai.TargetGoalFactory
import com.willfp.eco.internal.spigot.proxy.common.ai.toBukkitEntity
import com.willfp.eco.internal.spigot.proxy.common.toBukkitEntity
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.PathfinderMob
import net.minecraft.world.entity.ai.goal.Goal

View File

@@ -2,7 +2,7 @@ package com.willfp.eco.internal.spigot.proxy.common.ai.target
import com.willfp.eco.core.entities.ai.target.TargetGoalNonTameRandom
import com.willfp.eco.internal.spigot.proxy.common.ai.TargetGoalFactory
import com.willfp.eco.internal.spigot.proxy.common.ai.toBukkitEntity
import com.willfp.eco.internal.spigot.proxy.common.toBukkitEntity
import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.PathfinderMob
import net.minecraft.world.entity.TamableAnimal
@@ -16,7 +16,7 @@ object NonTameRandomGoalFactory : TargetGoalFactory<TargetGoalNonTameRandom> {
LivingEntity::class.java,
apiGoal.checkVisibility,
) {
apiGoal.targetFilter.test(it.toBukkitEntity()) && apiGoal.target.test(it.toBukkitEntity())
apiGoal.targetFilter.test(it.toBukkitEntity()) && apiGoal.target.matches(it.toBukkitEntity())
}
}
}