diff --git a/src/main/java/com/songoda/skyblock/listeners/Block.java b/src/main/java/com/songoda/skyblock/listeners/Block.java index 110a015e..04d1f5ce 100644 --- a/src/main/java/com/songoda/skyblock/listeners/Block.java +++ b/src/main/java/com/songoda/skyblock/listeners/Block.java @@ -342,8 +342,6 @@ public class Block implements Listener { } if (NMSUtil.getVersionNumber() < 12) { - if (event.getToBlock().getType() != Material.COBBLESTONE) - return; if (generatorManager != null && generatorManager.getGenerators().size() > 0 && generatorManager.isGenerator(block)) { List generators = new ArrayList<>(generatorManager.getGenerators()); Collections.reverse(generators); // Use the highest generator available @@ -549,7 +547,7 @@ public class Block implements Listener { BlockState state = event.getNewState(); Material type = state.getType(); - if (type != Material.COBBLESTONE) return; + if (type != Material.COBBLESTONE && type != Material.STONE) return; GeneratorManager generatorManager = skyblock.getGeneratorManager(); if (generatorManager == null) return; diff --git a/src/main/java/com/songoda/skyblock/listeners/Join.java b/src/main/java/com/songoda/skyblock/listeners/Join.java index 657b2db7..97b431b8 100644 --- a/src/main/java/com/songoda/skyblock/listeners/Join.java +++ b/src/main/java/com/songoda/skyblock/listeners/Join.java @@ -25,8 +25,6 @@ import org.bukkit.event.player.PlayerJoinEvent; import java.io.File; import java.lang.reflect.Method; -import java.util.HashMap; -import java.util.Map; public class Join implements Listener { diff --git a/src/main/java/com/songoda/skyblock/placeholder/MVdWPlaceholder.java b/src/main/java/com/songoda/skyblock/placeholder/MVdWPlaceholder.java index b9a36b3e..3c87bd20 100644 --- a/src/main/java/com/songoda/skyblock/placeholder/MVdWPlaceholder.java +++ b/src/main/java/com/songoda/skyblock/placeholder/MVdWPlaceholder.java @@ -16,6 +16,7 @@ import org.bukkit.entity.Player; import java.io.File; import java.util.List; +import java.util.logging.Level; public class MVdWPlaceholder { @@ -127,13 +128,19 @@ public class MVdWPlaceholder { for (String placeholderList : placeholderManager.getPlaceholders()) { PlaceholderAPI.registerPlaceholder(skyblock, placeholderList, event -> { - Player player = event.getPlayer(); - - if (player == null) { - return null; - } - - return placeholderManager.getPlaceholder(player, event.getPlaceholder()); + try { + Player player = event.getPlayer(); + + if (player == null) { + return null; + } + + return placeholderManager.getPlaceholder(player, event.getPlaceholder()); + } catch (Exception ex) { + Bukkit.getLogger().log(Level.WARNING, "[FabledSkyBlock] Exception while retrieving placeholder {}:", event.getPlaceholder()); + Bukkit.getLogger().log(Level.WARNING, "", ex); + return event.getPlaceholder(); + } }); } } diff --git a/src/main/java/com/songoda/skyblock/placeholder/PlaceholderManager.java b/src/main/java/com/songoda/skyblock/placeholder/PlaceholderManager.java index 218e9d24..64157a87 100644 --- a/src/main/java/com/songoda/skyblock/placeholder/PlaceholderManager.java +++ b/src/main/java/com/songoda/skyblock/placeholder/PlaceholderManager.java @@ -116,7 +116,7 @@ public class PlaceholderManager { .replace("%placeholder", "" + island.getRadius())); } } else if (placeholder.equalsIgnoreCase("fabledskyblock_island_level")) { - return island == null ? "0": Long.toString(island.getLevel().getLevel()); + return island == null || island.getLevel() == null ? "0": Long.toString(island.getLevel().getLevel()); } else if (placeholder.equalsIgnoreCase("fabledskyblock_island_level_formatted")) { if (island == null) { return ChatColor.translateAlternateColorCodes('&',