From 2b424e8295b7071b85a2960a87da91bf0dd3df02 Mon Sep 17 00:00:00 2001 From: Maxim Date: Sat, 22 Jul 2023 16:12:12 +0200 Subject: 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 --- .../java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java | 9 - .../xmod/gregtech/api/enums/GregtechItemList.java | 13 - .../base/GregtechMeta_MultiBlockBase.java | 514 +-------------------- .../base/GregtechMeta_SteamMultiBase.java | 151 +----- .../common/blocks/GregtechMetaCasingBlocks2.java | 1 - .../blocks/GregtechMetaSpecialMultiCasings.java | 1 - .../common/items/MetaGeneratedGregtechItems.java | 6 - .../machines/multi/misc/GMTE_AmazonPackager.java | 157 +------ .../multi/misc/GregtechMTE_TeslaTower.java | 503 -------------------- ...gtechMetaTileEntity_IndustrialAlloySmelter.java | 111 +---- ...regtechMetaTileEntity_IndustrialArcFurnace.java | 45 +- ...regtechMetaTileEntity_IndustrialCentrifuge.java | 16 +- .../GregtechMetaTileEntity_IndustrialChisel.java | 102 ++-- .../GregtechMetaTileEntity_IndustrialCokeOven.java | 23 +- ...echMetaTileEntity_IndustrialCuttingMachine.java | 16 +- ...regtechMetaTileEntity_IndustrialDehydrator.java | 93 +--- ...gtechMetaTileEntity_IndustrialElectrolyzer.java | 15 +- .../GregtechMetaTileEntity_IndustrialExtruder.java | 51 +- ...egtechMetaTileEntity_IndustrialFluidHeater.java | 16 +- ...egtechMetaTileEntity_IndustrialForgeHammer.java | 34 +- ...GregtechMetaTileEntity_IndustrialMacerator.java | 26 +- .../GregtechMetaTileEntity_IndustrialMixer.java | 62 +-- ...aTileEntity_IndustrialMolecularTransformer.java | 10 +- ...gtechMetaTileEntity_IndustrialMultiMachine.java | 167 +------ ...regtechMetaTileEntity_IndustrialPlatePress.java | 47 +- .../GregtechMetaTileEntity_IndustrialSifter.java | 21 +- ...MetaTileEntity_IndustrialThermalCentrifuge.java | 16 +- ...techMetaTileEntity_IndustrialVacuumFreezer.java | 10 +- ...GregtechMetaTileEntity_IndustrialWashPlant.java | 33 +- .../GregtechMetaTileEntity_IndustrialWireMill.java | 51 +- .../GregtechMetaTileEntity_IronBlastFurnace.java | 510 -------------------- .../processing/GregtechMetaTileEntity_IsaMill.java | 86 ++-- ...hMetaTileEntity_NuclearSaltProcessingPlant.java | 48 +- .../GregtechMetaTileEntity_SpargeTower.java | 48 +- ...egtechMetaTileEntity_Adv_DistillationTower.java | 41 +- .../advanced/GregtechMetaTileEntity_Adv_EBF.java | 113 +---- .../GregtechMetaTileEntity_Adv_HeatExchanger.java | 17 +- .../GregtechMetaTileEntity_Adv_Implosion.java | 22 +- .../multi/production/GT4Entity_AutoCrafter.java | 50 +- .../multi/production/GT4Entity_ThermalBoiler.java | 31 +- .../GregtechMTE_ElementalDuplicator.java | 136 ++---- .../production/GregtechMTE_FrothFlotationCell.java | 122 ++--- .../production/GregtechMTE_NuclearReactor.java | 123 ++--- .../GregtechMetaTileEntityGeneratorArray.java | 452 ------------------ .../production/GregtechMetaTileEntityTreeFarm.java | 26 +- .../GregtechMetaTileEntity_AlloyBlastSmelter.java | 128 +---- .../GregtechMetaTileEntity_Cyclotron.java | 116 ++--- ...egtechMetaTileEntity_IndustrialFishingPond.java | 181 +++----- ...egtechMetaTileEntity_IndustrialRockBreaker.java | 89 ++-- .../GregtechMetaTileEntity_LargeRocketEngine.java | 70 +-- ...techMetaTileEntity_LargeSemifluidGenerator.java | 21 +- .../GregtechMetaTileEntity_MassFabricator.java | 297 ++---------- ...techMetaTileEntity_QuantumForceTransformer.java | 446 ++++++++---------- .../GregtechMetaTileEntity_Refinery.java | 22 +- .../GregtechMetaTileEntity_SolarTower.java | 46 +- .../algae/GregtechMTE_AlgaePondBase.java | 97 ++-- .../chemplant/GregtechMTE_ChemicalPlant.java | 298 ++++-------- ...egTechMetaTileEntity_MegaAlloyBlastSmelter.java | 89 ++-- .../turbines/GT_MTE_LargeTurbine_Gas.java | 18 +- .../turbines/GT_MTE_LargeTurbine_Plasma.java | 27 +- .../GregtechMetaTileEntity_LargerTurbineBase.java | 53 +-- ...chMetaTileEntity_PowerSubStationController.java | 13 +- .../gregtech/GregtechIndustrialGeneratorArray.java | 24 - .../gregtech/GregtechIronBlastFurnace.java | 24 - .../registration/gregtech/GregtechTeslaTower.java | 14 - 65 files changed, 1060 insertions(+), 5158 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IronBlastFurnace.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialGeneratorArray.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIronBlastFurnace.java delete mode 100644 src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java (limited to 'src/main/java/gtPlusPlus/xmod') diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index efddb59ffb..370b286957 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -22,11 +22,7 @@ import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gregtech.common.items.behaviors.Behaviour_DataOrb; -import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.minecraft.multi.NoEUBonusMultiBehaviour; -import gtPlusPlus.api.objects.minecraft.multi.NoOutputBonusMultiBehaviour; -import gtPlusPlus.api.objects.minecraft.multi.NoSpeedBonusMultiBehaviour; import gtPlusPlus.core.handler.COMPAT_HANDLER; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; @@ -98,11 +94,6 @@ public class HANDLER_GT { // Register custom singles to the PA AddCustomMachineToPA.register(); - // Register the No-Bonus Special Behaviour. - Multiblock_API.registerSpecialMultiBehaviour(new NoOutputBonusMultiBehaviour()); - Multiblock_API.registerSpecialMultiBehaviour(new NoSpeedBonusMultiBehaviour()); - Multiblock_API.registerSpecialMultiBehaviour(new NoEUBonusMultiBehaviour()); - // Register some custom recipe maps for any enabled multiblocks. // MultiblockRecipeMapHandler.run(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index d1c8504e88..f7fc2712ce 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -209,11 +209,6 @@ public enum GregtechItemList implements GregtechItemContainer { Distillus_Upgrade_Chip, Maceration_Upgrade_Chip, - // Chips used to nerf my multis via custom behavioural attachments - Chip_MultiNerf_NoOutputBonus, - Chip_MultiNerf_NoSpeedBonus, - Chip_MultiNerf_NoEuBonus, - // Milling Balls Milling_Ball_Alumina, Milling_Ball_Soapstone, @@ -237,7 +232,6 @@ public enum GregtechItemList implements GregtechItemContainer { GTPP_Casing_MAX, // IronBlastFurnace Machine_Bronze_BlastFurnace - Machine_Iron_BlastFurnace, Casing_IronPlatedBricks, // Large Centrifuge @@ -363,17 +357,10 @@ public enum GregtechItemList implements GregtechItemContainer { Industrial_WashPlant, Casing_WashPlant, - // Generator Array - Generator_Array_Controller, - // Cutting Factory Controller Industrial_CuttingFactoryController, Casing_CuttingFactoryFrame, - // Tesla Tower - TelsaTower, - Casing_TeslaTower, - // Large Extruder Industrial_Extruder, Casing_Extruder, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 9a2d6e7d81..f9af7d29a1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -7,7 +7,6 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map.Entry; @@ -27,7 +26,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @@ -59,6 +57,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_ExtendedPowerMultiBlockBase; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; @@ -73,8 +72,6 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Outpu import gregtech.api.objects.GT_ItemStack; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_OverclockCalculator; -import gregtech.api.util.GT_ParallelHelper; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; @@ -82,13 +79,8 @@ import gregtech.api.util.IGT_HatchAdder; import gregtech.common.items.GT_MetaGenerated_Tool_01; import gtPlusPlus.GTplusplus; import gtPlusPlus.GTplusplus.INIT_PHASE; -import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour; -import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -112,7 +104,6 @@ public abstract class GregtechMeta_MultiBlockBase mControlCoreBus = new ArrayList<>(); @@ -126,9 +117,6 @@ public abstract class GregtechMeta_MultiBlockBase mAllEnergyHatches = new ArrayList<>(); public ArrayList mAllDynamoHatches = new ArrayList<>(); - // Custom Behaviour Map - private static final HashMap mCustomBehviours = new HashMap<>(); - public GregtechMeta_MultiBlockBase(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); } @@ -153,9 +141,6 @@ public abstract class GregtechMeta_MultiBlockBase tItems = getStoredInputs(); - ArrayList tFluids = getStoredFluids(); - ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); - FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); - return checkRecipeGeneric( - tItemInputs, - tFluidInputs, - aMaxParallelRecipes, - aEUPercent, - aSpeedBonusPercent, - aOutputChanceRoll); - } - - public boolean checkRecipeGeneric(GT_Recipe aRecipe, int aMaxParallelRecipes, long aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll) { - if (aRecipe == null) { - return false; - } - ArrayList tItems = getStoredInputs(); - ArrayList tFluids = getStoredFluids(); - ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); - FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); - return checkRecipeGeneric( - tItemInputs, - tFluidInputs, - aMaxParallelRecipes, - aEUPercent, - aSpeedBonusPercent, - aOutputChanceRoll, - aRecipe); - } - - public boolean checkRecipeGeneric(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, - long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { - return checkRecipeGeneric( - aItemInputs, - aFluidInputs, - aMaxParallelRecipes, - aEUPercent, - aSpeedBonusPercent, - aOutputChanceRoll, - null); + @Override + protected void setProcessingLogicPower(ProcessingLogic logic) { + logic.setAvailableVoltage(GT_Utility.roundDownVoltage(this.getMaxInputVoltage())); + logic.setAvailableAmperage(1L); } public long getMaxInputEnergy() { @@ -526,319 +434,6 @@ public abstract class GregtechMeta_MultiBlockBase aNewChances = new AutoMap<>(); - for (int chance : aRecipe.mChances) { - aNewChances.put(boostOutput(chance)); - } - GT_Recipe aClone = aRecipe.copy(); - int[] aTemp = new int[aNewChances.size()]; - int slot = 0; - for (int g : aNewChances) { - aTemp[slot] = g; - slot++; - } - aClone.mChances = aTemp; - return aClone; - } - - /** - * Processes recipes but provides a bonus to the output % of items if they are < 100%. - * - * @param aItemInputs - * @param aFluidInputs - * @param aMaxParallelRecipes - * @param aEUPercent - * @param aSpeedBonusPercent - * @param aOutputChanceRoll - * @param aRecipe - * @return - */ - public boolean checkRecipeBoostedOutputs(ItemStack[] aItemInputs, FluidStack[] aFluidInputs, - int aMaxParallelRecipes, long aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll, - GT_Recipe aRecipe) { - - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - long tEnergy = getMaxInputEnergy(); - log("Running checkRecipeGeneric(0)"); - - GT_Recipe tRecipe = aRecipe != null ? aRecipe - : findRecipe( - getBaseMetaTileEntity(), - mLastRecipe, - false, - gregtech.api.enums.GT_Values.V[tTier], - aFluidInputs, - aItemInputs); - - log("Running checkRecipeGeneric(1)"); - - // First we check whether or not we have an input cached for boosting. - // If not, we set it to the current recipe. - // If we do, we compare it against the current recipe, if thy are the same, we try return a boosted recipe, if - // not, we boost a new recipe. - boolean isRecipeInputTheSame = false; - - // No cached recipe inputs, assume first run. - if (mInputVerificationForBoosting == null) { - mInputVerificationForBoosting = tRecipe.mInputs; - isRecipeInputTheSame = true; - } - // If the inputs match, we are good. - else { - if (tRecipe.mInputs == mInputVerificationForBoosting) { - isRecipeInputTheSame = true; - } else { - isRecipeInputTheSame = false; - } - } - - // Inputs are the same, let's see if there's a boosted version. - if (isRecipeInputTheSame) { - // Yes, let's just set that as the recipe - if (mHasBoostedCurrentRecipe && mBoostedRecipe != null) { - tRecipe = mBoostedRecipe; - } - // We have yet to generate a new boosted recipe - else { - GT_Recipe aBoostedRecipe = this.generateAdditionalOutputForRecipe(tRecipe); - if (aBoostedRecipe != null) { - mBoostedRecipe = aBoostedRecipe; - mHasBoostedCurrentRecipe = true; - tRecipe = mBoostedRecipe; - } - // Bad boost - else { - mBoostedRecipe = null; - mHasBoostedCurrentRecipe = false; - } - } - } - // We have changed inputs, so we should generate a new boosted recipe - else { - GT_Recipe aBoostedRecipe = this.generateAdditionalOutputForRecipe(tRecipe); - if (aBoostedRecipe != null) { - mBoostedRecipe = aBoostedRecipe; - mHasBoostedCurrentRecipe = true; - tRecipe = mBoostedRecipe; - } - // Bad boost - else { - mBoostedRecipe = null; - mHasBoostedCurrentRecipe = false; - } - } - - // Bad modify, let's just use the original recipe. - if (!mHasBoostedCurrentRecipe || mBoostedRecipe == null) { - tRecipe = aRecipe != null ? aRecipe - : findRecipe( - getBaseMetaTileEntity(), - mLastRecipe, - false, - false, - gregtech.api.enums.GT_Values.V[tTier], - aFluidInputs, - aItemInputs); - } - - // Remember last recipe - an optimization for findRecipe() - this.mLastRecipe = tRecipe; - - if (tRecipe == null) { - log("BAD RETURN - 1"); - return false; - } - - GT_ParallelHelper helper = new GT_ParallelHelper().setRecipe(tRecipe).setItemInputs(aItemInputs) - .setFluidInputs(aFluidInputs).setAvailableEUt(tEnergy).setMaxParallel(aMaxParallelRecipes) - .enableConsumption().enableOutputCalculation().setController(this); - - if (batchMode) { - helper.enableBatchMode(128); - } - - helper.build(); - - if (helper.getCurrentParallel() == 0) { - Logger.MACHINE_INFO("BAD RETURN - 2"); - return false; - } - - GT_OverclockCalculator calculator = new GT_OverclockCalculator().setRecipeEUt(tRecipe.mEUt).setEUt(tEnergy) - .setDuration(tRecipe.mDuration).setEUtDiscount(aEUPercent / 100.0f) - .setSpeedBoost(100.0f / (100.0f + aSpeedBonusPercent)) - .setParallel((int) Math.floor(helper.getCurrentParallel() / helper.getDurationMultiplier())) - .calculate(); - lEUt = -calculator.getConsumption(); - mMaxProgresstime = (int) Math.ceil(mMaxProgresstime * helper.getDurationMultiplier()); - - mOutputItems = helper.getItemOutputs(); - mOutputFluids = helper.getFluidOutputs(); - updateSlots(); - - return true; - } - public boolean isMachineRunning() { boolean aRunning = this.getBaseMetaTileEntity().isActive(); // log("Queried Multiblock is currently running: "+aRunning); @@ -899,33 +494,6 @@ public abstract class GregtechMeta_MultiBlockBase= 750 && aMetaTileID < 1000 && aFoundBlock == GregTech_API.sBlockMachines) { - return true; - } - // Vanilla Hatches/Busses - else if (aMetaTileID >= 10 && aMetaTileID <= 99 && aFoundBlock == GregTech_API.sBlockMachines) { - return true; - } - // Adv Mufflers - else if (aMetaTileID >= 30001 && aMetaTileID <= 30009 && aFoundBlock == GregTech_API.sBlockMachines) { - return true; - } - // Control Core, Super IO - else if (aMetaTileID >= 30020 && aMetaTileID <= 30040 && aFoundBlock == GregTech_API.sBlockMachines) { - return true; - } - // Auto maint - else if (aMetaTileID == 111 && aFoundBlock == GregTech_API.sBlockMachines) { - return true; - } - // Data Ports - else if ((aMetaTileID == 131 || aMetaTileID == 132) && aFoundBlock == GregTech_API.sBlockMachines) { - return true; - } else { - log("Found meta Tile: " + aMetaTileID); - } - } - } - if (!isHatch) { - if (aFoundBlock == aExpectedBlock && aFoundMeta == aExpectedMeta) { - return true; - } else if (aFoundBlock != aExpectedBlock) { - if (GTplusplus.CURRENT_LOAD_PHASE == INIT_PHASE.STARTED) { - log( - "A1 - Found: " + aFoundBlock.getLocalizedName() - + ":" - + aFoundMeta - + ", Expected: " - + aExpectedBlock.getLocalizedName() - + ":" - + aExpectedMeta); - // log("Loc: "+(new BlockPos(aBaseMetaTileEntity).getLocationString())); - } - return false; - } else if (aFoundMeta != aExpectedMeta) { - log("A2"); - return false; - } - } - log("A3"); - return false; - } - @Override public void onServerStart() { super.onServerStart(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java index 2c2412d245..85a3fd4edc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java @@ -2,7 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.util.GT_StructureUtility.buildHatchAdder; -import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; import java.util.ArrayList; import java.util.Collections; @@ -14,18 +13,16 @@ import net.minecraft.util.StatCollector; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import org.apache.commons.lang3.ArrayUtils; - import gregtech.api.enums.Textures; import gregtech.api.interfaces.IHatchElement; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.logic.ProcessingLogic; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_HatchElementBuilder; import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gregtech.api.util.IGT_HatchAdder; import gtPlusPlus.api.objects.data.AutoMap; @@ -75,150 +72,14 @@ public abstract class GregtechMeta_SteamMultiBase tItems = getStoredInputs(); - ArrayList tFluids = getStoredFluids(); - GT_Recipe_Map tMap = this.getRecipeMap(); - if (tMap == null) { - return false; - } - ItemStack[] aItemInputs = tItems.toArray(new ItemStack[0]); - FluidStack[] aFluidInputs = tFluids.toArray(new FluidStack[0]); - GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[1], null, null, aItemInputs); - if (tRecipe == null) { - log("BAD RETURN - 1"); - return false; - } - - int aEUPercent = 100; - int aSpeedBonusPercent = 0; - int aOutputChanceRoll = 10000; - - // Reset outputs and progress stats - this.lEUt = 0; - this.mMaxProgresstime = 0; - this.mOutputItems = new ItemStack[] {}; - this.mOutputFluids = new FluidStack[] {}; - - log("Running checkRecipeGeneric(1)"); - // Remember last recipe - an optimization for findRecipe() - this.mLastRecipe = tRecipe; - - int aMaxParallelRecipes = canBufferOutputs( - tRecipe.mOutputs, - tRecipe.mFluidOutputs, - this.getMaxParallelRecipes()); - if (aMaxParallelRecipes == 0) { - log("BAD RETURN - 2"); - return false; - } - - // EU discount - float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; - float tTotalEUt = 0.0f; - - int parallelRecipes = 0; - - log("parallelRecipes: " + parallelRecipes); - log("aMaxParallelRecipes: " + aMaxParallelRecipes); - log("tTotalEUt: " + tTotalEUt); - log("tRecipeEUt: " + tRecipeEUt); - - // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits - for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (32 - tRecipeEUt); parallelRecipes++) { - if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { - log("Broke at " + parallelRecipes + "."); - break; - } - log("Bumped EU from " + tTotalEUt + " to " + (tTotalEUt + tRecipeEUt) + "."); - tTotalEUt += tRecipeEUt; - } - - if (parallelRecipes == 0) { - log("BAD RETURN - 3"); - return false; - } - - // -- Try not to fail after this point - inputs have already been consumed! -- - - // Convert speed bonus to duration multiplier - // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. - aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); - float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); - this.mMaxProgresstime = (int) (tRecipe.mDuration * tTimeFactor * 1.5f); - - this.lEUt = (long) Math.ceil(tTotalEUt * 1.33f); - - // this.mEUt = (3 * tRecipe.mEUt); - - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - - if (this.lEUt > 0) { - this.lEUt = (-this.lEUt); - } - - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - - // Collect fluid outputs - FluidStack[] tOutputFluids = getOutputFluids(tRecipe, parallelRecipes); - - // Collect output item types - ItemStack[] tOutputItems = getOutputItems(tRecipe); - - // Set output item stack sizes (taking output chance into account) - for (int f = 0; f < tOutputItems.length; f++) { - if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { - for (int g = 0; g < parallelRecipes; g++) { - if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f)) - tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; - } - } - } - - tOutputItems = removeNulls(tOutputItems); - - // Sanitize item stack size, splitting any stacks greater than max stack size - List splitStacks = new ArrayList(); - for (ItemStack tItem : tOutputItems) { - while (tItem.getMaxStackSize() < tItem.stackSize) { - ItemStack tmp = tItem.copy(); - tmp.stackSize = tmp.getMaxStackSize(); - tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); - splitStacks.add(tmp); - } - } - - if (splitStacks.size() > 0) { - ItemStack[] tmp = new ItemStack[splitStacks.size()]; - tmp = splitStacks.toArray(tmp); - tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); - } - - // Strip empty stacks - List tSList = new ArrayList(); - for (ItemStack tS : tOutputItems) { - if (tS.stackSize > 0) tSList.add(tS); - } - tOutputItems = tSList.toArray(new ItemStack[0]); - - // Commit outputs - this.mOutputItems = tOutputItems; - this.mOutputFluids = tOutputFluids; - updateSlots(); - - // Play sounds (GT++ addition - GT multiblocks play no sounds) - startProcess(); - - log("GOOD RETURN - 1"); - return true; + protected void setProcessingLogicPower(ProcessingLogic logic) { + logic.setAvailableVoltage(V[1]); + logic.setAvailableAmperage(1); } public ArrayList getAllSteamStacks() { 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 implements ISurvivalConstructable { - private long mVoltage; - private byte mTier; private int mCasing; private static IStructureDefinition STRUCTURE_DEFINITION = null; @@ -102,11 +92,6 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase 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 mCompleted = new AutoMap(); - AutoMap mSchematics = new AutoMap(); - 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( - new ItemStack[] { aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack, aStack }) != null) { - return true; - } - return false; + protected ProcessingLogic createProcessingLogic() { + return new ProcessingLogic().setSpeedBonus(1F / 6F).setEuModifier(0.75F) + .setMaxParallelSupplier(this::getMaxParallelRecipes); } @Override @@ -278,11 +139,6 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { - - private Block casingBlock; - private int casingMeta; - private int frameMeta; - private int casingTextureIndex; - - private ForgeDirection back; - - private int xLoc, yLoc, zLoc; - - protected int mRange; - - /** - * Machine Mode, {@value false} Attacks all entities, {@value true} Only attacks players. - */ - protected volatile boolean mMode = false; - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GregtechMTE_TeslaTower(mName); - } - - public GregtechMTE_TeslaTower(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); - initFields(); - } - - public GregtechMTE_TeslaTower(String aName) { - super(aName); - initFields(); - } - - @Override - public String getMachineType() { - return "Weaponized Lighting Rod"; - } - - /* - * @Override public String[] getTooltip() { String casings = getCasingBlockItem().get(0).getDisplayName(); return - * new String[]{ "Controller Block for the Tesla Defence Tower Mk3200", - * "Enemies within "+this.mRange+"m are blasted with a high energy plasma.", "This uses 5,000,000EU per blast.", - * "Can screwdriver to toggle mode between Players and all Entities.", "Size(WxHxD): 3x7x3", - * "Controller (Front middle at bottom)", "3x1x3 Base of " + casings, "1x3x1 " + casings + - * " pillar (Center of base)", "1x3x1 " + MaterialUtils.getMaterialName(getFrameMaterial()) + - * " Frame Boxes (Each pillar side and on top)", "1x Maintenance Hatch (One of base casings)", "1x " + - * VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)"}; } - */ - - @Override - protected final GT_Multiblock_Tooltip_Builder createTooltip() { - GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); - tt.addMachineType(getMachineType()).addInfo("Controller Block for the Tesla Defence Tower Mk3200") - .addInfo("Enemies within " + this.mRange + "m are blasted with a high energy plasma.") - .addInfo("This uses 5,000,000EU per blast.") - .addInfo("Can screwdriver to toggle mode between Players and all Entities.").addSeparator() - .beginStructureBlock(1, 7, 1, false).addController("Top Middle").addCasingInfoMin("Casing", 360, false) - .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1).addInputBus("Any 4 dot hint (min 1)", 4) - .addInputHatch("Any 4 dot hint(min 1)", 4).addOutputHatch("Any 4 dot hint(min 1)", 4) - .addEnergyHatch("Any 4 dot hint(min 1)", 4).addMaintenanceHatch("Any 4 dot hint(min 1)", 4) - .toolTipFinisher(CORE.GT_Tooltip_Builder.get()); - return tt; - } - - private final void initFields() { - casingBlock = ModBlocks.blockCasings2Misc; - casingMeta = getCasingBlockItem().get(0).getItemDamage(); - casingTextureIndex = getCasingTextureIndex(); - mRange = 50; - } - - @Override - protected IIconContainer getActiveOverlay() { - return TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active; - } - - @Override - protected IIconContainer getInactiveOverlay() { - return TexturesGtBlock.Overlay_Machine_Controller_Advanced; - } - - @Override - protected int getCasingTextureId() { - return getCasingTextureIndex(); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("mMode", this.mMode); - aNBT.setInteger("mRange", this.mRange); - super.saveNBTData(aNBT); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - this.mMode = aNBT.getBoolean("mMode"); - this.mRange = aNBT.getInteger("mRange"); - super.loadNBTData(aNBT); - } - - private boolean isEnergyEnough() { - if (this.getEUVar() >= 5000000) { - return true; - } - return false; - } - - @Override - public boolean checkRecipe(ItemStack aStack) { - - if (!isEnergyEnough()) { - this.mProgresstime = 0; - this.mMaxProgresstime = 20; - this.getBaseMetaTileEntity().setActive(false); - stopMachine(); - } else { - this.mProgresstime = 1; - this.mMaxProgresstime = 100; - this.getBaseMetaTileEntity().setActive(true); - } - return false; - } - - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - updateCoordinates(); - // check base layer - for (int xOff = -1 + back.offsetX; xOff <= 1 + back.offsetX; xOff++) { - for (int zOff = -1 + back.offsetZ; zOff <= 1 + back.offsetZ; zOff++) { - if (xOff == 0 && zOff == 0) continue; - - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xOff, 0, zOff); - if (!checkCasingBlock(xOff, 0, zOff) && !addMaintenanceToMachineList(tTileEntity, casingTextureIndex) - && !addEnergyInputToMachineList(tTileEntity, casingTextureIndex)) { - Logger.INFO("bad block"); -