aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/util/minecraft
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2018-03-20 22:09:51 +1000
committerJordan Byrne <draknyte1@hotmail.com>2018-03-20 22:09:51 +1000
commit7c062467bc6c34a5e442392cca4018cf725f811f (patch)
treea44a09ac2abe65849ac48f3fd04859fdb5edb62f /src/Java/gtPlusPlus/core/util/minecraft
parent769b7f51c217f57f6b4c9ef716bd9761f036c861 (diff)
downloadGT5-Unofficial-7c062467bc6c34a5e442392cca4018cf725f811f.tar.gz
GT5-Unofficial-7c062467bc6c34a5e442392cca4018cf725f811f.tar.bz2
GT5-Unofficial-7c062467bc6c34a5e442392cca4018cf725f811f.zip
$ Fixed another instance of things being cached when invalid.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/minecraft')
-rw-r--r--src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
index ffde242f7d..5eaf84d107 100644
--- a/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
+++ b/src/Java/gtPlusPlus/core/util/minecraft/ItemUtils.java
@@ -266,11 +266,11 @@ public class ItemUtils {
mTemp = oredictName.replace("VanadiumSteel", "StainlessSteel");
}
//Use Cache
- if (mOreDictCache.containsKey(mTemp) && mOreDictCache.get(mTemp) != null) {
+ if (mOreDictCache.containsKey(mTemp) && mOreDictCache.get(mTemp) != null && mOreDictCache.get(mTemp).getItem() != ModItems.AAA_Broken) {
//Logger.INFO("[ODC] Returning mOreDictCache value.");
return getCachedValue(mTemp, amount);
}
- else if (mDustCache.containsKey(oredictName) && mDustCache.get(mTemp) != null) {
+ else if (mDustCache.containsKey(oredictName) && mDustCache.get(mTemp) != null && mOreDictCache.get(mTemp).getItem() != ModItems.AAA_Broken) {
//Logger.INFO("[ODC] Returning mDustCache value.");
return getSimpleStack(mDustCache.get(oredictName), amount);
}
@@ -280,7 +280,9 @@ public class ItemUtils {
if (!oreDictList.isEmpty()){
final ItemStack returnValue = oreDictList.get(0).copy();
returnValue.stackSize = amount;
- setCachedValue(mTemp, returnValue);
+ if (returnValue.getItem() != ModItems.AAA_Broken) {
+ setCachedValue(mTemp, returnValue);
+ }
//Logger.INFO("[ODC] Setting and Returning mOreDictCache value.");
return returnValue;
}