diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-10-11 13:20:35 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-10-11 13:20:35 +0300 |
commit | a3484c8995e5bb0026a8a931c7a4bbbb78e92d68 (patch) | |
tree | 4e9f47436f42f527aa98490f280e7667a796ab73 /src | |
parent | 4ab25171b40e2104f117968b2d52607a64e34a8e (diff) | |
download | LibGui-a3484c8995e5bb0026a8a931c7a4bbbb78e92d68.tar.gz LibGui-a3484c8995e5bb0026a8a931c7a4bbbb78e92d68.tar.bz2 LibGui-a3484c8995e5bb0026a8a931c7a4bbbb78e92d68.zip |
Add WPlayerInvPanel.createInventoryLabel
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WPlayerInvPanel.java | 11 |
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; |