mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-21 16:09:24 +00:00
Improved target ticker
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -15,12 +15,10 @@ 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) {
|
||||
if (nearbyEntity instanceof Player && entity instanceof Mob) {
|
||||
((Mob) entity).setTarget((Player) nearbyEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user