aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuuxel <6596629+Juuxel@users.noreply.github.com>2020-10-11 13:20:35 +0300
committerJuuxel <6596629+Juuxel@users.noreply.github.com>2020-10-11 13:20:35 +0300
commita3484c8995e5bb0026a8a931c7a4bbbb78e92d68 (patch)
tree4e9f47436f42f527aa98490f280e7667a796ab73
parent4ab25171b40e2104f117968b2d52607a64e34a8e (diff)
downloadLibGui-a3484c8995e5bb0026a8a931c7a4bbbb78e92d68.tar.gz
LibGui-a3484c8995e5bb0026a8a931c7a4bbbb78e92d68.tar.bz2
LibGui-a3484c8995e5bb0026a8a931c7a4bbbb78e92d68.zip
Add WPlayerInvPanel.createInventoryLabel
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java11
1 files changed, 9 insertions, 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 3879e1f..2a64a74 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
@@ -34,7 +34,7 @@ public class WPlayerInvPanel extends WPlainPanel {
* @since 2.0.0
*/
public WPlayerInvPanel(PlayerInventory playerInventory, boolean hasLabel) {
- this(playerInventory, hasLabel ? createDefaultLabel(playerInventory) : null);
+ this(playerInventory, hasLabel ? createInventoryLabel(playerInventory) : null);
}
/**
@@ -59,7 +59,14 @@ public class WPlayerInvPanel extends WPlainPanel {
this.add(hotbar, 0, y + 58);
}
- private static WLabel createDefaultLabel(PlayerInventory playerInventory) {
+ /**
+ * Creates a vanilla-style inventory label for a player inventory.
+ *
+ * @param playerInventory the player inventory
+ * @return the created label
+ * @since 3.1.0
+ */
+ public static WLabel createInventoryLabel(PlayerInventory playerInventory) {
WLabel label = new WLabel(playerInventory.getDisplayName());
label.setSize(9*18, 11);
return label;