From 71fb43e6fffea815338a062472184b4ca00a404e Mon Sep 17 00:00:00 2001 From: Christian Koop Date: Mon, 13 Dec 2021 17:59:25 +0100 Subject: [PATCH] Removes `ItemUtils#setMaxStack` --- .../com/songoda/core/utils/ItemUtils.java | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/Core/src/main/java/com/songoda/core/utils/ItemUtils.java b/Core/src/main/java/com/songoda/core/utils/ItemUtils.java index 235cb2e0..12afdbc7 100644 --- a/Core/src/main/java/com/songoda/core/utils/ItemUtils.java +++ b/Core/src/main/java/com/songoda/core/utils/ItemUtils.java @@ -318,34 +318,6 @@ public class ItemUtils { return item; } - private static Class mc_Item = ClassMapping.ITEM.getClazz(); - private static Method mc_Item_getItem; - private static Field mc_Item_maxStackSize; - - static { - if (mc_ItemStack != null) { - try { - mc_Item_getItem = mc_ItemStack.getDeclaredMethod("getItem"); - mc_Item_maxStackSize = mc_Item.getDeclaredField("maxStackSize"); - mc_Item_maxStackSize.setAccessible(true); - } catch (Exception ignore) { - } - } - } - - public static ItemStack setMaxStack(ItemStack item, int max) { - if (item != null && mc_Item_maxStackSize != null) { - try { - Object objItemStack = mc_Item_getItem.invoke(cb_CraftItemStack_asNMSCopy.invoke(null, item)); - mc_Item_maxStackSize.set(objItemStack, max); - } catch (ReflectiveOperationException ex) { - Bukkit.getLogger().log(Level.SEVERE, "Failed to set max stack size on item " + item, ex); - } - } - - return item; - } - public static ItemStack getPlayerSkull(OfflinePlayer player) { ItemStack head = CompatibleMaterial.PLAYER_HEAD.getItem(); if (ServerVersion.isServerVersionBelow(ServerVersion.V1_8)) {