diff options
author | Prometheus0000 <prometheus0000000@gmail.com> | 2020-12-03 15:02:06 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-03 15:02:06 -0500 |
commit | 3ea02985a752745280981021bba93323ae39cf2c (patch) | |
tree | 7b4a062b9bb3d98b09142db1d3f77774490f2466 /src/main | |
parent | 926bcc78f0245bd894733ba629b9e3e4343b6aed (diff) | |
parent | 26035bacd145da77b9b7109f574503cb41f302e1 (diff) | |
download | GT5-Unofficial-3ea02985a752745280981021bba93323ae39cf2c.tar.gz GT5-Unofficial-3ea02985a752745280981021bba93323ae39cf2c.tar.bz2 GT5-Unofficial-3ea02985a752745280981021bba93323ae39cf2c.zip |
Merge pull request #13 from GTNewHorizons/experimental
update
Diffstat (limited to 'src/main')
36 files changed, 143 insertions, 33 deletions
diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index c7df2b219d..b46d26e02d 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -1778,6 +1778,7 @@ public class Materials implements IColorModulationContainer, ISubTagContainer { Inolashite, Mercassium, MeteoricIron, + BloodInfusedIron, MeteoricSteel, Naquadah, diff --git a/src/main/java/gregtech/api/enums/OrePrefixes.java b/src/main/java/gregtech/api/enums/OrePrefixes.java index 86c2812c5c..59c20d412b 100644 --- a/src/main/java/gregtech/api/enums/OrePrefixes.java +++ b/src/main/java/gregtech/api/enums/OrePrefixes.java @@ -731,7 +731,7 @@ public enum OrePrefixes { //Fine Wire if (!enableUnusedFineWires && !(aMaterial == Materials.Steel || aMaterial == Materials.AnnealedCopper || aMaterial == Materials.Platinum || aMaterial == Materials.Osmium || aMaterial == Materials.Tin || aMaterial == Materials.Lead || aMaterial == Materials.SolderingAlloy || aMaterial == Materials.Copper || aMaterial == Materials.Electrum || - aMaterial == Materials.Gold || aMaterial == Materials.RedAlloy || aMaterial == Materials.Graphene || aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.YttriumBariumCuprate )) + aMaterial == Materials.Gold || aMaterial == Materials.RedAlloy || aMaterial == Materials.Graphene || aMaterial == Materials.NiobiumTitanium || aMaterial == Materials.YttriumBariumCuprate || aMaterial == Materials.BloodInfusedIron)) wireFine.mDisabledItems.add(aMaterial); //Gears if (!enableUnusedGears && !(aMaterial == Materials.Aluminium || aMaterial == Materials.Titanium || aMaterial == Materials.Iron || aMaterial == Materials.Copper || diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java index 9d9b45cecf..188af9cfaa 100644 --- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java +++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java @@ -156,6 +156,59 @@ public class GT_OreDictUnificator { return GT_Utility.copyAmount(aStack.stackSize, rStack); } + /** Doesn't copy the returned stack or set quantity. Be careful and do not mutate it; + * intended only to optimize comparisons */ + static ItemStack get_nocopy(boolean aUseBlackList, ItemStack aStack) { + if (GT_Utility.isStackInvalid(aStack)) return null; + ItemData tPrefixMaterial = getAssociation(aStack); + ItemStack rStack = null; + if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData() || (aUseBlackList && tPrefixMaterial.mBlackListed)) + return aStack; + if (aUseBlackList && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { + tPrefixMaterial.mBlackListed = true; + return aStack; + } + if (tPrefixMaterial.mUnificationTarget == null) + tPrefixMaterial.mUnificationTarget = sName2StackMap.get(tPrefixMaterial.toString()); + rStack = tPrefixMaterial.mUnificationTarget; + if (GT_Utility.isStackInvalid(rStack)) return aStack; + assert rStack != null; + rStack.setTagCompound(aStack.getTagCompound()); + return rStack; + } + + /** Compares the first argument against an already-unificated second argument as if + * aUseBlackList was both true and false. */ + public static boolean isInputStackEqual(ItemStack aStack, ItemStack unified_tStack) { + boolean alreadyCompared = false; + if (GT_Utility.isStackInvalid(aStack)) return false; + ItemData tPrefixMaterial = getAssociation(aStack); + ItemStack rStack = null; + if (tPrefixMaterial == null || !tPrefixMaterial.hasValidPrefixMaterialData()) + return GT_Utility.areStacksEqual(aStack, unified_tStack, true); + else if(tPrefixMaterial.mBlackListed) { + if (GT_Utility.areStacksEqual(aStack, unified_tStack, true)) + return true; + else + alreadyCompared = true; + } + if (!alreadyCompared && !GregTech_API.sUnificationEntriesRegistered && isBlacklisted(aStack)) { + tPrefixMaterial.mBlackListed = true; + if (GT_Utility.areStacksEqual(aStack, unified_tStack, true)) + return true; + else + alreadyCompared = true; + } + if (tPrefixMaterial.mUnificationTarget == null) + tPrefixMaterial.mUnificationTarget = sName2StackMap.get(tPrefixMaterial.toString()); + rStack = tPrefixMaterial.mUnificationTarget; + if (GT_Utility.isStackInvalid(rStack)) + return !alreadyCompared && GT_Utility.areStacksEqual(aStack, unified_tStack, true); + assert rStack != null; + rStack.setTagCompound(aStack.getTagCompound()); + return GT_Utility.areStacksEqual(rStack, unified_tStack, true); + } + public static List<ItemStack> getNonUnifiedStacks(Object obj) { synchronized (sUnificationTable) { if (sUnificationTable.isEmpty() && !sItemStack2DataMap.isEmpty()) { diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index bf091695c7..537d92b365 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -389,11 +389,12 @@ public class GT_Recipe implements Comparable<GT_Recipe> { if (mInputs.length > 0 && aInputs == null) return false; for (ItemStack tStack : mInputs) { - if (tStack != null) { + ItemStack unified_tStack = GT_OreDictUnificator.get_nocopy(true, tStack); + if (unified_tStack != null) { amt = tStack.stackSize; boolean temp = true; for (ItemStack aStack : aInputs) { - if ((GT_Utility.areUnificationsEqual(aStack, tStack, true) || GT_Utility.areUnificationsEqual(GT_OreDictUnificator.get(false, aStack), tStack, true))) { + if (GT_OreDictUnificator.isInputStackEqual(aStack, unified_tStack)) { if (GTppRecipeHelper) {//remove once the fix is out if (GT_Utility.areStacksEqual(aStack, Ic2Items.FluidCell.copy(), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataStick.get(1L), true) || GT_Utility.areStacksEqual(aStack, ItemList.Tool_DataOrb.get(1L), true)) { if (!GT_Utility.areStacksEqual(aStack, tStack, false)) diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index b06cc1d82a..05e0874e7a 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -546,13 +546,14 @@ public class GT_Utility { for (int tGrabSlot = 0;tGrabSlot<tGrabInventorySize;tGrabSlot++) { //ItemStack tInventoryStack : mInventory - int tMovedItems = 0; + int tMovedItems; do { + tMovedItems = 0; ItemStack tGrabStack = aTileEntity1.getStackInSlot(tGrabSlot); if (listContainsItem(aFilter, tGrabStack, true, aInvertFilter) && (tGrabStack.stackSize >= aMinMoveAtOnce && isAllowedToTakeFromSlot(aTileEntity1, tGrabSlot, aGrabFrom, tGrabStack))) { int tStackSize = tGrabStack.stackSize; - tMovedItems = 0; + for (int tPutSlot = tFirstsValidSlot; tPutSlot < tPutInventorySize; tPutSlot++) { if (isAllowedToPutIntoSlot(tPutInventory, tPutSlot, aPutTo, tGrabStack, (byte) 64)) { int tMoved = moveStackFromSlotAToSlotB(aTileEntity1, tPutInventory, tGrabSlot, tPutSlot, aMaxTargetStackSize, aMinTargetStackSize, (byte) (aMaxMoveAtOnce - tMovedItems), aMinMoveAtOnce); diff --git a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java index 92eb3af4d2..710dc0bf8f 100644 --- a/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java +++ b/src/main/java/gregtech/common/items/GT_IntegratedCircuit_Item.java @@ -7,6 +7,7 @@ import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.items.GT_Generic_Item; +import gregtech.api.util.GT_Config; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_ModHandler; @@ -15,13 +16,16 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; import java.util.List; import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.enums.GT_Values.RES_PATH_ITEM; public class GT_IntegratedCircuit_Item extends GT_Generic_Item { private final static String aTextEmptyRow = " "; + protected IIcon[] mIconDamage = new IIcon[25]; public GT_IntegratedCircuit_Item() { super("integrated_circuit", "Programmed Circuit", ""); setHasSubtypes(true); @@ -93,9 +97,13 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { aList.add(new ItemStack(this, 1, 0)); } + @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister aIconRegister) { super.registerIcons(aIconRegister); + for (int i=0; i < mIconDamage.length; i++) { + mIconDamage[i] = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i)); + } if (GregTech_API.sPostloadFinished) { GT_Log.out.println("GT_Mod: Starting Item Icon Load Phase"); GT_FML_LOGGER.info("GT_Mod: Starting Item Icon Load Phase"); @@ -109,4 +117,10 @@ public class GT_IntegratedCircuit_Item extends GT_Generic_Item { GT_FML_LOGGER.info("GT_Mod: Finished Item Icon Load Phase"); } } + + @Override + public IIcon getIconFromDamage(int damage) { + byte circuitMode = ((byte) (damage & 0xFF)); // Mask out the MSB Comparison Mode Bits. See: getModeString + return mIconDamage[circuitMode < mIconDamage.length ? circuitMode : 0]; + } } diff --git a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java index 57654ec43b..ad2457b721 100644 --- a/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java +++ b/src/main/java/gregtech/common/items/GT_MetaGenerated_Item_01.java @@ -663,16 +663,16 @@ public class GT_MetaGenerated_Item_01 extends GT_MetaGenerated_Item_X32 { ItemList.QuantumStar.set(addItem(tLastID = 725, "Quantum Star", "Improved Nether Star", new Object[0])); ItemList.Gravistar.set(addItem(tLastID = 726, "Gravi Star", "Ultimate Nether Star", new Object[0])); - ItemList.Field_Generator_LV.set(addItem(670, "Field Generator (Tier I)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)})); - ItemList.Field_Generator_MV.set(addItem(671, "Field Generator (Tier II)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)})); - ItemList.Field_Generator_HV.set(addItem(672, "Field Generator (Tier III)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)})); - ItemList.Field_Generator_EV.set(addItem(673, "Field Generator (Tier IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L)})); - ItemList.Field_Generator_IV.set(addItem(674, "Field Generator (Tier V)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L)})); - ItemList.Field_Generator_LuV.set(addItem(675, "Field Generator (Tier VI)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L)})); - ItemList.Field_Generator_ZPM.set(addItem(676, "Field Generator (Tier VII)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L)})); - ItemList.Field_Generator_UV.set(addItem(677, "Field Generator (Tier VIII)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L)})); - ItemList.Field_Generator_UHV.set(addItem(678, "Field Generator (Tier IX)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L)})); - ItemList.Field_Generator_UEV.set(addItem(679, "Field Generator (Tier X)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L)})); + ItemList.Field_Generator_LV.set(addItem(670, "Field Generator (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 1L)})); + ItemList.Field_Generator_MV.set(addItem(671, "Field Generator (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 2L)})); + ItemList.Field_Generator_HV.set(addItem(672, "Field Generator (HV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 4L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 4L)})); + ItemList.Field_Generator_EV.set(addItem(673, "Field Generator (EV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 8L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 8L)})); + ItemList.Field_Generator_IV.set(addItem(674, "Field Generator (IV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 16L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 16L)})); + ItemList.Field_Generator_LuV.set(addItem(675, "Field Generator (LuV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 32L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 32L)})); + ItemList.Field_Generator_ZPM.set(addItem(676, "Field Generator (ZPM)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 64L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 64L)})); + ItemList.Field_Generator_UV.set(addItem(677, "Field Generator (UV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 128L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 128L)})); + ItemList.Field_Generator_UHV.set(addItem(678, "Field Generator (UHV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 256L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 256L)})); + ItemList.Field_Generator_UEV.set(addItem(679, "Field Generator (UEV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1024L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 512L), new TC_Aspects.TC_AspectStack(TC_Aspects.TUTAMEN, 512L)})); ItemList.Emitter_LV.set(addItem(680, "Emitter (LV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 1L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 1L)})); ItemList.Emitter_MV.set(addItem(681, "Emitter (MV)", "", new Object[]{new TC_Aspects.TC_AspectStack(TC_Aspects.ELECTRUM, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.MACHINA, 2L), new TC_Aspects.TC_AspectStack(TC_Aspects.LUX, 2L)})); 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 938c2d6900..f883968e35 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 @@ -14,6 +14,10 @@ import net.minecraft.item.ItemStack; public class GT_MetaTileEntity_Boxinator extends GT_MetaTileEntity_BasicMachine { + ItemStack aInputCache; + ItemStack aOutputCache; + int aTypeCache = 0; + public GT_MetaTileEntity_Boxinator(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 1, "Puts things into Boxes", 2, 1, "Packager.png", "", new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_SIDE_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_FRONT_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_BOXINATOR), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR_ACTIVE), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_BOTTOM_BOXINATOR)}); } @@ -34,28 +38,54 @@ public class GT_MetaTileEntity_Boxinator return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; } + private boolean hasValidCache(ItemStack mItem,int mType) { + if (aInputCache != null + && aOutputCache != null + && aTypeCache == mType + && aInputCache.isItemEqual(mItem) + && ItemStack.areItemStackTagsEqual(mItem,aInputCache)) + return true; + // clear cache if it was invalid + aInputCache = null; + aOutputCache = null; + aTypeCache = 0; + return false; + } + + private void cacheItem(ItemStack mInputItem,ItemStack mOutputItem,int mType) { + aTypeCache = mType; + aOutputCache = mOutputItem.copy(); + aInputCache = mInputItem.copy(); + } + public int checkRecipe() { int tCheck = super.checkRecipe(); if (tCheck != DID_NOT_FIND_RECIPE) { return tCheck; } - if ((GT_Utility.isStackValid(getInputAt(0))) && (GT_Utility.isStackValid(getInputAt(1))) && (GT_Utility.getContainerItem(getInputAt(0), true) == null)) { - if ((ItemList.Schematic_1by1.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 1)) { - this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[]{getInputAt(0)}); + ItemStack tSlot0 = getInputAt(0); + 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); + this.mOutputItems[0] = tIsCached ? aOutputCache.copy() : GT_ModHandler.getRecipeOutput(new ItemStack[]{tSlot0}); if (this.mOutputItems[0] != null) { if (canOutput(new ItemStack[]{this.mOutputItems[0]})) { - getInputAt(0).stackSize -= 1; + tSlot0.stackSize -= 1; calculateOverclockedNess(32,16); //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (!tIsCached) + cacheItem(tSlot0,this.mOutputItems[0],1); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } return DID_NOT_FIND_RECIPE; } - if ((ItemList.Schematic_2by2.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 4)) { - this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[]{getInputAt(0), getInputAt(0), null, getInputAt(0), getInputAt(0)}); + if ((ItemList.Schematic_2by2.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 4)) { + boolean tIsCached = hasValidCache(tSlot0,2); + 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]})) { getInputAt(0).stackSize -= 4; @@ -63,13 +93,16 @@ public class GT_MetaTileEntity_Boxinator //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (!tIsCached) + cacheItem(tSlot0,this.mOutputItems[0],2); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } return DID_NOT_FIND_RECIPE; } - if ((ItemList.Schematic_3by3.isStackEqual(getInputAt(1))) && (getInputAt(0).stackSize >= 9)) { - this.mOutputItems[0] = GT_ModHandler.getRecipeOutput(new ItemStack[]{getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0), getInputAt(0)}); + if ((ItemList.Schematic_3by3.isStackEqual(tSlot1)) && (getInputAt(0).stackSize >= 9)) { + boolean tIsCached = hasValidCache(tSlot0,3); + 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]})) { getInputAt(0).stackSize -= 9; @@ -77,6 +110,8 @@ public class GT_MetaTileEntity_Boxinator //In case recipe is too OP for that machine if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; + if (!tIsCached) + cacheItem(tSlot0,this.mOutputItems[0],3); return FOUND_AND_SUCCESSFULLY_USED_RECIPE; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java index 1d9b360338..c2e13a815f 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_PyrolyseOven.java @@ -165,8 +165,8 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock for (int j = -2; j < 3; j++) { for (int h = 0; h < 4; h++) { IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, zDir + j); - if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// innerer 3x3 ohne h�he - if (h == 0) {// innen boden (Cupronickel oder Kanthal coils) + if ((i != -2 && i != 2) && (j != -2 && j != 2)) {// inner 3x3 without height + if (h == 0) {// inner floor (Cupronickel or Kanthal coils) if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != GregTech_API.sBlockCasings5) { return false; } @@ -181,7 +181,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock return false; } } - } else if (h == 3) {// innen decke (ulv casings + input + muffler) + } else if (h == 3) {// inner ceiling (ulv casings + input + muffler) if ((!addInputToMachineList(tTileEntity, CASING_INDEX)) && (!addMufflerToMachineList(tTileEntity, CASING_INDEX))) { if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { return false; @@ -190,13 +190,13 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock return false; } } - } else {// innen air + } else {// inside air if (!aBaseMetaTileEntity.getAirOffset(xDir + i, h, zDir + j)) { return false; } } - } else {// Aeusserer 5x5 ohne hoehe - if (h == 0) {// aussen boden (controller, output, energy, maintainance, rest ulv casings) + } else {// outer 5x5 without height + if (h == 0) {// outer floor (controller, output, energy, maintainance, rest ulv casings) if ((!addMaintenanceToMachineList(tTileEntity, CASING_INDEX)) && (!addOutputToMachineList(tTileEntity, CASING_INDEX)) && (!addEnergyInputToMachineList(tTileEntity, CASING_INDEX))) { if ((xDir + i != 0) || (zDir + j != 0)) {//no controller if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { @@ -207,7 +207,7 @@ public class GT_MetaTileEntity_PyrolyseOven extends GT_MetaTileEntity_MultiBlock } } } - } else {// au�en �ber boden (ulv casings) + } else {// outer above floor (ulv casings) if (aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j) != CasingBlock) { return false; } diff --git a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java index 6d97d9011d..606733658b 100644 --- a/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java +++ b/src/main/java/gregtech/common/tileentities/storage/GT_MetaTileEntity_DigitalChestBase.java @@ -91,10 +91,15 @@ public abstract class GT_MetaTileEntity_DigitalChestBase extends GT_MetaTileEnti ItemStack stack = getItemStack(); if ((mInventory[0] != null) && ((count < getMaxItemCount())|| mVoidOverflow ) && GT_Utility.areStacksEqual(mInventory[0], stack)) { count += mInventory[0].stackSize; - if (count <= getMaxItemCount() || mVoidOverflow ) { + + if (count <= getMaxItemCount()) { mInventory[0] = null; } else { - mInventory[0].stackSize = (count - getMaxItemCount()); + if (mVoidOverflow) { + mInventory[0] = null; + } else { + mInventory[0].stackSize = (count - getMaxItemCount()); + } count = getMaxItemCount(); } } diff --git a/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java b/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java index 1d31a6d8df..0f8a3322c8 100644 --- a/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java +++ b/src/main/java/gregtech/loaders/postload/GT_Worldgenloader.java @@ -123,7 +123,7 @@ public class GT_Worldgenloader implements Runnable { new GT_Worldgen_GT_Ore_SmallPieces("ore.small.bedrockium",true,5,25,6,false, false, false, Materials.Bedrockium); new GT_Worldgen_GT_Ore_SmallPieces("ore.small.realgar",true,15,85,32,false, true, false, Materials.Realgar); new GT_Worldgen_GT_Ore_SmallPieces("ore.small.certusquartz",true,5,115,16,false, true, false, Materials.CertusQuartz); - new GT_Worldgen_GT_Ore_SmallPieces("ore.small.jade",true,5,250,8,false, false, false, Materials.Jade); + new GT_Worldgen_GT_Ore_SmallPieces("ore.small.jade",true,5,35,2,false, false, false, Materials.Jade); new GT_Worldgen_GT_Ore_SmallPieces("ore.small.deepiron",true,5,40,8,false, false, false, Materials.DeepIron); //GT Default Veins diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/0.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/0.png Binary files differnew file mode 100644 index 0000000000..e35727ec34 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/0.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/1.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/1.png Binary files differnew file mode 100644 index 0000000000..d2b07c8a6c --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/1.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/10.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/10.png Binary files differnew file mode 100644 index 0000000000..d3648dbd35 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/10.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/11.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/11.png Binary files differnew file mode 100644 index 0000000000..ccf9f81399 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/11.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/12.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/12.png Binary files differnew file mode 100644 index 0000000000..3150356e16 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/12.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/13.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/13.png Binary files differnew file mode 100644 index 0000000000..0f5d3c1ca5 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/13.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/14.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/14.png Binary files differnew file mode 100644 index 0000000000..8109357533 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/14.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/15.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/15.png Binary files differnew file mode 100644 index 0000000000..1bc89f80b2 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/15.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/16.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/16.png Binary files differnew file mode 100644 index 0000000000..4cf2f0d825 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/16.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/17.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/17.png Binary files differnew file mode 100644 index 0000000000..3ac05fd824 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/17.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/18.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/18.png Binary files differnew file mode 100644 index 0000000000..b668f379cf --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/18.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/19.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/19.png Binary files differnew file mode 100644 index 0000000000..d13a9415cd --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/19.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/2.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/2.png Binary files differnew file mode 100644 index 0000000000..b31f73a4f7 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/2.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/20.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/20.png Binary files differnew file mode 100644 index 0000000000..5858bc43b8 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/20.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/21.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/21.png Binary files differnew file mode 100644 index 0000000000..e7d903a404 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/21.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/22.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/22.png Binary files differnew file mode 100644 index 0000000000..45d56bb2e7 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/22.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/23.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/23.png Binary files differnew file mode 100644 index 0000000000..5d2a8f638a --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/23.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/24.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/24.png Binary files differnew file mode 100644 index 0000000000..78f30e2299 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/24.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/3.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/3.png Binary files differnew file mode 100644 index 0000000000..996887e4ef --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/3.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/4.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/4.png Binary files differnew file mode 100644 index 0000000000..0ef50ef775 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/4.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/5.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/5.png Binary files differnew file mode 100644 index 0000000000..2b67a655f5 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/5.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/6.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/6.png Binary files differnew file mode 100644 index 0000000000..a30a06a13c --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/6.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/7.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/7.png Binary files differnew file mode 100644 index 0000000000..e5dfc35674 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/7.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/8.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/8.png Binary files differnew file mode 100644 index 0000000000..0ed9386325 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/8.png diff --git a/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/9.png b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/9.png Binary files differnew file mode 100644 index 0000000000..97398ff800 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/items/gt.integrated_circuit/9.png |