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()))
|
.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,
|
private void tick(final long tick,
|
||||||
|
|||||||
@@ -15,10 +15,8 @@ public class TargetTicker implements BossTicker {
|
|||||||
final long tick) {
|
final long tick) {
|
||||||
if (tick % 10 == 0) {
|
if (tick % 10 == 0) {
|
||||||
for (Entity nearbyEntity : entity.getNearbyEntities(10, 5, 10)) {
|
for (Entity nearbyEntity : entity.getNearbyEntities(10, 5, 10)) {
|
||||||
if (nearbyEntity instanceof Player) {
|
if (nearbyEntity instanceof Player && entity instanceof Mob) {
|
||||||
if (entity instanceof Mob) {
|
((Mob) entity).setTarget((Player) nearbyEntity);
|
||||||
((Mob) entity).setTarget((Player) nearbyEntity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user