diff --git a/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java b/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java index 06d35c16..933df8a2 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/params/types/custom/ParamInfoItemBlock.java @@ -43,7 +43,7 @@ public class ParamInfoItemBlock extends ParamInfoItemStack { @Override public Object fromString(String string) { - String[] split = string.split("[ -]", -1); + String[] split = string.split("[:, -]", -1); if (split.length > (NmsVersion.v1_13.isSupported() ? 1 : 3)) { throw new IllegalArgumentException(); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java b/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java index 36e32b14..1bb7be5b 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/reflection/ReflectionManager.java @@ -1530,18 +1530,12 @@ public class ReflectionManager { public static int getCombinedIdByItemStack(ItemStack itemStack) { try { - Object nmsBlock; - - if (NmsVersion.v1_13.isSupported()) { - nmsBlock = magicGetBlock.invoke(null, itemStack.getType()); - } else { - Object nmsItem = getNmsItem(itemStack); - - Object item = getNmsItem.invoke(nmsItem); - - nmsBlock = getOldItemAsBlock.invoke(null, item); + if (!NmsVersion.v1_13.isSupported()) { + return itemStack.getType().ordinal() + (itemStack.getDurability() << 12); } + Object nmsBlock = magicGetBlock.invoke(null, itemStack.getType()); + Object iBlockData = getBlockData.invoke(nmsBlock); return (int) getBlockDataAsId.invoke(null, iBlockData);