diff options
| author | Maxim <maxim235@gmx.de> | 2023-07-22 16:12:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-22 16:12:12 +0200 |
| commit | 2b424e8295b7071b85a2960a87da91bf0dd3df02 (patch) | |
| tree | 8ac7f89be7193dd0fe8e9b7b2919924fae34e860 /src/main/java/gtPlusPlus/xmod/gregtech/common | |
| parent | dd025431efe8122bc316bc2f1b99a939c0ca149a (diff) | |
| download | GT5-Unofficial-2b424e8295b7071b85a2960a87da91bf0dd3df02.tar.gz GT5-Unofficial-2b424e8295b7071b85a2960a87da91bf0dd3df02.tar.bz2 GT5-Unofficial-2b424e8295b7071b85a2960a87da91bf0dd3df02.zip | |
Implement generic processing logic (#697)
* Migrated extruder
* Migrated alloy smelter
* Migrated arc furnace
* Migrated centrifuge
* Migrated ICO
* Migrated cutter
* Migrated dehydrator
* Migrated electrolyzer
* Migrated fluid heater
* Migrated forge hammer
* Forgot gtpp machines are cursed
* Migrated mac
* Migrated mixer
* Migrated molecular transformer
* Migrated bender
* Migrated sifter
* Migrated thermal centrifuge
* Migrated VF
* Migrated washer
* Migrated wiremill
* Migrated Volcanus
* Migrated adv implo compressor
* Migrated XL turbines
* Migrated chemplant
* Migrated MABS
* Migrated ABS
* Migrated cyclotron
* Migrated Zhuhai
* Migrated rock breaker
* Migrated rocketdyne
* Migrated semifluid generator
* Migrated QFT
* Minor optimization
* Migrate refinery
* Migrated solar tower
* Migrated TGS
* Migrated duplicator
* Migrated PSS
* Migrated algae pond
* Migrated froth flotation cell
* Migrated LTFR
* Migrated LPF
* Migrated sparge tower
* Migrated salt
* Migrated isamill
* Migrate DT
* Migrated HE
* Migrated mass fab
* Migrated chisel
* Migrated boiler
* Migrated steam machines
* Migrated amazon
* Disable batch mode button on XL turbines
* Update dependencies.gradle
* Updated dep
* Addressed first batch of reviews
* Migrated assembler
* Removed unused checkRecipe methods
* Forgot these
* Fix and cleanup chemplant
* Removed getAmounfOfOutputs
* Removed special multi behavior
* Migrated sound mostly
* Addressed new reviews
* Fix build fail and chisel sound
* Derp
* More reviews addressed
* Oversight on chemplant batchmode
* Fix DT speed bonus
* Removed iron blast furnace
* Removed generator array
* Removed
* Simplify rocket engine logic
* Removed left over artifacts
* Minor fixes
* Removed nerf chips
* Removed tesla tower
* Revert and fix chemplant recipe map
* Fix chemplant catalyst damaging
* Addressed reviews
* Derp
---------
Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common')
58 files changed, 1049 insertions, 4420 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java index 8100532ed9..047e589db1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks2.java @@ -80,7 +80,6 @@ public class GregtechMetaCasingBlocks2 extends GregtechMetaCasingBlocksAbstract GregtechItemList.Casing_ThermalContainment.set(new ItemStack(this, 1, 11)); GregtechItemList.Casing_Autocrafter.set(new ItemStack(this, 1, 12)); GregtechItemList.Casing_CuttingFactoryFrame.set(new ItemStack(this, 1, 13)); - // GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 14)); GregtechItemList.Casing_PLACEHOLDER_TreeFarmer.set(new ItemStack(this, 1, 15)); // Tree Farmer Textures } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java index 805b9acbd9..61e74fc56a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java @@ -71,7 +71,6 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs GregtechItemList.Casing_Turbine_HP.set(new ItemStack(this, 1, 2)); GregtechItemList.Casing_Turbine_Gas.set(new ItemStack(this, 1, 3)); GregtechItemList.Casing_Turbine_Plasma.set(new ItemStack(this, 1, 4)); - GregtechItemList.Casing_TeslaTower.set(new ItemStack(this, 1, 5)); GregtechItemList.Casing_SolarTower_Structural.set(new ItemStack(this, 1, 6)); GregtechItemList.Casing_SolarTower_SaltContainment.set(new ItemStack(this, 1, 7)); GregtechItemList.Casing_SolarTower_HeatContainment.set(new ItemStack(this, 1, 8)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java index b53daf4f31..f7f935fdf1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/items/MetaGeneratedGregtechItems.java @@ -416,12 +416,6 @@ public class MetaGeneratedGregtechItems extends Gregtech_MetaItem_X32 { .set(this.addItem(151, "Distillus Upgrade Chip", "Used to upgrade Distillus to Tier 2")); GregtechItemList.Maceration_Upgrade_Chip .set(this.addItem(152, "Maceration Upgrade Chip", "Used to upgrade Maceration Stack to Tier 2")); - - GregtechItemList.Chip_MultiNerf_NoOutputBonus - .set(this.addItem(160, "No-Bonus Chip", "You won't like using this")); - GregtechItemList.Chip_MultiNerf_NoSpeedBonus - .set(this.addItem(161, "No-Bonus Chip", "You won't like using this")); - GregtechItemList.Chip_MultiNerf_NoEuBonus.set(this.addItem(162, "No-Bonus Chip", "You won't like using this")); } private boolean registerComponents_ULV() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java index c8e947fbb5..d8c46e11ce 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java @@ -10,29 +10,21 @@ import static gregtech.api.enums.GT_HatchElement.Muffler; import static gregtech.api.enums.GT_HatchElement.OutputBus; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import java.util.ArrayList; - import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; import com.gtnewhorizon.structurelib.alignment.constructable.ISurvivalConstructable; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; import gregtech.api.enums.TAE; import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; -import gregtech.api.util.GT_ModHandler; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.minecraft.ItemStackData; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -41,8 +33,6 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_AmazonPackager> implements ISurvivalConstructable { - private long mVoltage; - private byte mTier; private int mCasing; private static IStructureDefinition<GMTE_AmazonPackager> STRUCTURE_DEFINITION = null; @@ -102,11 +92,6 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon return tt; } - private final void initFields() { - mVoltage = getMaxInputVoltage(); - mTier = (byte) Math.max(1, GT_Utility.getTier(mVoltage)); - } - @Override protected IIconContainer getActiveOverlay() { return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active; @@ -127,134 +112,10 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_Amazon return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes; } - private static final FluidStack[] sNoFluids = new FluidStack[] {}; - @Override - public boolean checkRecipe(ItemStack aStack) { - - // Just the best place to check this~ - initFields(); - - ArrayList<ItemStack> tItems = getStoredInputs(); - if (this.getGUIItemStack() != null) { - tItems.add(this.getGUIItemStack()); - } - ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); - boolean state = checkRecipeGeneric(tItemInputs, sNoFluids, getMaxParallelRecipes(), 75, 500, 10000); - - if (state) { - return true; - } else { - tItems = getStoredInputs(); - AutoMap<ItemStackData> mCompleted = new AutoMap<ItemStackData>(); - AutoMap<ItemStackData> mSchematics = new AutoMap<ItemStackData>(); - for (ItemStack tInputItem : tItems) { - if (tInputItem != null) { - if (ItemList.Schematic_1by1.isStackEqual((Object) tInputItem) - || ItemList.Schematic_2by2.isStackEqual((Object) tInputItem) - || ItemList.Schematic_3by3.isStackEqual((Object) tInputItem)) { - mSchematics.put(new ItemStackData(tInputItem)); - } - } - } - if (mSchematics.size() > 0) { - for (ItemStackData g : mSchematics) { - for (ItemStack tInputItem : tItems) { - if (tInputItem != null) { - mCompleted.put(new ItemStackData(tInputItem)); - checkRecipe(tInputItem, g.getStack()); - } - } - } - } - - return mCompleted != null && mCompleted.size() > 0; - } - } - - public boolean checkRecipe(ItemStack inputStack, ItemStack schematicStack) { - if (GT_Utility.isStackValid((Object) inputStack) && GT_Utility.isStackValid((Object) schematicStack) - && GT_Utility.getContainerItem(inputStack, true) == null) { - ItemStack tOutputStack; - if (ItemList.Schematic_1by1.isStackEqual((Object) schematicStack) && inputStack.stackSize >= 1) { - tOutputStack = GT_ModHandler.getRecipeOutput(new ItemStack[] { inputStack }); - if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) { - final ItemStack input = inputStack; - --input.stackSize; - this.lEUt = 32 * (1L << this.mTier - 1) * (1L << this.mTier - 1); - // this.mMaxProgresstime = 16 / (1 << this.mTier - 1); - this.mMaxProgresstime = 2; - this.addOutput(tOutputStack); - updateSlots(); - return true; - } - return false; - } else if (ItemList.Schematic_2by2.isStackEqual((Object) schematicStack) && inputStack.stackSize >= 4) { - tOutputStack = GT_ModHandler - .getRecipeOutput(new ItemStack[] { inputStack, inputStack, null, inputStack, inputStack }); - if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) { - final ItemStack input2 = inputStack; - input2.stackSize -= 4; - this.lEUt = 32 * (1L << this.mTier - 1) * (1L << this.mTier - 1); - // this.mMaxProgresstime = 32 / (1 << this.mTier - 1); - this.mMaxProgresstime = 4; - this.addOutput(tOutputStack); - updateSlots(); - return true; - } - return false; - } else if (ItemList.Schematic_3by3.isStackEqual((Object) schematicStack) && inputStack.stackSize >= 9) { - tOutputStack = GT_ModHandler.getRecipeOutput( - new ItemStack[] { inputStack, inputStack, inputStack, inputStack, inputStack, inputStack, - inputStack, inputStack, inputStack }); - if (tOutputStack != null && this.allowPutStack(tOutputStack, schematicStack)) { - final ItemStack input3 = inputStack; - input3.stackSize -= 9; - this.lEUt = 32 * (1L << this.mTier - 1) * (1L << this.mTier - 1); - // this.mMaxProgresstime = 64 / (1 << this.mTier - 1); - this.mMaxProgresstime = 6; - this.addOutput(tOutputStack); - updateSlots(); - return true; - } - return false; - } - } - return false; - } - - public boolean allowPutStack(final ItemStack aStack, ItemStack schematicStack) { - // If Schematic Static is not 1x1, 2x2, 3x3 - if (!ItemList.Schematic_1by1.isStackEqual((Object) schematicStack) - && !ItemList.Schematic_2by2.isStackEqual((Object) schematicStack) - && !ItemList.Schematic_3by3.isStackEqual((Object) schematicStack)) { - return GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.containsInput(aStack); - } - // Something - if (GT_Recipe.GT_Recipe_Map.sBoxinatorRecipes.findRecipe( - (IHasWorldObjectAndCoords) this.getBaseMetaTileEntity(), - true, - GT_Values.V[this.mTier], - (FluidStack[]) null, - new ItemStack[] { GT_Utility.copyAmount(64L, new Object[] { aStack }), schematicStack }) != null) { - return true; - } - // 1x1 - if (ItemList.Schematic_1by1.isStackEqual((Object) schematicStack) - && GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack }) != null) { - return true; - } - // 2x2 - if (ItemList.Schematic_2by2.isStackEqual((Object) schematicStack) - && GT_ModHandler.getRecipeOutput(new ItemStack[] { aStack, aStack, null, aStack, aStack }) != null) { - return true; - } - // 3x3 - if (ItemList.Schematic_3by3.isStackEqual((Object) schematicStack) && GT_ModHandler.getRecipeOutput( |
