diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-04-09 21:11:15 +0300 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-04-09 21:11:15 +0300 |
commit | 1c5842d322b3ffa43520ce628c54618dac24ca22 (patch) | |
tree | 3e3f38ffe97ebceda39b088d038a9421769da049 /GuiTest/src/main/java | |
parent | a28baa6e925c48fb0672cc5f7c146d849f0d76e2 (diff) | |
download | LibGui-1c5842d322b3ffa43520ce628c54618dac24ca22.tar.gz LibGui-1c5842d322b3ffa43520ce628c54618dac24ca22.tar.bz2 LibGui-1c5842d322b3ffa43520ce628c54618dac24ca22.zip |
test: Clean up GuiItem by using getStackInHand
Diffstat (limited to 'GuiTest/src/main/java')
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java b/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java index d629b68..4fbc6df 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java @@ -16,7 +16,6 @@ import io.github.cottonmc.cotton.gui.client.CottonClientScreen; import io.github.cottonmc.test.client.TestClientGui; public class GuiItem extends Item { - public GuiItem() { super(new Item.Settings().rarity(Rarity.EPIC)); } @@ -27,7 +26,7 @@ public class GuiItem extends Item { openScreen(); // In its own method to prevent class loading issues } - return new TypedActionResult<ItemStack>(ActionResult.SUCCESS, (hand==Hand.MAIN_HAND) ? player.getMainHandStack() : player.getOffHandStack()); + return new TypedActionResult<>(ActionResult.SUCCESS, player.getStackInHand(hand)); } @Environment(EnvType.CLIENT) |