From 0577908cfc4f27003e9c808da82088211f02f862 Mon Sep 17 00:00:00 2001 From: Luligabi1 <33578169+Luligabi1@users.noreply.github.com> Date: Mon, 31 Jul 2023 18:13:14 -0300 Subject: [PATCH 1/8] Add input/output filter, weaken WPlayerInvPanel's components' protection --- gradle.properties | 4 +- .../cottonmc/cotton/gui/ValidatedSlot.java | 53 ++++++++++++-- .../cottonmc/cotton/gui/widget/WItemSlot.java | 73 ++++++++++++++++--- .../cotton/gui/widget/WPlayerInvPanel.java | 6 +- .../github/cottonmc/test/TestDescription.java | 26 ++++--- 5 files changed, 127 insertions(+), 35 deletions(-) diff --git a/gradle.properties b/gradle.properties index 0cac8021..9fffed5a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.20 + minecraft_version=1.20.1 yarn_mappings=1.20+build.1 loader_version=0.14.21 @@ -13,7 +13,7 @@ org.gradle.jvmargs=-Xmx1G archives_base_name = LibGui # Dependencies - fabric_version=0.83.0+1.20 + fabric_version=0.86.1+1.20.1 jankson_version=6.0.0+j1.2.3 modmenu_version=7.0.1 libninepatch_version=1.2.0 diff --git a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java index 6d1475c5..7cc661ef 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java @@ -15,7 +15,7 @@ public class ValidatedSlot extends Slot { /** - * The default {@linkplain #setFilter(Predicate) item filter} that allows all items. + * The default {@linkplain #setInputFilter(Predicate) item filter} that allows all items. * * @since 5.1.1 */ @@ -24,7 +24,8 @@ public class ValidatedSlot extends Slot { private final int slotNumber; private boolean insertingAllowed = true; private boolean takingAllowed = true; - private Predicate filter = DEFAULT_ITEM_FILTER; + private Predicate inputFilter = DEFAULT_ITEM_FILTER; + private Predicate outputFilter = DEFAULT_ITEM_FILTER; protected final Multimap listeners = HashMultimap.create(); private boolean visible = true; @@ -36,12 +37,12 @@ public ValidatedSlot(Inventory inventory, int index, int x, int y) { @Override public boolean canInsert(ItemStack stack) { - return insertingAllowed && inventory.isValid(slotNumber, stack) && filter.test(stack); + return insertingAllowed && inventory.isValid(slotNumber, stack) && inputFilter.test(stack); // works fine } @Override public boolean canTakeItems(PlayerEntity player) { - return takingAllowed && inventory.canPlayerUse(player); + return takingAllowed && inventory.canPlayerUse(player) && outputFilter.test(getStack()); // doesn't } @Override @@ -115,24 +116,64 @@ public void setTakingAllowed(boolean takingAllowed) { this.takingAllowed = takingAllowed; } + /** + * Gets the item stack input filter of this slot. + * + * @return the item input filter + */ + public Predicate getInputFilter() { + return inputFilter; + } + + /** + * Sets the item stack input filter of this slot. + * + * @param inputFilter the new item input filter + */ + public void setInputFilter(Predicate inputFilter) { + this.inputFilter = inputFilter; + } + + /** + * Gets the item stack output filter of this slot. + * + * @return the item output filter + */ + public Predicate getOutputFilter() { + return outputFilter; + } + + /** + * Sets the item stack output filter of this slot. + * + * @param outputFilter the new item output filter + */ + public void setOutputFilter(Predicate outputFilter) { + this.outputFilter = outputFilter; + } + /** * Gets the item stack filter of this slot. * * @return the item filter + * @deprecated Replaced by {@link #getInputFilter()} * @since 2.0.0 */ + @Deprecated public Predicate getFilter() { - return filter; + return inputFilter; } /** * Sets the item stack filter of this slot. * * @param filter the new item filter + * @deprecated Replaced by {@link #setInputFilter(Predicate)} * @since 2.0.0 */ + @Deprecated public void setFilter(Predicate filter) { - this.filter = filter; + setInputFilter(filter); } /** diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java index 3ef3684c..c7eb4477 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java @@ -46,13 +46,16 @@ * between the player and the widget. * *

