This commit is contained in:
MidnightTale 2023-04-24 23:02:23 +07:00
commit 4f10521601

View file

@ -99,26 +99,20 @@ public class FoliaFlow extends JavaPlugin implements Listener {
// }
// }
@EventHandler
public void onWorldLoad(WorldLoadEvent event) {
// Save reference to the End world
if (event.getWorld().getName().equals("world_the_end")) {
endWorld = event.getWorld();
}
}
@EventHandler
public void onEntityChangeBlock(EntityChangeBlockEvent event) {
Entity entity = event.getEntity();
// Check if entity is a falling block in the End world
if (entity instanceof FallingBlock && entity.getWorld().equals(endWorld)) {
getServer().broadcastMessage(ChatColor.RED + "I found a falling block in the End!");
if (event.getEntity() instanceof FallingBlock) {
FallingBlock block = (FallingBlock) event.getEntity();
if (block.getWorld().getEnvironment() == World.Environment.THE_END) {
// The falling block is in the End world
String message = "I found a falling block in the End!";
Bukkit.broadcastMessage(message);
}
}
}
@EventHandler
public void onFallingBlockToBlock(EntityChangeBlockEvent e){
if(e.getEntityType() == EntityType.FALLING_BLOCK){