right
This commit is contained in:
parent
027e975a98
commit
58a1f99cfa
1 changed files with 6 additions and 2 deletions
|
|
@ -84,9 +84,12 @@ public class FoliaFlow extends JavaPlugin implements Listener {
|
||||||
Location loc = new Location(Bukkit.getWorld("world_the_end"), 100, 48, 0);
|
Location loc = new Location(Bukkit.getWorld("world_the_end"), 100, 48, 0);
|
||||||
BlockData blockData = Material.OBSIDIAN.createBlockData();
|
BlockData blockData = Material.OBSIDIAN.createBlockData();
|
||||||
display = Objects.requireNonNull(Bukkit.getWorld("world_the_end")).spawn(loc, BlockDisplay.class);
|
display = Objects.requireNonNull(Bukkit.getWorld("world_the_end")).spawn(loc, BlockDisplay.class);
|
||||||
|
if (display == null) {
|
||||||
|
getLogger().severe("Failed to spawn BlockDisplay entity.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
display.setBlock(blockData);
|
display.setBlock(blockData);
|
||||||
|
getLogger().info("BlockDisplay entity spawned successfully.");
|
||||||
|
|
||||||
getServer().getPluginManager().registerEvents(this, this);
|
getServer().getPluginManager().registerEvents(this, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -99,6 +102,7 @@ public class FoliaFlow extends JavaPlugin implements Listener {
|
||||||
for (Entity entity : Objects.requireNonNull(Bukkit.getWorld("world_the_end")).getEntitiesByClass(BlockDisplay.class)) {
|
for (Entity entity : Objects.requireNonNull(Bukkit.getWorld("world_the_end")).getEntitiesByClass(BlockDisplay.class)) {
|
||||||
entity.remove();
|
entity.remove();
|
||||||
}
|
}
|
||||||
|
getLogger().info("BlockDisplay entity removed successfully.");
|
||||||
task.cancel();
|
task.cancel();
|
||||||
blockktask.cancel();
|
blockktask.cancel();
|
||||||
super.onDisable();
|
super.onDisable();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue