diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-06-11 12:06:03 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-06-11 12:06:03 +1000 |
commit | 16b995411be18eca272bc591f798cbf5a3f927e0 (patch) | |
tree | 2963b7bcc16bfb57eb7f34357e5122a128446733 /src/Java/gtPlusPlus/core/util/item | |
parent | 875d6ed05ea1ffc327123bd577dcdeb757d106e1 (diff) | |
download | GT5-Unofficial-16b995411be18eca272bc591f798cbf5a3f927e0.tar.gz GT5-Unofficial-16b995411be18eca272bc591f798cbf5a3f927e0.tar.bz2 GT5-Unofficial-16b995411be18eca272bc591f798cbf5a3f927e0.zip |
$ Added a fix to prioritise Gregtech Dusts when accessing the OreDictionary.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/item')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/item/ItemUtils.java | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java index 95af0ed9aa..16fac94c63 100644 --- a/src/Java/gtPlusPlus/core/util/item/ItemUtils.java +++ b/src/Java/gtPlusPlus/core/util/item/ItemUtils.java @@ -251,9 +251,23 @@ public class ItemUtils { Utils.LOG_INFO("Looking up: "+oredictName+" - from method: "+ReflectionUtils.getMethodName(4)); Utils.LOG_INFO("Looking up: "+oredictName+" - from method: "+ReflectionUtils.getMethodName(5)); } - final ItemStack returnValue = getItemStackOfAmountFromOreDict(oredictName, amount); - if ((returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass()) || (returnValue.getItem() != ModItems.AAA_Broken)){ - return returnValue.copy(); + + //Adds a check to grab dusts using GT methodology if possible. + ItemStack returnValue = null; + if (oredictName.toLowerCase().contains("dust")){ + String MaterialName = oredictName.toLowerCase().replace("dust", ""); + Materials m = Materials.get(MaterialName); + returnValue = getGregtechDust(m, amount); + if (returnValue != null){ + return returnValue; + } + } + + if (returnValue == null){ + returnValue = getItemStackOfAmountFromOreDict(oredictName, amount); + if ((returnValue.getItem().getClass() != ModItems.AAA_Broken.getClass()) || (returnValue.getItem() != ModItems.AAA_Broken)){ + return returnValue.copy(); + } } Utils.LOG_INFO(oredictName+" was not valid."); return null; @@ -286,7 +300,7 @@ public class ItemUtils { new BaseItemDustUnique("itemDustTiny"+unlocalizedName, materialName, Colour, "Tiny")}; return output; } - + public static Item generateSpecialUsePlate(String internalName, String displayName, short[] rgb, int radioactivity){ return new BaseItemPlate_OLD(internalName, displayName, Utils.rgbtoHexValue(rgb[0], rgb[1], rgb[2]), radioactivity); } |