diff options
Diffstat (limited to 'src/testMod/java')
-rw-r--r-- | src/testMod/java/io/github/cottonmc/test/TestDescription.java | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/testMod/java/io/github/cottonmc/test/TestDescription.java b/src/testMod/java/io/github/cottonmc/test/TestDescription.java index 39b09d6..fdea211 100644 --- a/src/testMod/java/io/github/cottonmc/test/TestDescription.java +++ b/src/testMod/java/io/github/cottonmc/test/TestDescription.java @@ -48,24 +48,16 @@ public class TestDescription extends SyncedGuiDescription { root.add(new WButton(Text.literal("Button D")), 5, 5, 4, 1); root.add(new WTextField(Text.literal("Type something...")).setMaxLength(64), 0, 7, 5, 1); - root.add(new WLabel(Text.literal("Large slot:")), 0, 9); - root.add(WItemSlot.outputOf(blockInventory, 0), 4, 9); + root.add(new WLabel(Text.literal("Large Glass-only output:")), 0, 9); + root.add(WItemSlot.outputOf(blockInventory, 0).setOutputFilter(stack -> stack.isOf(Items.GLASS)), 4, 9); - root.add(WItemSlot.of(blockInventory, 7).setIcon(new TextureIcon(new Identifier("libgui-test", "saddle.png"))), 7, 9); + root.add(WItemSlot.of(blockInventory, 7).setIcon(new TextureIcon(new Identifier("libgui-test", "saddle.png"))).setInputFilter(stack -> stack.isOf(Items.SADDLE)), 7, 10); root.add(createPlayerInventoryPanel(), 0, 11); System.out.println(root.toString()); this.getRootPanel().validate(this); - getRootPanel().streamChildren() - .forEach(child -> { - if (child instanceof WItemSlot wis) { - // Prevent apples from entering the item slots - wis.setFilter(stack -> !stack.isOf(Items.APPLE)); - } - }); - ScreenNetworking.of(this, NetworkSide.SERVER).receive(TEST_MESSAGE, buf -> { System.out.println("Received on the server!"); }); |