please
This commit is contained in:
parent
9d9d5bace6
commit
4f10521601
1 changed files with 8 additions and 14 deletions
|
|
@ -99,23 +99,17 @@ 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();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue