[16:17:36 INFO]: Jonathan_Nathan issued server command: /bedit
[16:17:36 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'bedit' in plugin BlockLimiter v1.0.0
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R1.CraftServer.dispatchCommand(CraftServer.java:897) ~[paper-1.18.1.jar:git-Paper-177]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleCommand(ServerGamePacketListenerImpl.java:2287) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2098) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.handleChat(ServerGamePacketListenerImpl.java:2079) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.handle(ServerboundChatPacket.java:46) ~[?:?]
at net.minecraft.network.protocol.game.ServerboundChatPacket.a(ServerboundChatPacket.java:6) ~[?:?]
at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.18.1.jar:git-Paper-177]
at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]
at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1413) ~[paper-1.18.1.jar:git-Paper-177]
at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:189) ~[paper-1.18.1.jar:git-Paper-177]
at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[?:?]
at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1391) ~[paper-1.18.1.jar:git-Paper-177]
at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1384) ~[paper-1.18.1.jar:git-Paper-177]
at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[?:?]
at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1362) ~[paper-1.18.1.jar:git-Paper-177]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1268) ~[paper-1.18.1.jar:git-Paper-177]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-177]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalArgumentException: Material cannot be null
at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[commons-lang-2.6.jar:2.6]
at org.bukkit.inventory.ItemStack.<init>(ItemStack.java:86) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.inventory.ItemStack.<init>(ItemStack.java:74) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.inventory.ItemStack.<init>(ItemStack.java:61) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.inventory.ItemStack.<init>(ItemStack.java:47) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at me.jonathan.BlockLimiter.gui.builder.item.ItemBuilder.from(ItemBuilder.java:75) ~[BlockLimiter-1.0.0.jar:?]
at editor.editorgui.openEditor(editorgui.java:144) ~[BlockLimiter-1.0.0.jar:?]
at me.jonathan.commands.Edit.onCommand(Edit.java:24) ~[BlockLimiter-1.0.0.jar:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
... 21 more
public static void openEditor(Player player) {
FileConfiguration config = BlockLimiter.getInstance().getConfig();
if (!config.getBoolean("in-game-editor.enabled")) return;
// 18 >= 18
List<String> list = BlockLimiter.getInstance().getConfig().getStringList("items");
Gui gui = Gui.gui()
.title(Component.translatable("BlockLimiter - Editor",TextColor.fromHexString("#000C3A")))
.rows(rows())
.disableAllInteractions()
.create();
Material nextpagemat = Material.getMaterial( config.getString("in-game-editor.nextpage.material"));
Material prevpagemat = Material.getMaterial( config.getString("in-game-editor.prevpage.material"));
Material exitmat = Material.getMaterial( config.getString("in-game-editor.exit.material"));
Material blockermat = Material.getMaterial( config.getString("in-game-editor.blockers.material"));
Material undefinedmat = Material.getMaterial( config.getString("in-game-editor.undefined.material"));
if (nextpagemat == null) nextpagemat = Material.ARROW;
if (prevpagemat == null) prevpagemat = Material.ARROW;
if (exitmat == null) exitmat = Material.BARRIER;
if (blockermat == null) blockermat = Material.PISTON;
if (undefinedmat == null) undefinedmat = Material.BOOK;
List<Integer> nextpage = Arrays.asList();
List<Integer> blockers = Arrays.asList();
List<Integer> prevpage = Arrays.asList();
List<Integer> exit = Arrays.asList();
List<Integer> undefined = Arrays.asList();
switch (rows()) {
case 3:
blockers = Arrays.asList(9,10,11,12,13,14,15,16,17);
prevpage = Arrays.asList(18);
nextpage = Arrays.asList(26);
exit = Arrays.asList(22);
undefined =Arrays.asList(23);
break;
case 4:
blockers = Arrays.asList(18,19,20,21,22,23,24,25,26);
prevpage = Arrays.asList(27);
nextpage = Arrays.asList(35);
exit = Arrays.asList(31);
undefined =Arrays.asList(32);
break;
case 5:
blockers = Arrays.asList(27,28,29,30,31,32,33,34,35);
prevpage = Arrays.asList(36);
nextpage = Arrays.asList(44);
exit = Arrays.asList(40);
undefined =Arrays.asList(41);
break;
case 6:
blockers = Arrays.asList(36,37,38,39,40,41,42,43,44);
prevpage = Arrays.asList(45);
nextpage = Arrays.asList(53);
exit = Arrays.asList(49);
undefined =Arrays.asList(50);
break;
default:
break;
}
// next page button
GuiItem nextpageb = ItemBuilder.from(nextpagemat).name(Component.text(" ")).asGuiItem(event -> {
});
gui.setItem(nextpage, nextpageb);
// prev page button
GuiItem prevpageb = ItemBuilder.from(prevpagemat).name(Component.text(" ")).asGuiItem(event -> {
});
gui.setItem(prevpage, prevpageb);
// the pistons
GuiItem blockersb = ItemBuilder.from(blockermat).name(Component.text(" ")).asGuiItem();
gui.setItem(blockers, blockersb);
// exit button
GuiItem exitb = ItemBuilder.from(exitmat).name(Component.text(" ")).asGuiItem(event -> {
});
gui.setItem(exit, exitb);
// undefined items button
GuiItem undefinedb = ItemBuilder.from(undefinedmat).name(Component.text("")).asGuiItem(event -> {
});
gui.setItem(undefined, undefinedb);
for (int i = 0; i > list.size(); i++) {
Bukkit.getLogger().warning(list.get(i));
GuiItem guiItem = ItemBuilder.from(Material.STONE)
.name(Component.text(list.get(i)))
.asGuiItem(event -> {
event.getWhoClicked().sendMessage("you clicked which means this is working");
event.getClick().isLeftClick();
});
gui.addItem(guiItem);
}
if (gui.getGuiItems().size() >= 1) {
gui.open(player);
} else { player.sendMessage("There are no config items :(");}
}