Stop Endersignal in island worlds

This commit is contained in:
Fabrizio La Rosa 2020-08-03 18:28:05 +02:00
parent b4db3f4bf6
commit 105e5be768

View File

@ -611,6 +611,18 @@ public class Entity implements Listener {
});
event.setCancelled(true); // For other plugin API reasons.
}
@EventHandler(ignoreCancelled = true)
public void onEntitySpawn(EntitySpawnEvent event) {
WorldManager worldManager = plugin.getWorldManager();
if(worldManager.isIslandWorld(event.getLocation().getWorld())) {
org.bukkit.entity.Entity entity = event.getEntity();
if(event.getEntity() instanceof EnderSignal) {
((EnderSignal) entity).setTargetLocation(entity.getLocation().add(0d, 50d, 0d));
}
}
}
@EventHandler(ignoreCancelled = true)
public void onDamageVehicle(VehicleDamageEvent event) {