aboutsummaryrefslogtreecommitdiff
path: root/GuiTest/src/main
diff options
context:
space:
mode:
authorJuuz <6596629+Juuxel@users.noreply.github.com>2021-06-05 00:13:59 +0300
committerJuuz <6596629+Juuxel@users.noreply.github.com>2021-06-05 00:14:22 +0300
commita1bb6316f2d6ecc0019e00438b4cf724dde68f73 (patch)
tree05edeedca30fa5a5a50085b594244aa66ef569cc /GuiTest/src/main
parent1aba27451ce4b95dc7a832938998c9d1581eee97 (diff)
downloadLibGui-a1bb6316f2d6ecc0019e00438b4cf724dde68f73.tar.gz
LibGui-a1bb6316f2d6ecc0019e00438b4cf724dde68f73.tar.bz2
LibGui-a1bb6316f2d6ecc0019e00438b4cf724dde68f73.zip
Switch from accessor to AW, fixes #113
Accessors would be preferred but there is a mixin bug/regression that prevents me from modifying final fields with accessors unless I do some concerning hacky code.
Diffstat (limited to 'GuiTest/src/main')
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java12
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);
+ }
}
}