diff options
Diffstat (limited to 'GuiTest/src/main/java/io')
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java index e0602be..e6c3564 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java @@ -18,8 +18,9 @@ public class TestDescription extends SyncedGuiDescription { super(type, syncId, playerInventory, getBlockInventory(context, GuiBlockEntity.INVENTORY_SIZE), null); WGridPanel root = (WGridPanel)this.getRootPanel(); - - root.add(WItemSlot.of(blockInventory, 0, 4, 1), 0, 1); + + WItemSlot slot = WItemSlot.of(blockInventory, 0, 4, 1); + root.add(slot, 0, 1); WButton buttonA = new WButton(new LiteralText("Button A")); @@ -45,5 +46,12 @@ public class TestDescription extends SyncedGuiDescription { ScreenNetworking.of(this, NetworkSide.SERVER).receive(TEST_MESSAGE, buf -> { System.out.println("Received on the server!"); }); + + try { + slot.onHidden(); + slot.onShown(); + } catch (Throwable t) { + throw new AssertionError("ValidatedSlot.setVisible crashed", t); + } } } |