Attempt to fix FeatherBoard error

This commit is contained in:
0ddlyoko 2020-02-20 01:09:08 +01:00 committed by Brianna
parent 5917105622
commit 474bfd11b4
4 changed files with 16 additions and 13 deletions

View File

@ -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<Generator> 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;

View File

@ -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 {

View File

@ -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,6 +128,7 @@ public class MVdWPlaceholder {
for (String placeholderList : placeholderManager.getPlaceholders()) {
PlaceholderAPI.registerPlaceholder(skyblock, placeholderList, event -> {
try {
Player player = event.getPlayer();
if (player == null) {
@ -134,6 +136,11 @@ public class MVdWPlaceholder {
}
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();
}
});
}
}

View File

@ -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('&',