From 28eaa261e316518d83460b94c7b3678ac00acf7e Mon Sep 17 00:00:00 2001 From: repo_alt Date: Fri, 4 Dec 2020 00:06:25 +0300 Subject: Non-GT ores support for the seismic prospector (GT++, BW(?)) --- .../basic/GT_MetaTileEntity_AdvSeismicProspector.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities') 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; } -- cgit From c681266385d0516b0683716358fa6fb19b148991 Mon Sep 17 00:00:00 2001 From: repo_alt Date: Mon, 7 Dec 2020 02:41:56 +0300 Subject: Drilling plant uses absolute coordinates where single block uses relative --- build.properties | 2 +- .../machines/multi/GT_MetaTileEntity_OreDrillingPlantBase.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities') diff --git a/build.properties b/build.properties index fdeac78135..c5aaaee51d 100644 --- a/build.properties +++ b/build.properties @@ -1,6 +1,6 @@ minecraft.version=1.7.10 forge.version=10.13.4.1614-1.7.10 -gt.version=5.09.33.58 +gt.version=5.09.33.59 ae2.version=rv3-beta-22 applecore.version=1.7.10-1.2.1+107.59407 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))) -- cgit From c4178e75b713cb064c6a8787e76c69f5b357b4e7 Mon Sep 17 00:00:00 2001 From: korneel vandamme Date: Mon, 7 Dec 2020 05:05:49 +0100 Subject: add simple allowPutStack cache --- .../basic/GT_MetaTileEntity_Boxinator.java | 24 ++++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/main/java/gregtech/common/tileentities') 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) -- cgit