11package com .fibermc .essentialcommands .commands .bench ;
22
3+ import com .fibermc .essentialcommands .EssentialCommands ;
34import org .jetbrains .annotations .NotNull ;
45
56import net .minecraft .network .chat .Component ;
@@ -18,8 +19,21 @@ protected Component getScreenTitle() {
1819 @ Override
1920 protected @ NotNull MenuProvider getScreenHandlerFactory () {
2021 return new SimpleMenuProvider (
21- (syncId , inventory , player ) ->
22- ChestMenu .threeRows (syncId , inventory , player .getEnderChestInventory ()),
22+ (syncId , inventory , player ) -> {
23+ var echestInventory = player .getEnderChestInventory ();
24+ if (echestInventory .getContainerSize () == 9 * 3 ) {
25+ return ChestMenu .threeRows (syncId , inventory , echestInventory );
26+ }
27+ if (echestInventory .getContainerSize () == 9 * 6 ) {
28+ return ChestMenu .sixRows (syncId , inventory , echestInventory );
29+ }
30+ EssentialCommands .LOGGER .warn (
31+ "Expected enderchest to be 9x3 or 9x6 (modded), but found size '{}'."
32+ + " This is unsupported (If this is an intended configuration, report"
33+ + " this along with your log file / mod list at https://github.com/John-Paul-R/Essential-Commands/issues)" ,
34+ echestInventory .getContainerSize ());
35+ return ChestMenu .threeRows (syncId , inventory , echestInventory );
36+ },
2337 Component .translatable ("container.enderchest" )
2438 );
2539 }
0 commit comments