Filters

- * Item slots can have filters that check whether a player is allowed to insert an item or not. - * The filter can be set with {@link #setFilter(Predicate)}. For example: + * Item slots can have filters that check whether a player is allowed to insert or take out an item or not. + * The filters can be set with {@link #setInputFilter(Predicate)} and {@link #setOutputFilter(Predicate)}. For example: * *
  * {@code
- * // Only sand in this slot!
- * slot.setFilter(stack -> stack.getItem() == Items.SAND);
+ * // Only sand can be placed on this slot
+ * slot.setInputFilter(stack -> stack.isOf(Items.SAND));
+ *
+ * // Everything except glass can be taken out of this slot
+ * slot.setOutputFilter(stack -> !stack.isOf(Items.GLASS));
  * }
  * 
* @@ -94,7 +97,8 @@ public class WItemSlot extends WWidget { private boolean takingAllowed = true; private int focusedSlot = -1; private int hoveredSlot = -1; - private Predicate filter = ValidatedSlot.DEFAULT_ITEM_FILTER; + private Predicate inputFilter = ValidatedSlot.DEFAULT_ITEM_FILTER; + private Predicate outputFilter = ValidatedSlot.DEFAULT_ITEM_FILTER; private final Set listeners = new HashSet<>(); private final FocusModel focusModel = new FocusModel<>() { @Override @@ -338,7 +342,8 @@ public void validate(GuiDescription host) { ValidatedSlot slot = createSlotPeer(inventory, index, this.getAbsoluteX() + (x * 18) + 1, this.getAbsoluteY() + (y * 18) + 1); slot.setInsertingAllowed(insertingAllowed); slot.setTakingAllowed(takingAllowed); - slot.setFilter(filter); + slot.setInputFilter(inputFilter); + slot.setOutputFilter(outputFilter); for (ChangeListener listener : listeners) { slot.addChangeListener(this, listener); } @@ -400,14 +405,61 @@ public void setBackgroundPainter(@Nullable BackgroundPainter painter) { this.backgroundPainter = painter; } + /** + * Gets the item stack input filter of this slot. + * + * @return the item input filter + */ + public Predicate getInputFilter() { + return inputFilter; + } + + /** + * Sets the item input filter of this item slot. + * + * @param inputFilter the new item input filter + * @return this item slot + */ + public WItemSlot setInputFilter(Predicate inputFilter) { + this.inputFilter = inputFilter; + for (ValidatedSlot peer : peers) { + peer.setInputFilter(inputFilter); + } + return this; + } + + /** + * Gets the item stack output filter of this slot. + * + * @return the item output filter + */ + public Predicate getOutputFilter() { + return outputFilter; + } + + /** + * Sets the item output filter of this item slot. + * + * @param outputFilter the new item output filter + * @return this item slot + */ + public WItemSlot setOutputFilter(Predicate outputFilter) { + this.outputFilter = outputFilter; + for (ValidatedSlot peer : peers) { + peer.setOutputFilter(outputFilter); + } + return this; + } + /** * Gets the item filter of this item slot. * * @return the item filter + * @deprecated Replaced by {@link #getInputFilter()} * @since 2.0.0 */ public Predicate getFilter() { - return filter; + return inputFilter; } /** @@ -415,14 +467,11 @@ public Predicate getFilter() { * * @param filter the new item filter * @return this item slot + * @deprecated Replaced by {@link #setInputFilter(Predicate)} * @since 2.0.0 */ public WItemSlot setFilter(Predicate filter) { - this.filter = filter; - for (ValidatedSlot peer : peers) { - peer.setFilter(filter); - } - return this; + return setInputFilter(filter); } @Environment(EnvType.CLIENT) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java index d0fd0012..cc6c5b5a 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java @@ -14,10 +14,10 @@ * A player inventory widget that has a visually separate hotbar. */ public class WPlayerInvPanel extends WPlainPanel { - private final WItemSlot inv; - private final WItemSlot hotbar; + protected final WItemSlot inv; + protected final WItemSlot hotbar; @Nullable - private final WWidget label; + protected final WWidget label; /** * Constructs a player inventory panel with a label. diff --git a/src/testMod/java/io/github/cottonmc/test/TestDescription.java b/src/testMod/java/io/github/cottonmc/test/TestDescription.java index 39b09d6a..d3d26e17 100644 --- a/src/testMod/java/io/github/cottonmc/test/TestDescription.java +++ b/src/testMod/java/io/github/cottonmc/test/TestDescription.java @@ -40,32 +40,34 @@ public TestDescription(ScreenHandlerType type, int syncId, PlayerInventory pl root.add(buttonA, 0, 3, 4, 1); WButton buttonB = new WButton(Text.literal("Show Warnings")); - buttonB.setOnClick(() -> slot.setIcon(new TextureIcon(new Identifier("libgui-test", "saddle.png")))); + buttonB.setOnClick(() -> { + slot.setIcon(new TextureIcon(new Identifier("libgui-test", "saddle.png"))); + }); + root.add(buttonB, 5, 3, 4, 1); TextureIcon testIcon = new TextureIcon(new Texture(new Identifier("libgui-test", "icon.png"))); + + root.add(new WButton(testIcon, Text.literal("Button C")), 0, 5, 4, 1); 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, 9 + ); 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!"); }); From 1f30156b29c85273ae4168c3096c80485d0c5203 Mon Sep 17 00:00:00 2001 From: Luligabi1 <33578169+Luligabi1@users.noreply.github.com> Date: Mon, 31 Jul 2023 18:35:47 -0300 Subject: [PATCH 2/8] Remove unintended comments --- .../java/io/github/cottonmc/cotton/gui/ValidatedSlot.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java index 7cc661ef..a12d4e97 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java @@ -37,12 +37,12 @@ public ValidatedSlot(Inventory inventory, int index, int x, int y) { @Override public boolean canInsert(ItemStack stack) { - return insertingAllowed && inventory.isValid(slotNumber, stack) && inputFilter.test(stack); // works fine + return insertingAllowed && inventory.isValid(slotNumber, stack) && inputFilter.test(stack); } @Override public boolean canTakeItems(PlayerEntity player) { - return takingAllowed && inventory.canPlayerUse(player) && outputFilter.test(getStack()); // doesn't + return takingAllowed && inventory.canPlayerUse(player) && outputFilter.test(getStack()); } @Override From d9f37cadd14bb342a18cdfe196b32466988b1558 Mon Sep 17 00:00:00 2001 From: Luligabi1 <33578169+Luligabi1@users.noreply.github.com> Date: Tue, 1 Aug 2023 15:36:39 -0300 Subject: [PATCH 3/8] Bump yarn version, revert formatting changes, add missing deprecated annotations --- gradle.properties | 16 ++++++++-------- .../cottonmc/cotton/gui/widget/WItemSlot.java | 2 ++ .../io/github/cottonmc/test/TestDescription.java | 12 ++---------- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9fffed5a..11834d6d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,11 +1,11 @@ # Done to increase the memory available to gradle. -org.gradle.jvmargs=-Xmx1G +org.gradle.jvmargs = -Xmx1G # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.20.1 - yarn_mappings=1.20+build.1 - loader_version=0.14.21 + minecraft_version = 1.20.1 + yarn_mappings = 1.20.1+build.10 + loader_version = 0.14.21 # Mod Properties mod_version = 8.0.2 @@ -13,7 +13,7 @@ org.gradle.jvmargs=-Xmx1G archives_base_name = LibGui # Dependencies - fabric_version=0.86.1+1.20.1 - jankson_version=6.0.0+j1.2.3 - modmenu_version=7.0.1 - libninepatch_version=1.2.0 + fabric_version = 0.86.1+1.20.1 + jankson_version = 6.0.0+j1.2.3 + modmenu_version = 7.0.1 + libninepatch_version = 1.2.0 diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java index c7eb4477..11542a4b 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java @@ -458,6 +458,7 @@ public WItemSlot setOutputFilter(Predicate outputFilter) { * @deprecated Replaced by {@link #getInputFilter()} * @since 2.0.0 */ + @Deprecated public Predicate getFilter() { return inputFilter; } @@ -470,6 +471,7 @@ public Predicate getFilter() { * @deprecated Replaced by {@link #setInputFilter(Predicate)} * @since 2.0.0 */ + @Deprecated public WItemSlot setFilter(Predicate filter) { return setInputFilter(filter); } diff --git a/src/testMod/java/io/github/cottonmc/test/TestDescription.java b/src/testMod/java/io/github/cottonmc/test/TestDescription.java index d3d26e17..aa5b0eb8 100644 --- a/src/testMod/java/io/github/cottonmc/test/TestDescription.java +++ b/src/testMod/java/io/github/cottonmc/test/TestDescription.java @@ -40,10 +40,7 @@ public TestDescription(ScreenHandlerType type, int syncId, PlayerInventory pl root.add(buttonA, 0, 3, 4, 1); WButton buttonB = new WButton(Text.literal("Show Warnings")); - buttonB.setOnClick(() -> { - slot.setIcon(new TextureIcon(new Identifier("libgui-test", "saddle.png"))); - }); - + buttonB.setOnClick(() -> slot.setIcon(new TextureIcon(new Identifier("libgui-test", "saddle.png")))); root.add(buttonB, 5, 3, 4, 1); TextureIcon testIcon = new TextureIcon(new Texture(new Identifier("libgui-test", "icon.png"))); @@ -56,12 +53,7 @@ public TestDescription(ScreenHandlerType type, int syncId, PlayerInventory pl 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"))) - .setInputFilter(stack -> stack.isOf(Items.SADDLE)), - 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()); From 2655ad2b878c6d689df3d0dadada52357c1b286c Mon Sep 17 00:00:00 2001 From: Luligabi1 <33578169+Luligabi1@users.noreply.github.com> Date: Tue, 1 Aug 2023 16:21:41 -0300 Subject: [PATCH 4/8] Added javadocs for WPlayerInvPanel's fields --- .../cotton/gui/widget/WPlayerInvPanel.java | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java index cc6c5b5a..c59847ef 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java @@ -1,5 +1,7 @@ package io.github.cottonmc.cotton.gui.widget; +import io.github.cottonmc.cotton.gui.SyncedGuiDescription; + import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.entity.player.PlayerInventory; @@ -12,10 +14,29 @@ /** * A player inventory widget that has a visually separate hotbar. + * + * @see SyncedGuiDescription#createPlayerInventoryPanel() */ public class WPlayerInvPanel extends WPlainPanel { - protected final WItemSlot inv; + /** + * A 9 by 3 {@link WItemSlot} that represents the player's inventory. + * + * @see PlayerInventory + */ + protected final WItemSlot inventory; + /** + * A 9 by 1 {@link WItemSlot} that represents the player's hotbar. + * + * @see PlayerInventory + */ protected final WItemSlot hotbar; + /** + * The label seen above {@link WPlayerInvPanel#inventory}. + * + *

In vanilla and {@link WPlayerInvPanel#WPlayerInvPanel(PlayerInventory)}, this label is always 'Inventory' + * + * @see #createInventoryLabel(PlayerInventory) + */ @Nullable protected final WWidget label; @@ -55,14 +76,14 @@ public WPlayerInvPanel(PlayerInventory playerInventory, @Nullable WWidget label) y += label.getHeight(); } - inv = WItemSlot.ofPlayerStorage(playerInventory); + inventory = WItemSlot.ofPlayerStorage(playerInventory); hotbar = new WItemSlot(playerInventory, 0, 9, 1, false) { @Override protected Text getNarrationName() { return NarrationMessages.Vanilla.HOTBAR; } }; - this.add(inv, 0, y); + this.add(inventory, 0, y); this.add(hotbar, 0, y + 58); } @@ -94,7 +115,7 @@ public static WLabel createInventoryLabel(PlayerInventory playerInventory) { @Override public WPanel setBackgroundPainter(BackgroundPainter painter) { super.setBackgroundPainter(null); - inv.setBackgroundPainter(painter); + inventory.setBackgroundPainter(painter); hotbar.setBackgroundPainter(painter); return this; } From 381cf75df6295006ea4ef047c32bd6fdef29e8b5 Mon Sep 17 00:00:00 2001 From: Luligabi1 <33578169+Luligabi1@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:20:52 -0300 Subject: [PATCH 5/8] Checkstyle fix --- .../io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java index c59847ef..9411164f 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java @@ -1,13 +1,12 @@ package io.github.cottonmc.cotton.gui.widget; -import io.github.cottonmc.cotton.gui.SyncedGuiDescription; - import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.text.Text; import io.github.cottonmc.cotton.gui.GuiDescription; +import io.github.cottonmc.cotton.gui.SyncedGuiDescription; import io.github.cottonmc.cotton.gui.client.BackgroundPainter; import io.github.cottonmc.cotton.gui.impl.client.NarrationMessages; import org.jetbrains.annotations.Nullable; From 08c2417aeae39b53e0b52855ba41bc01ba28054e Mon Sep 17 00:00:00 2001 From: Luiz Feikes <33578169+Luligabi1@users.noreply.github.com> Date: Wed, 2 Aug 2023 14:33:11 -0300 Subject: [PATCH 6/8] Adjust ValidatedSlot#DEFAULT_ITEM_FILTER's javadoc Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com> --- src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java index a12d4e97..31cb59f9 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java @@ -15,7 +15,7 @@ public class ValidatedSlot extends Slot { /** - * The default {@linkplain #setInputFilter(Predicate) item filter} that allows all items. + * The default {@linkplain #setInputFilter(Predicate) item filter} that allows all items. * * @since 5.1.1 */ From 37f3617235c4829a71591f035fc8160adc6baa8f Mon Sep 17 00:00:00 2001 From: Luiz Feikes <33578169+Luligabi1@users.noreply.github.com> Date: Wed, 2 Aug 2023 14:33:49 -0300 Subject: [PATCH 7/8] Remove unnecessary line breaks on TestDescription Co-authored-by: Juuz <6596629+Juuxel@users.noreply.github.com> --- src/testMod/java/io/github/cottonmc/test/TestDescription.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/testMod/java/io/github/cottonmc/test/TestDescription.java b/src/testMod/java/io/github/cottonmc/test/TestDescription.java index aa5b0eb8..fdea2119 100644 --- a/src/testMod/java/io/github/cottonmc/test/TestDescription.java +++ b/src/testMod/java/io/github/cottonmc/test/TestDescription.java @@ -44,8 +44,6 @@ public TestDescription(ScreenHandlerType type, int syncId, PlayerInventory pl root.add(buttonB, 5, 3, 4, 1); TextureIcon testIcon = new TextureIcon(new Texture(new Identifier("libgui-test", "icon.png"))); - - root.add(new WButton(testIcon, Text.literal("Button C")), 0, 5, 4, 1); 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); From 2bd634934da4759243453bd6b9c10795b2da4a09 Mon Sep 17 00:00:00 2001 From: Luligabi1 <33578169+Luligabi1@users.noreply.github.com> Date: Wed, 2 Aug 2023 14:35:39 -0300 Subject: [PATCH 8/8] Revert style change on gradle.properties --- gradle.properties | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/gradle.properties b/gradle.properties index 11834d6d..2478fe05 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,19 +1,19 @@ # Done to increase the memory available to gradle. -org.gradle.jvmargs = -Xmx1G +org.gradle.jvmargs=-Xmx1G # Fabric Properties - # check these on https://fabricmc.net/develop - minecraft_version = 1.20.1 - yarn_mappings = 1.20.1+build.10 - loader_version = 0.14.21 +# check these on https://fabricmc.net/develop +minecraft_version=1.20.1 +yarn_mappings=1.20.1+build.10 +loader_version=0.14.21 # Mod Properties - mod_version = 8.0.2 - maven_group = io.github.cottonmc - archives_base_name = LibGui +mod_version = 8.0.2 +maven_group = io.github.cottonmc +archives_base_name = LibGui # Dependencies - fabric_version = 0.86.1+1.20.1 - jankson_version = 6.0.0+j1.2.3 - modmenu_version = 7.0.1 - libninepatch_version = 1.2.0 +fabric_version=0.86.1+1.20.1 +jankson_version=6.0.0+j1.2.3 +modmenu_version=7.0.1 +libninepatch_version=1.2.0