Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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")
);
}
Expand Down