mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-27 20:56:05 +01:00
Attempt to fix FeatherBoard error
This commit is contained in:
parent
5917105622
commit
474bfd11b4
@ -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;
|
||||
|
@ -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 {
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -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('&',
|
||||
|
Loading…
Reference in New Issue
Block a user