-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #335 from SymmetricDevs/bru-distill-2
Upgrade vacuum distillation tower
- Loading branch information
Showing
8 changed files
with
189 additions
and
128 deletions.
There are no files selected for viewing
94 changes: 94 additions & 0 deletions
94
src/main/java/supersymmetry/api/metatileentity/multiblock/MetaTileEntityOrderedDT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
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 supersymmetry.common.recipes.DistillationTowerRecipeLogic; | ||
|
||
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); | ||
this.recipeMapWorkable = new DistillationTowerRecipeLogic(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. <br> | ||
* <br> | ||
* There will be <i>consequences</i> if this is changed. Make sure to set the logic handler to one with | ||
* a properly overriden {@link DistillationTowerLogicHandler#determineOrderedFluidOutputs()} | ||
*/ | ||
@Override | ||
protected Function<BlockPos, Integer> 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; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.