From 1c5842d322b3ffa43520ce628c54618dac24ca22 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Sun, 9 Apr 2023 21:11:15 +0300 Subject: test: Clean up GuiItem by using getStackInHand --- GuiTest/src/main/java/io/github/cottonmc/test/GuiItem.java | 3 +-- 1 file changed, 1 insertion(+), 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(ActionResult.SUCCESS, (hand==Hand.MAIN_HAND) ? player.getMainHandStack() : player.getOffHandStack()); + return new TypedActionResult<>(ActionResult.SUCCESS, player.getStackInHand(hand)); } @Environment(EnvType.CLIENT) -- cgit