diff options
author | Prometheus0000 <prometheus0000000@gmail.com> | 2020-12-08 14:29:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-08 14:29:47 -0500 |
commit | f7388b4c5e74b57b6d01bec1b9d36dada1a734f2 (patch) | |
tree | 172ce7dff17bf8ad2fbf8d144bb4c428371c5a52 /src/main/java/gregtech/common | |
parent | 3ea02985a752745280981021bba93323ae39cf2c (diff) | |
parent | ec0489acfd984e3e29e9cf0a664dd5cfcca0581b (diff) | |
download | GT5-Unofficial-f7388b4c5e74b57b6d01bec1b9d36dada1a734f2.tar.gz GT5-Unofficial-f7388b4c5e74b57b6d01bec1b9d36dada1a734f2.tar.bz2 GT5-Unofficial-f7388b4c5e74b57b6d01bec1b9d36dada1a734f2.zip |
Merge pull request #14 from GTNewHorizons/experimental
update
Diffstat (limited to 'src/main/java/gregtech/common')
4 files changed, 23 insertions, 16 deletions
diff --git a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java index 2cba79d6e3..d7e8ad23f0 100644 --- a/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java +++ b/src/main/java/gregtech/common/blocks/GT_Block_Casings6.java @@ -26,7 +26,7 @@ public class GT_Block_Casings6 GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Hermetic Casing V"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".6.name", "Hermetic Casing VI"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".7.name", "Hermetic Casing VII"); - GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Hermetic Casing VII"); + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".8.name", "Hermetic Casing VIII"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Hermetic Casing IX"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".10.name", "Hermetic Casing X"); GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".11.name", "Hermetic Casing XI"); diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java index 46ea555ad0..28f661c339 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_AdvSeismicProspector.java @@ -216,12 +216,13 @@ public class GT_MetaTileEntity_AdvSeismicProspector extends GT_MetaTileEntity_Ba } } else { int tMetaID = getBaseMetaTileEntity().getWorld().getBlockMetadata(x, y, z); - ItemData tAssotiation = GT_OreDictUnificator.getAssociation(new ItemStack(tBlock, 1, tMetaID)); - - if ((tAssotiation != null) && (tAssotiation.mPrefix.toString().startsWith("ore"))) - return tAssotiation.mMaterial.mMaterial.mDefaultLocalName; + ItemStack is = new ItemStack(tBlock, 1, tMetaID); + ItemData association = GT_OreDictUnificator.getAssociation(is); + if ((association != null) && (association.mPrefix.toString().startsWith("ore"))) + return association.mMaterial.mMaterial.mDefaultLocalName; + else if (GT_Utility.isOre(is)) + return tBlock.getLocalizedName(); } - return null; } diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java index f883968e35..6895310b46 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_Boxinator.java @@ -6,6 +6,7 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Recipe; @@ -38,7 +39,7 @@ public class GT_MetaTileEntity_Boxinator return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; } - private boolean hasValidCache(ItemStack mItem,int mType) { + private boolean hasValidCache(ItemStack mItem,int mType,boolean mClearOnFailure) { if (aInputCache != null && aOutputCache != null && aTypeCache == mType @@ -46,9 +47,11 @@ public class GT_MetaTileEntity_Boxinator && ItemStack.areItemStackTagsEqual(mItem,aInputCache)) return true; // clear cache if it was invalid - aInputCache = null; - aOutputCache = null; - aTypeCache = 0; + if (mClearOnFailure) { + aInputCache = null; + aOutputCache = null; + aTypeCache = 0; + } return false; } @@ -67,7 +70,7 @@ public class GT_MetaTileEntity_Boxinator ItemStack tSlot1 = getInputAt(1); if ((GT_Utility.isStackValid(tSlot0)) && (GT_Utility.isStackValid(tSlot1)) && (GT_Utility.getContainerItem(tSlot0, true) == null)) { if ((ItemList.Schematic_1by1.isStackEqual(tSlot1)) && (tSlot0.stackSize >= 1)) { - boolean tIsCached = hasValidCache(tSlot0,1); + boolean tIsCached = hasValidCache(tSlot0,1,true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { @@ -84,7 +87,7 @@ public class GT_MetaTileEntity_Boxinator return DID_NOT_FIND_RECIPE; } if ((ItemList.Schematic_2by2.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 4)) { - boolean tIsCached = hasValidCache(tSlot0,2); + boolean tIsCached = hasValidCache(tSlot0,2,true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, null, tSlot0, tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { @@ -101,7 +104,7 @@ public class GT_MetaTileEntity_Boxinator return DID_NOT_FIND_RECIPE; } if ((ItemList.Schematic_3by3.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 9)) { - boolean tIsCached = hasValidCache(tSlot0,3); + boolean tIsCached = hasValidCache(tSlot0,3,true); this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0, tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { @@ -123,8 +126,11 @@ public class GT_MetaTileEntity_Boxinator public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { if (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)) { - if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) || (ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) || (ItemList.Schematic_3by3.isStackEqual(getInputAt(1)))) { - if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[mTier], null, new ItemStack[]{GT_Utility.copyAmount(64L, new Object[]{aStack}), getInputAt(1)}) != null) { + ItemStack tInput1 = getInputAt(1); + if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.isStackEqual(tInput1)) || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { + if (hasValidCache(aStack,aTypeCache,false)) + return true; + if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe(getBaseMetaTileEntity(), true, gregtech.api.enums.GT_Values.V[mTier], null, new ItemStack[]{GT_Utility.copyAmount(64L, new Object[]{aStack}), tInput1}) != null) { return true; } if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GT_ModHandler.getRecipeOutput(new ItemStack[]{aStack}) != null) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java index 2e367e63e8..e34ed7466f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java @@ -324,7 +324,7 @@ public abstract class GT_MetaTileEntity_OreDrillingPlantBase extends GT_MetaTile ChunkPosition blockPos = new ChunkPosition(x, y, z); if (!oreBlockPositions.contains(blockPos)) { if (block instanceof GT_Block_Ores_Abstract) { - TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, y, z); + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntity(x, y, z); if (tTileEntity instanceof GT_TileEntity_Ores && ((GT_TileEntity_Ores) tTileEntity).mNatural) oreBlockPositions.add(blockPos); } else if (GT_Utility.isOre(new ItemStack(block, 1, blockMeta))) |