diff options
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java index 720da1692b..485436011f 100644 --- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -1268,5 +1268,40 @@ public class ItemUtils { } return getNullStack(); } + + public static ItemStack getItemListObject(String aObjectFromExperimentalName, String aReplacementName, int aAmount) { + ItemList aItemListObject = getItemListObject(aReplacementName, aReplacementName); + if (aItemListObject == ItemList.NULL || aItemListObject == null) { + return null; + } + else { + return aItemListObject.get(aAmount); + } + } + + public static ItemStack getItemListObject(ItemList aItemListObject, int aAmount) { + if (aItemListObject == ItemList.NULL || aItemListObject == null) { + return null; + } + else { + return aItemListObject.get(aAmount); + } + } + + public static ItemList getItemListObject(String aObjectFromExperimentalName, String aReplacementName) { + ItemList aVal = ItemList.valueOf(aObjectFromExperimentalName); + if (aVal != null) { + return aVal; + } + else { + aVal = ItemList.valueOf(aReplacementName); + if (aVal != null) { + return aVal; + } + else { + return ItemList.NULL; + } + } + } } |