From 5e27ee9f483a7571578b9e05acaec0c35b186ec6 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Tue, 27 Jul 2021 13:27:54 -0600 Subject: Delete no longer needed dynamic pyrolyse recipe code Former-commit-id: b84e31e09e2c4340884f5a518f8ff21d15e43a39 --- .../multi/GT_Replacement/TT_PyrolyseOven.java | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java index 0c1182189c..6ceb2791cf 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java @@ -14,11 +14,9 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.loaders.oreprocessing.ProcessingLog; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; @@ -165,10 +163,6 @@ public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - //Dynamic recipe adding for newly found logWoods - wont be visible in nei most probably - if (tRecipe == null) - tRecipe = addRecipesDynamically(tInputs, tFluids, tTier); - if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) return false; setEfficiencyAndOc(tRecipe); @@ -186,22 +180,6 @@ public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { return true; } - private GT_Recipe addRecipesDynamically(ItemStack[] tInputs, FluidStack[] tFluids, int tTier) { - if (tInputs.length <= 1 && (tInputs[0] == null || tInputs[0].getItem() == GT_Utility.getIntegratedCircuit(0).getItem())) { - return null; - } - int oreId = OreDictionary.getOreID("logWood"); - for (ItemStack is : tInputs) { - for (int id : OreDictionary.getOreIDs(is)) { - if (oreId == id) { - ProcessingLog.addPyrolyeOvenRecipes(is); - return GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - } - } - } - return null; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new TT_PyrolyseOven(this.mName); -- cgit From b72ce225d1f00be781653f659d68bb836863905f Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Fri, 30 Jul 2021 04:49:49 -0600 Subject: Delete TT_PyrolyseOven.java Fix merge conflict Former-commit-id: a2d7e02649610fc0c2c30dc480e4aa2b83ee30a6 --- .../multi/GT_Replacement/TT_PyrolyseOven.java | 209 --------------------- 1 file changed, 209 deletions(-) delete mode 100644 src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java (limited to 'src/main/java') diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java b/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java deleted file mode 100644 index 6ceb2791cf..0000000000 --- a/src/main/java/com/github/bartimaeusnek/crossmod/tectech/tileentites/multi/GT_Replacement/TT_PyrolyseOven.java +++ /dev/null @@ -1,209 +0,0 @@ -package com.github.bartimaeusnek.crossmod.tectech.tileentites.multi.GT_Replacement; - -import com.github.bartimaeusnek.crossmod.tectech.helper.CoilAdder; -import com.github.technus.tectech.mechanics.structure.IStructureDefinition; -import com.github.technus.tectech.mechanics.structure.StructureDefinition; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.HeatingCoilLevel; -import gregtech.api.enums.Textures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.render.TextureFactory; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.ADV_STR_CHECK; -import static com.github.bartimaeusnek.bartworks.util.BW_Tooltip_Reference.TT_BLUEPRINT; -import static com.github.technus.tectech.mechanics.structure.StructureUtility.*; - -public class TT_PyrolyseOven extends TT_Abstract_GT_Replacement_Coils { - private static final int TEXTURE_INDEX = 1090; - private static final int pollutionPerTick = 30; - - public TT_PyrolyseOven(Object unused, Object unused2) { - super(1159, "multimachine.pyro", "Pyrolyse Oven"); - } - - public TT_PyrolyseOven(String aName) { - super(aName); - } - - private static final Block casingBlock; - private static final int casingMeta; - - private int blocks = 0; - - static { - if (Loader.isModLoaded("dreamcraft")) { - casingBlock = GameRegistry.findBlock("dreamcraft", "gt.blockcasingsNH"); - casingMeta = 2; - } else { - casingBlock = GregTech_API.sBlockCasings1; - casingMeta = 0; - } - } - - private static final IStructureDefinition STRUCTURE_DEFINITION = StructureDefinition - .builder() - .addShape("main", - transpose(new String[][]{ - {"AAAAA", "ACCCA", "ACCCA", "ACCCA", "AAAAA"}, - {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, - {"AAAAA", "A---A", "A---A", "A---A", "AAAAA"}, - {"BB~BB", "BDDDB", "BDDDB", "BDDDB", "BBBBB"} - }) - ).addElement( - 'D', - CoilAdder.getINSTANCE() - ).addElement( - 'A', - onElementPass(x -> x.blocks++, - ofBlock( - casingBlock, - casingMeta - ) - ) - ).addElement( - 'B', - ofChain( - ofHatchAdder( - TT_PyrolyseOven::addClassicOutputToMachineList, TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_PyrolyseOven::addEnergyIOToMachineList, TEXTURE_INDEX, - 1 - ), - ofHatchAdder( - TT_PyrolyseOven::addClassicMaintenanceToMachineList, TEXTURE_INDEX, - 1 - ), - onElementPass(x -> x.blocks++, - ofBlock( - casingBlock, - casingMeta - ) - ) - ) - - ).addElement( - 'C', - ofChain( - ofHatchAdder( - TT_PyrolyseOven::addClassicInputToMachineList, TEXTURE_INDEX, - 2 - ), - ofHatchAdder( - TT_PyrolyseOven::addClassicMufflerToMachineList, TEXTURE_INDEX, - 2 - ), - onElementPass(x -> x.blocks++, - ofBlock( - casingBlock, - casingMeta - ) - ) - ) - - ) - .build(); - - @Override - public IStructureDefinition getStructure_EM() { - return STRUCTURE_DEFINITION; - } - - @Override - protected boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - this.setCoilHeat(HeatingCoilLevel.None); - this.blocks = 0; - return this.structureCheck_EM("main", 2,3,0) && this.blocks >= 60; - } - - private static final String[] desc = new String[]{ - "Coke Oven", - "Controller block for the Pyrolyse Oven", - "Industrial Charcoal producer", - "Processing speed scales linearly with Coil tier:", - "CuNi: 50%, FeAlCr: 100%, Ni4Cr: 150%, Fe50CW: 200%, etc.", - "EU/t is not affected by Coil tier", - "Creates up to: " + 20 * pollutionPerTick + " Pollution per Second", - ADV_STR_CHECK, - TT_BLUEPRINT - }; - - @Override - public String[] getDescription() { - return desc; - } - - @Override - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66], TextureFactory.of(aActive ? TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_ACTIVE_GLOW).glow().build()) : TextureFactory.of(TextureFactory.of(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN), TextureFactory.builder().addIcon(Textures.BlockIcons.OVERLAY_FRONT_PYROLYSE_OVEN_GLOW).glow().build()))}; - } - return new ITexture[]{Textures.BlockIcons.casingTexturePages[8][66]}; - } - - @Override - public boolean checkRecipe_EM(ItemStack aStack) { - ItemStack[] tInputs = getCompactedInputs(); - FluidStack[] tFluids = getCompactedFluids(); - - if (tInputs.length <= 0) - return false; - - long tVoltage = getMaxInputVoltage(); - byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); - GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sPyrolyseRecipes.findRecipe(getBaseMetaTileEntity(), false, gregtech.api.enums.GT_Values.V[tTier], tFluids, tInputs); - - if (tRecipe == null || !tRecipe.isRecipeInputEqual(true, tFluids, tInputs)) - return false; - setEfficiencyAndOc(tRecipe); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - if (this.mEUt > 0) - this.mEUt = (-this.mEUt); - this.mMaxProgresstime = Math.max(mMaxProgresstime * 2 / (1 + this.heatingCoilLevel.getTier()), 1); - if (tRecipe.mOutputs.length > 0) - this.mOutputItems = new ItemStack[]{tRecipe.getOutput(0)}; - if (tRecipe.mFluidOutputs.length > 0) - this.mOutputFluids = new FluidStack[]{tRecipe.getFluidOutput(0)}; - updateSlots(); - return true; - } - - @Override - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new TT_PyrolyseOven(this.mName); - } - - @Override - public int getPollutionPerTick(ItemStack aStack) { - return pollutionPerTick; - } - - private static final String[] sfStructureDescription = new String[] { - "0 - Air", - "1 - Output Hatch, Output Bus, Energy Hatch, Maintenance Hatch, Casing", - "2 - Input Hatch, Input Bus, Muffler Hatch, Casing", - "60 Casings at least!" - }; - - @Override - public String[] getStructureDescription(ItemStack itemStack) { - return sfStructureDescription; - } - - @Override - public void construct(ItemStack itemStack, boolean b) { - this.structureBuild_EM("main", 2,3,0, b, itemStack); - } -} -- cgit From b897968dce09006991d82cd5d856f0e4668cc698 Mon Sep 17 00:00:00 2001 From: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> Date: Wed, 4 Aug 2021 00:26:11 -0600 Subject: Fix Ross void miner Former-commit-id: 1efa09636673739423ea8e667fe0096e7eb30ee6 --- .../galacticgreg/GT_TileEntity_VoidMiner_Base.java | 31 +++++++++++----------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java index 267f9d372e..21596437e9 100644 --- a/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java +++ b/src/main/java/com/github/bartimaeusnek/crossmod/galacticgreg/GT_TileEntity_VoidMiner_Base.java @@ -309,16 +309,18 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri multiplier = TIER_MULTIPLIER; } - private void getDropMapBartworks(ModDimensionDef finalDef, int aID) { + private void getDropMapRoss(int aID) { Consumer addToList = makeAddToList(); if (aID == ConfigHandler.ross128BID) BW_WorldGenRoss128b.sList.forEach(addToList); else if (aID == ConfigHandler.ross128BAID) BW_WorldGenRoss128ba.sList.forEach(addToList); - else { - addOresVeinsBartworks(finalDef, addToList); - addSmallOresBartworks(finalDef); - } + } + + private void getDropMapBartworks(ModDimensionDef finalDef) { + Consumer addToList = makeAddToList(); + addOresVeinsBartworks(finalDef, addToList); + addSmallOresBartworks(finalDef); } private Consumer makeAddToList() { @@ -373,18 +375,17 @@ public abstract class GT_TileEntity_VoidMiner_Base extends GT_MetaTileEntity_Dri dropmap.values().forEach(f -> totalWeight += f); } - private void handleDimBasedDrops(ModDimensionDef finalDef, int id) { - if (id != ConfigHandler.ross128BID && id != ConfigHandler.ross128BAID) - getDropMapSpace(finalDef); - } - private void handleModDimDef(int id) { - if ((id <= 1 && id >= -1) || id == 7) + if ((id <= 1 && id >= -1) || id == 7) { getDropMapVanilla(); - Optional.ofNullable(makeModDimDef()).ifPresent(def -> { - handleDimBasedDrops(def, id); - getDropMapBartworks(def, id); - }); + } else if (id == ConfigHandler.ross128BID || id == ConfigHandler.ross128BAID) { + getDropMapRoss(id); + } else { + Optional.ofNullable(makeModDimDef()).ifPresent(def -> { + getDropMapSpace(def); + getDropMapBartworks(def); + }); + } } private void calculateDropMap() { -- cgit