diff --git a/src/main/java/com/fibermc/essentialcommands/commands/bench/EnderchestCommand.java b/src/main/java/com/fibermc/essentialcommands/commands/bench/EnderchestCommand.java index 62b16547..5884000c 100644 --- a/src/main/java/com/fibermc/essentialcommands/commands/bench/EnderchestCommand.java +++ b/src/main/java/com/fibermc/essentialcommands/commands/bench/EnderchestCommand.java @@ -1,5 +1,6 @@ package com.fibermc.essentialcommands.commands.bench; +import com.fibermc.essentialcommands.EssentialCommands; import org.jetbrains.annotations.NotNull; import net.minecraft.network.chat.Component; @@ -18,8 +19,21 @@ protected Component getScreenTitle() { @Override protected @NotNull MenuProvider getScreenHandlerFactory() { return new SimpleMenuProvider( - (syncId, inventory, player) -> - ChestMenu.threeRows(syncId, inventory, player.getEnderChestInventory()), + (syncId, inventory, player) -> { + var echestInventory = player.getEnderChestInventory(); + if (echestInventory.getContainerSize() == 9 * 3) { + return ChestMenu.threeRows(syncId, inventory, echestInventory); + } + if (echestInventory.getContainerSize() == 9 * 6) { + return ChestMenu.sixRows(syncId, inventory, echestInventory); + } + EssentialCommands.LOGGER.warn( + "Expected enderchest to be 9x3 or 9x6 (modded), but found size '{}'." + + " This is unsupported (If this is an intended configuration, report" + + " this along with your log file / mod list at https://github.com/John-Paul-R/Essential-Commands/issues)", + echestInventory.getContainerSize()); + return ChestMenu.threeRows(syncId, inventory, echestInventory); + }, Component.translatable("container.enderchest") ); }