9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-20 23:49:22 +00:00

Improved target ticker

This commit is contained in:
Auxilor
2021-04-01 14:13:52 +01:00
parent 56d935566d
commit 7eb7e7926c
2 changed files with 2 additions and 10 deletions

View File

@@ -125,12 +125,6 @@ public class LivingEcoBoss extends PluginDependent {
.replace("%z%", StringUtils.internalToString(entity.getLocation().getBlockZ()))
);
}
for (Entity nearbyEntity : entity.getNearbyEntities(15, 15, 15)) {
if (nearbyEntity instanceof Player && entity instanceof Mob) {
((Mob) entity).setTarget((LivingEntity) nearbyEntity);
}
}
}
private void tick(final long tick,

View File

@@ -15,10 +15,8 @@ public class TargetTicker implements BossTicker {
final long tick) {
if (tick % 10 == 0) {
for (Entity nearbyEntity : entity.getNearbyEntities(10, 5, 10)) {
if (nearbyEntity instanceof Player) {
if (entity instanceof Mob) {
((Mob) entity).setTarget((Player) nearbyEntity);
}
if (nearbyEntity instanceof Player && entity instanceof Mob) {
((Mob) entity).setTarget((Player) nearbyEntity);
}
}
}