From d14bda92f221058c0120ea0505250fc76866efae Mon Sep 17 00:00:00 2001 From: bruberu <80226372+bruberu@users.noreply.github.com> Date: Wed, 6 Nov 2024 21:25:28 -0600 Subject: [PATCH 1/2] feat: upgrade vac tower and extract superclass --- .../multiblock/MetaTileEntityOrderedDT.java | 92 +++++++++++++++ .../MetaTileEntitySieveDistillationTower.java | 107 +----------------- ...MetaTileEntityVacuumDistillationTower.java | 19 ++-- .../recipes/DistillationTowerRecipeLogic.java | 70 ++++++++++++ 4 files changed, 177 insertions(+), 111 deletions(-) create mode 100644 src/main/java/supersymmetry/api/metatileentity/multiblock/MetaTileEntityOrderedDT.java create mode 100644 src/main/java/supersymmetry/common/recipes/DistillationTowerRecipeLogic.java diff --git a/src/main/java/supersymmetry/api/metatileentity/multiblock/MetaTileEntityOrderedDT.java b/src/main/java/supersymmetry/api/metatileentity/multiblock/MetaTileEntityOrderedDT.java new file mode 100644 index 000000000..9c58c4853 --- /dev/null +++ b/src/main/java/supersymmetry/api/metatileentity/multiblock/MetaTileEntityOrderedDT.java @@ -0,0 +1,92 @@ +package supersymmetry.api.metatileentity.multiblock; + +import gregtech.api.capability.IDistillationTower; +import gregtech.api.capability.impl.DistillationTowerLogicHandler; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; +import gregtech.api.metatileentity.multiblock.IMultiblockPart; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.pattern.BlockPattern; +import gregtech.api.pattern.PatternMatchContext; +import gregtech.api.recipes.RecipeMap; +import gregtech.client.renderer.ICubeRenderer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; +import org.jetbrains.annotations.NotNull; + +import java.util.function.Function; + +import static gregtech.api.util.RelativeDirection.UP; + +public class MetaTileEntityOrderedDT extends RecipeMapMultiblockController implements IDistillationTower { + protected DistillationTowerLogicHandler handler; + + public MetaTileEntityOrderedDT(ResourceLocation metaTileEntityId, RecipeMap recipeMap) { + super(metaTileEntityId, recipeMap); + this.handler = new DistillationTowerLogicHandler(this); + } + + @Override + protected @NotNull BlockPattern createStructurePattern() { + return null; + } + + @Override + public ICubeRenderer getBaseTexture(IMultiblockPart iMultiblockPart) { + return null; + } + + @Override + public MetaTileEntity createMetaTileEntity(IGregTechTileEntity iGregTechTileEntity) { + return null; + } + + @Override + public boolean allowSameFluidFillForOutputs() { + return false; + } + + public DistillationTowerLogicHandler getHandler() { + return handler; + } + + + /** + * Used if MultiblockPart Abilities need to be sorted a certain way, like + * Distillation Tower and Assembly Line.
+ *
+ * There will be consequences if this is changed. Make sure to set the logic handler to one with + * a properly overriden {@link DistillationTowerLogicHandler#determineOrderedFluidOutputs()} + */ + @Override + protected Function multiblockPartSorter() { + return UP.getSorter(getFrontFacing(), getUpwardsFacing(), isFlipped()); + } + + @Override + protected void formStructure(PatternMatchContext context) { + super.formStructure(context); + if (this.handler == null || this.structurePattern == null) return; + handler.determineLayerCount(this.structurePattern); + handler.determineOrderedFluidOutputs(); + } + + + @Override + public void invalidateStructure() { + super.invalidateStructure(); + if (this.handler != null) handler.invalidate(); + } + + + @Override + public int getFluidOutputLimit() { + if (this.handler != null) return this.handler.getLayerCount(); + else return super.getFluidOutputLimit(); + } + + @Override + public boolean allowsExtendedFacing() { + return false; + } +} diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySieveDistillationTower.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySieveDistillationTower.java index 1fbb9c3f2..08ff14e1e 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySieveDistillationTower.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySieveDistillationTower.java @@ -32,8 +32,10 @@ import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.items.IItemHandlerModifiable; import org.jetbrains.annotations.NotNull; +import supersymmetry.api.metatileentity.multiblock.MetaTileEntityOrderedDT; import supersymmetry.common.blocks.BlockSuSyMultiblockCasing; import supersymmetry.common.blocks.SuSyBlocks; +import supersymmetry.common.recipes.DistillationTowerRecipeLogic; import java.util.List; import java.util.function.Function; @@ -41,12 +43,12 @@ import static gregtech.api.util.RelativeDirection.*; import static supersymmetry.api.recipes.SuSyRecipeMaps.SIEVE_DISTILLATION_RECIPES; -public class MetaTileEntitySieveDistillationTower extends RecipeMapMultiblockController implements IDistillationTower { +public class MetaTileEntitySieveDistillationTower extends MetaTileEntityOrderedDT implements IDistillationTower { protected DistillationTowerLogicHandler handler; public MetaTileEntitySieveDistillationTower(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SIEVE_DISTILLATION_RECIPES); - this.recipeMapWorkable = new SieveDistillationTowerRecipeLogic(this); + this.recipeMapWorkable = new DistillationTowerRecipeLogic(this); this.handler = new DistillationTowerLogicHandler(this); } @@ -54,29 +56,6 @@ public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { return new MetaTileEntitySieveDistillationTower(this.metaTileEntityId); } - /** - * Used if MultiblockPart Abilities need to be sorted a certain way, like - * Distillation Tower and Assembly Line.
- *
- * There will be consequences if this is changed. Make sure to set the logic handler to one with - * a properly overriden {@link DistillationTowerLogicHandler#determineOrderedFluidOutputs()} - */ - @Override - protected Function multiblockPartSorter() { - return UP.getSorter(getFrontFacing(), getUpwardsFacing(), isFlipped()); - } - - /** - * Whether this multi can be rotated or face upwards.
- *
- * There will be consequences if this returns true. Make sure to set the logic handler to one with - * a properly overriden {@link DistillationTowerLogicHandler#determineOrderedFluidOutputs()} - */ - @Override - public boolean allowsExtendedFacing() { - return false; - } - @Override protected void addDisplayText(List textList) { if (isStructureFormed()) { @@ -93,19 +72,6 @@ protected void addDisplayText(List textList) { super.addDisplayText(textList); } - @Override - protected void formStructure(PatternMatchContext context) { - super.formStructure(context); - if (this.handler == null || this.structurePattern == null) return; - handler.determineLayerCount(this.structurePattern); - handler.determineOrderedFluidOutputs(); - } - - @Override - public void invalidateStructure() { - super.invalidateStructure(); - if (this.handler != null) handler.invalidate(); - } @Override protected @NotNull BlockPattern createStructurePattern() { @@ -125,11 +91,6 @@ public void invalidateStructure() { .build(); } - @Override - public boolean allowSameFluidFillForOutputs() { - return false; - } - @SideOnly(Side.CLIENT) @Override public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { @@ -156,64 +117,4 @@ protected ICubeRenderer getFrontOverlay() { return Textures.DISTILLATION_TOWER_OVERLAY; } - @Override - public int getFluidOutputLimit() { - if (this.handler != null) return this.handler.getLayerCount(); - else return super.getFluidOutputLimit(); - } - - protected class SieveDistillationTowerRecipeLogic extends MultiblockRecipeLogic { - - public SieveDistillationTowerRecipeLogic(MetaTileEntitySieveDistillationTower tileEntity) { - super(tileEntity); - } - - @Override - protected void outputRecipeOutputs() { - GTTransferUtils.addItemsToItemHandler(getOutputInventory(), false, itemOutputs); - handler.applyFluidToOutputs(fluidOutputs, true); - } - - @Override - protected boolean setupAndConsumeRecipeInputs(@NotNull Recipe recipe, - @NotNull IItemHandlerModifiable importInventory, - @NotNull IMultipleTankHandler importFluids) { - this.overclockResults = calculateOverclock(recipe); - - modifyOverclockPost(overclockResults, recipe.getRecipePropertyStorage()); - - if (!hasEnoughPower(overclockResults)) { - return false; - } - - IItemHandlerModifiable exportInventory = getOutputInventory(); - - // We have already trimmed outputs and chanced outputs at this time - // Attempt to merge all outputs + chanced outputs into the output bus, to prevent voiding chanced outputs - if (!metaTileEntity.canVoidRecipeItemOutputs() && - !GTTransferUtils.addItemsToItemHandler(exportInventory, true, recipe.getAllItemOutputs())) { - this.isOutputsFull = true; - return false; - } - - // We have already trimmed fluid outputs at this time - if (!metaTileEntity.canVoidRecipeFluidOutputs() && - !handler.applyFluidToOutputs(recipe.getAllFluidOutputs(), false)) { - this.isOutputsFull = true; - return false; - } - - this.isOutputsFull = false; - if (recipe.matches(true, importInventory, importFluids)) { - this.metaTileEntity.addNotifiedInput(importInventory); - return true; - } - return false; - } - - @Override - protected IMultipleTankHandler getOutputTank() { - return handler.getFluidTanks(); - } - } } diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityVacuumDistillationTower.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityVacuumDistillationTower.java index c61446e6d..a717bfb08 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityVacuumDistillationTower.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityVacuumDistillationTower.java @@ -1,5 +1,7 @@ package supersymmetry.common.metatileentities.multi.electric; +import gregtech.api.capability.IDistillationTower; +import gregtech.api.capability.impl.DistillationTowerLogicHandler; import gregtech.api.capability.impl.MultiblockRecipeLogic; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; @@ -21,20 +23,26 @@ import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import supersymmetry.api.metatileentity.multiblock.MetaTileEntityOrderedDT; import supersymmetry.api.recipes.SuSyRecipeMaps; import supersymmetry.client.renderer.textures.SusyTextures; +import supersymmetry.common.recipes.DistillationTowerRecipeLogic; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; +import java.util.function.Function; import static gregtech.api.util.RelativeDirection.*; -public class MetaTileEntityVacuumDistillationTower extends RecipeMapMultiblockController { +public class MetaTileEntityVacuumDistillationTower extends MetaTileEntityOrderedDT { + protected DistillationTowerLogicHandler handler; + public MetaTileEntityVacuumDistillationTower(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SuSyRecipeMaps.VACUUM_DISTILLATION_RECIPES); - this.recipeMapWorkable = new MultiblockRecipeLogic(this, true); + this.recipeMapWorkable = new DistillationTowerRecipeLogic(this); } public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { @@ -54,7 +62,7 @@ protected BlockPattern createStructurePattern() { .where('F', frames(Materials.Steel)) .where('C', states(this.getCasingState()) .or(abilities(MultiblockAbility.INPUT_ENERGY).setMinGlobalLimited(1).setMaxGlobalLimited(3)) - .or(abilities(MultiblockAbility.IMPORT_FLUIDS).setMaxGlobalLimited(1)) + .or(abilities(MultiblockAbility.IMPORT_FLUIDS).setMaxGlobalLimited(2)) .or(abilities(MultiblockAbility.IMPORT_ITEMS).setMaxGlobalLimited(1))) .where('I', abilities(MultiblockAbility.EXPORT_ITEMS).setMaxGlobalLimited(1)) .where('D', states(this.getCasingState())) @@ -91,9 +99,4 @@ public void addInformation(ItemStack stack, @Nullable World player, List protected ICubeRenderer getFrontOverlay() { return SusyTextures.VDT_OVERLAY; } - - @Override - public boolean allowsExtendedFacing() { - return false; - } } diff --git a/src/main/java/supersymmetry/common/recipes/DistillationTowerRecipeLogic.java b/src/main/java/supersymmetry/common/recipes/DistillationTowerRecipeLogic.java new file mode 100644 index 000000000..433e2a806 --- /dev/null +++ b/src/main/java/supersymmetry/common/recipes/DistillationTowerRecipeLogic.java @@ -0,0 +1,70 @@ +package supersymmetry.common.recipes; + +import gregtech.api.capability.IMultipleTankHandler; +import gregtech.api.capability.impl.MultiblockRecipeLogic; +import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; +import gregtech.api.recipes.Recipe; +import gregtech.api.util.GTTransferUtils; +import net.minecraftforge.items.IItemHandlerModifiable; +import org.jetbrains.annotations.NotNull; +import supersymmetry.api.metatileentity.multiblock.MetaTileEntityOrderedDT; + +public class DistillationTowerRecipeLogic extends MultiblockRecipeLogic { + public DistillationTowerRecipeLogic(RecipeMapMultiblockController tileEntity) { + super(tileEntity); + } + + @Override + protected void outputRecipeOutputs() { + GTTransferUtils.addItemsToItemHandler(getOutputInventory(), false, itemOutputs); + if (metaTileEntity instanceof MetaTileEntityOrderedDT tower) + tower.getHandler().applyFluidToOutputs(fluidOutputs, true); + } + + @Override + protected boolean setupAndConsumeRecipeInputs(@NotNull Recipe recipe, + @NotNull IItemHandlerModifiable importInventory, + @NotNull IMultipleTankHandler importFluids) { + this.overclockResults = calculateOverclock(recipe); + + modifyOverclockPost(overclockResults, recipe.getRecipePropertyStorage()); + + if (!hasEnoughPower(overclockResults)) { + return false; + } + + IItemHandlerModifiable exportInventory = getOutputInventory(); + + // We have already trimmed outputs and chanced outputs at this time + // Attempt to merge all outputs + chanced outputs into the output bus, to prevent voiding chanced outputs + if (!metaTileEntity.canVoidRecipeItemOutputs() && + !GTTransferUtils.addItemsToItemHandler(exportInventory, true, recipe.getAllItemOutputs())) { + this.isOutputsFull = true; + return false; + } + + if (metaTileEntity instanceof MetaTileEntityOrderedDT tower) { + // We have already trimmed fluid outputs at this time + if (!metaTileEntity.canVoidRecipeFluidOutputs() && + !tower.getHandler().applyFluidToOutputs(recipe.getAllFluidOutputs(), false)) { + this.isOutputsFull = true; + return false; + } + } + + this.isOutputsFull = false; + if (recipe.matches(true, importInventory, importFluids)) { + this.metaTileEntity.addNotifiedInput(importInventory); + return true; + } + return false; + } + + @Override + protected IMultipleTankHandler getOutputTank() { + if (metaTileEntity instanceof MetaTileEntityOrderedDT tower) + return tower.getHandler().getFluidTanks(); + return super.getOutputTank(); + } + +} From 1b83e81571c054520d41cc5f7ae2e0b46721a0d4 Mon Sep 17 00:00:00 2001 From: bruberu <80226372+bruberu@users.noreply.github.com> Date: Tue, 12 Nov 2024 21:38:57 -0600 Subject: [PATCH 2/2] feat: all the DTs are now ordered :yay: --- .../multiblock/MetaTileEntityOrderedDT.java | 2 ++ ...HighPressureCryogenicDistillationPlant.java | 4 ++-- ...EntityHighTemperatureDistillationTower.java | 8 ++------ ...yLowPressureCryogenicDistillationPlant.java | 4 ++-- .../MetaTileEntitySieveDistillationTower.java | 1 - ...SingleColumnCryogenicDistillationPlant.java | 4 ++-- .../MetaTileEntityVacuumDistillationTower.java | 18 ++++++++---------- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/src/main/java/supersymmetry/api/metatileentity/multiblock/MetaTileEntityOrderedDT.java b/src/main/java/supersymmetry/api/metatileentity/multiblock/MetaTileEntityOrderedDT.java index 9c58c4853..33e402735 100644 --- a/src/main/java/supersymmetry/api/metatileentity/multiblock/MetaTileEntityOrderedDT.java +++ b/src/main/java/supersymmetry/api/metatileentity/multiblock/MetaTileEntityOrderedDT.java @@ -13,6 +13,7 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; import org.jetbrains.annotations.NotNull; +import supersymmetry.common.recipes.DistillationTowerRecipeLogic; import java.util.function.Function; @@ -24,6 +25,7 @@ public class MetaTileEntityOrderedDT extends RecipeMapMultiblockController imple public MetaTileEntityOrderedDT(ResourceLocation metaTileEntityId, RecipeMap recipeMap) { super(metaTileEntityId, recipeMap); this.handler = new DistillationTowerLogicHandler(this); + this.recipeMapWorkable = new DistillationTowerRecipeLogic(this); } @Override diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityHighPressureCryogenicDistillationPlant.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityHighPressureCryogenicDistillationPlant.java index 349f1850e..cc7f81086 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityHighPressureCryogenicDistillationPlant.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityHighPressureCryogenicDistillationPlant.java @@ -15,6 +15,7 @@ import gregtech.common.metatileentities.multi.multiblockpart.MetaTileEntityMultiFluidHatch; import net.minecraft.block.state.IBlockState; import net.minecraft.util.ResourceLocation; +import supersymmetry.api.metatileentity.multiblock.MetaTileEntityOrderedDT; import supersymmetry.api.recipes.SuSyRecipeMaps; import supersymmetry.client.renderer.textures.SusyTextures; import supersymmetry.common.blocks.BlockSuSyMultiblockCasing; @@ -24,10 +25,9 @@ import static gregtech.api.util.RelativeDirection.*; -public class MetaTileEntityHighPressureCryogenicDistillationPlant extends RecipeMapMultiblockController { +public class MetaTileEntityHighPressureCryogenicDistillationPlant extends MetaTileEntityOrderedDT { public MetaTileEntityHighPressureCryogenicDistillationPlant(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SuSyRecipeMaps.HIGH_PRESSURE_CRYOGENIC_DISTILLATION); - this.recipeMapWorkable = new MultiblockRecipeLogic(this, false); } public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityHighTemperatureDistillationTower.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityHighTemperatureDistillationTower.java index 749e594c7..c26c72081 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityHighTemperatureDistillationTower.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityHighTemperatureDistillationTower.java @@ -12,6 +12,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.BlockPos; +import supersymmetry.api.metatileentity.multiblock.MetaTileEntityOrderedDT; import supersymmetry.api.recipes.SuSyRecipeMaps; import supersymmetry.client.renderer.textures.SusyTextures; import supersymmetry.common.blocks.BlockSuSyMultiblockCasing; @@ -22,7 +23,7 @@ import static gregtech.api.util.RelativeDirection.*; -public class MetaTileEntityHighTemperatureDistillationTower extends RecipeMapMultiblockController { +public class MetaTileEntityHighTemperatureDistillationTower extends MetaTileEntityOrderedDT { public MetaTileEntityHighTemperatureDistillationTower(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SuSyRecipeMaps.HIGH_TEMPERATURE_DISTILLATION); @@ -60,11 +61,6 @@ protected BlockPattern createStructurePattern() { .build(); } - @Override - protected boolean allowSameFluidFillForOutputs() { - return false; - } - @Override public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { return SusyTextures.SILICON_CARBIDE_CASING; diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityLowPressureCryogenicDistillationPlant.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityLowPressureCryogenicDistillationPlant.java index 5fd9cdb59..926196881 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityLowPressureCryogenicDistillationPlant.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityLowPressureCryogenicDistillationPlant.java @@ -18,6 +18,7 @@ import org.jetbrains.annotations.NotNull; import supersymmetry.api.metatileentity.multiblock.ICryogenicProvider; import supersymmetry.api.metatileentity.multiblock.ICryogenicReceiver; +import supersymmetry.api.metatileentity.multiblock.MetaTileEntityOrderedDT; import supersymmetry.api.recipes.SuSyRecipeMaps; import supersymmetry.client.renderer.textures.SusyTextures; import supersymmetry.common.blocks.BlockSuSyMultiblockCasing; @@ -28,13 +29,12 @@ import static gregtech.api.util.RelativeDirection.*; -public class MetaTileEntityLowPressureCryogenicDistillationPlant extends RecipeMapMultiblockController implements ICryogenicProvider { +public class MetaTileEntityLowPressureCryogenicDistillationPlant extends MetaTileEntityOrderedDT implements ICryogenicProvider { private @Nullable ICryogenicReceiver receiver; public MetaTileEntityLowPressureCryogenicDistillationPlant(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SuSyRecipeMaps.LOW_PRESSURE_CRYOGENIC_DISTILLATION); - this.recipeMapWorkable = new MultiblockRecipeLogic(this, false); } public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySieveDistillationTower.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySieveDistillationTower.java index 08ff14e1e..f87ea0c52 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySieveDistillationTower.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySieveDistillationTower.java @@ -48,7 +48,6 @@ public class MetaTileEntitySieveDistillationTower extends MetaTileEntityOrderedD public MetaTileEntitySieveDistillationTower(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SIEVE_DISTILLATION_RECIPES); - this.recipeMapWorkable = new DistillationTowerRecipeLogic(this); this.handler = new DistillationTowerLogicHandler(this); } diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySingleColumnCryogenicDistillationPlant.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySingleColumnCryogenicDistillationPlant.java index 74d9b98b3..e10077e79 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySingleColumnCryogenicDistillationPlant.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntitySingleColumnCryogenicDistillationPlant.java @@ -18,6 +18,7 @@ import org.jetbrains.annotations.NotNull; import supersymmetry.api.metatileentity.multiblock.ICryogenicProvider; import supersymmetry.api.metatileentity.multiblock.ICryogenicReceiver; +import supersymmetry.api.metatileentity.multiblock.MetaTileEntityOrderedDT; import supersymmetry.api.recipes.SuSyRecipeMaps; import supersymmetry.common.blocks.BlockSuSyMultiblockCasing; import supersymmetry.common.blocks.SuSyBlocks; @@ -27,13 +28,12 @@ import static gregtech.api.util.RelativeDirection.*; -public class MetaTileEntitySingleColumnCryogenicDistillationPlant extends RecipeMapMultiblockController implements ICryogenicProvider { +public class MetaTileEntitySingleColumnCryogenicDistillationPlant extends MetaTileEntityOrderedDT implements ICryogenicProvider { private @Nullable ICryogenicReceiver receiver; public MetaTileEntitySingleColumnCryogenicDistillationPlant(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SuSyRecipeMaps.SINGLE_COLUMN_CRYOGENIC_DISTILLATION); - this.recipeMapWorkable = new MultiblockRecipeLogic(this, false); } public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { diff --git a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityVacuumDistillationTower.java b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityVacuumDistillationTower.java index a717bfb08..13fa8ab8e 100644 --- a/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityVacuumDistillationTower.java +++ b/src/main/java/supersymmetry/common/metatileentities/multi/electric/MetaTileEntityVacuumDistillationTower.java @@ -23,26 +23,21 @@ import net.minecraft.client.resources.I18n; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import supersymmetry.api.metatileentity.multiblock.MetaTileEntityOrderedDT; import supersymmetry.api.recipes.SuSyRecipeMaps; import supersymmetry.client.renderer.textures.SusyTextures; -import supersymmetry.common.recipes.DistillationTowerRecipeLogic; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.List; -import java.util.function.Function; import static gregtech.api.util.RelativeDirection.*; public class MetaTileEntityVacuumDistillationTower extends MetaTileEntityOrderedDT { - protected DistillationTowerLogicHandler handler; public MetaTileEntityVacuumDistillationTower(ResourceLocation metaTileEntityId) { super(metaTileEntityId, SuSyRecipeMaps.VACUUM_DISTILLATION_RECIPES); - this.recipeMapWorkable = new DistillationTowerRecipeLogic(this); } public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { @@ -54,7 +49,7 @@ protected BlockPattern createStructurePattern() { .aisle(" CSC ", "CCCCCC", "CCCCCC", "CCCCCC", " CCC ") .aisle(" CGC ", "C#F#CC", "IFFF#P", "C#F#CC", " CCC ") .aisle(" CCC ", "C#F#CC", "CFFFCC", "C#F#CC", " CCC ") - .aisle(" XXX ", "X#F#D ", "XFFFD ", "X#F#D ", " XXX ").setRepeatable(1,12) + .aisle(" XXX ", "X#F#D ", "XFFFD ", "X#F#D ", " XXX ").setRepeatable(1, 12) .aisle(" DDD ", "DDDDD ", "DDDDD ", "DDDDD ", " DDD ") .where('S', this.selfPredicate()) .where('G', states(this.getGlassState())) @@ -68,13 +63,14 @@ protected BlockPattern createStructurePattern() { .where('D', states(this.getCasingState())) .where('X', states(getCasingState()) .or(metaTileEntities(MultiblockAbility.REGISTRY.get(MultiblockAbility.EXPORT_FLUIDS).stream() - .filter(mte->!(mte instanceof MetaTileEntityMultiFluidHatch)) - .toArray(MetaTileEntity[]::new)) - .setMinLayerLimited(1).setMaxLayerLimited(1)) - .or(autoAbilities(true, false))) + .filter(mte -> !(mte instanceof MetaTileEntityMultiFluidHatch)) + .toArray(MetaTileEntity[]::new)) + .setMaxLayerLimited(1)) + ) .where('#', air()) .build(); } + public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { return Textures.SOLID_STEEL_CASING; } @@ -82,9 +78,11 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { protected static IBlockState getGlassState() { return MetaBlocks.TRANSPARENT_CASING.getState(BlockGlassCasing.CasingType.TEMPERED_GLASS); } + protected static IBlockState getCasingState() { return MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID); } + protected static IBlockState getPipeCasingState() { return MetaBlocks.BOILER_CASING.getState(BoilerCasingType.STEEL_PIPE); }