-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switching branches * Start on rock breaker and finished air collector * Finished rock breaker structure * Match air collector overlay to vanilla GCYM * Lang * Large gas collector recipe * Rock breaka' * Rebase and spotless * Oops duplicate MTE IDs * Credit * Switching branches * Base work * Actually works now * Fix rebase, I don't know how to git istg * I don't care about making a whole new branch for this * spotlbesl * Remove silly casing * Large alloy smelter recipe
- Loading branch information
Showing
19 changed files
with
446 additions
and
17 deletions.
There are no files selected for viewing
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
83 changes: 83 additions & 0 deletions
83
...on/zbgt/common/metatileentities/multi/electric/large/MetaTileEntityLargeAirCollector.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,83 @@ | ||
package com.zorbatron.zbgt.common.metatileentities.multi.electric.large; | ||
|
||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; | ||
import gregtech.api.metatileentity.MetaTileEntity; | ||
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; | ||
import gregtech.api.metatileentity.multiblock.IMultiblockPart; | ||
import gregtech.api.pattern.BlockPattern; | ||
import gregtech.api.pattern.FactoryBlockPattern; | ||
import gregtech.api.recipes.RecipeMaps; | ||
import gregtech.api.util.RelativeDirection; | ||
import gregtech.client.renderer.ICubeRenderer; | ||
import gregtech.client.renderer.texture.Textures; | ||
import gregtech.common.blocks.*; | ||
|
||
public class MetaTileEntityLargeAirCollector extends GCYMRecipeMapMultiblockController { | ||
|
||
public MetaTileEntityLargeAirCollector(ResourceLocation metaTileEntityId) { | ||
super(metaTileEntityId, RecipeMaps.GAS_COLLECTOR_RECIPES); | ||
} | ||
|
||
@Override | ||
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { | ||
return new MetaTileEntityLargeAirCollector(metaTileEntityId); | ||
} | ||
|
||
@Override | ||
protected @NotNull BlockPattern createStructurePattern() { | ||
return FactoryBlockPattern.start(RelativeDirection.RIGHT, RelativeDirection.FRONT, RelativeDirection.UP) | ||
.aisle(" XSX ", "XIXIX", "XXXXX", "XIXIX", " XXX ") | ||
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ") | ||
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ") | ||
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ") | ||
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ") | ||
.aisle(" LGL ", "L I L", "GIPIG", "L I L", " LGL ") | ||
.aisle(" XXX ", "XIXIX", "XXPXX", "XIXIX", " XXX ") | ||
.where('S', selfPredicate()) | ||
.where('X', states(getCasingState()) | ||
.or(autoAbilities(true, true, true, true, true, true, false))) | ||
.where('I', states(getIntakeState())) | ||
.where('L', states(getGlassState())) | ||
.where('G', states(getGrateState())) | ||
.where('P', states(getPipeCasingState())) | ||
.build(); | ||
} | ||
|
||
protected IBlockState getCasingState() { | ||
return MetaBlocks.TURBINE_CASING.getState( | ||
BlockTurbineCasing.TurbineCasingType.TUNGSTENSTEEL_TURBINE_CASING); | ||
} | ||
|
||
protected IBlockState getIntakeState() { | ||
return MetaBlocks.MULTIBLOCK_CASING.getState( | ||
BlockMultiblockCasing.MultiblockCasingType.EXTREME_ENGINE_INTAKE_CASING); | ||
} | ||
|
||
protected IBlockState getGlassState() { | ||
return MetaBlocks.TRANSPARENT_CASING.getState( | ||
BlockGlassCasing.CasingType.TEMPERED_GLASS); | ||
} | ||
|
||
protected IBlockState getGrateState() { | ||
return MetaBlocks.MULTIBLOCK_CASING.getState( | ||
BlockMultiblockCasing.MultiblockCasingType.GRATE_CASING); | ||
} | ||
|
||
protected IBlockState getPipeCasingState() { | ||
return MetaBlocks.BOILER_CASING.getState( | ||
BlockBoilerCasing.BoilerCasingType.TUNGSTENSTEEL_PIPE); | ||
} | ||
|
||
@SideOnly(Side.CLIENT) | ||
@Override | ||
public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { | ||
return Textures.ROBUST_TUNGSTENSTEEL_CASING; | ||
} | ||
} |
153 changes: 153 additions & 0 deletions
153
...on/zbgt/common/metatileentities/multi/electric/large/MetaTileEntityLargeAlloySmelter.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,153 @@ | ||
package com.zorbatron.zbgt.common.metatileentities.multi.electric.large; | ||
|
||
import java.util.List; | ||
|
||
import net.minecraft.block.state.IBlockState; | ||
import net.minecraft.util.ResourceLocation; | ||
import net.minecraft.util.text.ITextComponent; | ||
import net.minecraft.util.text.TextFormatting; | ||
import net.minecraftforge.fml.relauncher.Side; | ||
import net.minecraftforge.fml.relauncher.SideOnly; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
import gregicality.multiblocks.api.capability.impl.GCYMMultiblockRecipeLogic; | ||
import gregicality.multiblocks.api.metatileentity.GCYMRecipeMapMultiblockController; | ||
import gregicality.multiblocks.api.render.GCYMTextures; | ||
import gregicality.multiblocks.common.block.GCYMMetaBlocks; | ||
import gregicality.multiblocks.common.block.blocks.BlockLargeMultiblockCasing; | ||
import gregicality.multiblocks.common.block.blocks.BlockUniqueCasing; | ||
import gregtech.api.block.IHeatingCoilBlockStats; | ||
import gregtech.api.metatileentity.MetaTileEntity; | ||
import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; | ||
import gregtech.api.metatileentity.multiblock.IMultiblockPart; | ||
import gregtech.api.metatileentity.multiblock.MultiblockDisplayText; | ||
import gregtech.api.metatileentity.multiblock.RecipeMapMultiblockController; | ||
import gregtech.api.pattern.BlockPattern; | ||
import gregtech.api.pattern.FactoryBlockPattern; | ||
import gregtech.api.pattern.PatternMatchContext; | ||
import gregtech.api.recipes.RecipeMaps; | ||
import gregtech.api.recipes.recipeproperties.IRecipePropertyStorage; | ||
import gregtech.api.util.GTUtility; | ||
import gregtech.api.util.TextComponentUtil; | ||
import gregtech.client.renderer.ICubeRenderer; | ||
|
||
public class MetaTileEntityLargeAlloySmelter extends GCYMRecipeMapMultiblockController { | ||
|
||
private int coilTier; | ||
|
||
public MetaTileEntityLargeAlloySmelter(ResourceLocation metaTileEntityId) { | ||
super(metaTileEntityId, RecipeMaps.ALLOY_SMELTER_RECIPES); | ||
this.recipeMapWorkable = new LargeAlloySmelterRecipeLogic(this); | ||
} | ||
|
||
@Override | ||
public MetaTileEntity createMetaTileEntity(IGregTechTileEntity tileEntity) { | ||
return new MetaTileEntityLargeAlloySmelter(metaTileEntityId); | ||
} | ||
|
||
@Override | ||
protected @NotNull BlockPattern createStructurePattern() { | ||
return FactoryBlockPattern.start() | ||
.aisle("XXX", "CCC", "VVV", "CCC", "XXX") | ||
.aisle("XXX", "C#C", "V#V", "C#C", "XXX") | ||
.aisle("XSX", "CCC", "VVV", "CCC", "XXX") | ||
.where('S', selfPredicate()) | ||
.where('X', states(getCasingState()).setMinGlobalLimited(10) | ||
.or(autoAbilities())) | ||
.where('C', heatingCoils()) | ||
.where('V', states(getVentState())) | ||
.where('#', air()) | ||
.build(); | ||
} | ||
|
||
protected IBlockState getCasingState() { | ||
return GCYMMetaBlocks.LARGE_MULTIBLOCK_CASING | ||
.getState(BlockLargeMultiblockCasing.CasingType.HIGH_TEMPERATURE_CASING); | ||
} | ||
|
||
protected IBlockState getVentState() { | ||
return GCYMMetaBlocks.UNIQUE_CASING.getState(BlockUniqueCasing.UniqueCasingType.HEAT_VENT); | ||
} | ||
|
||
@Override | ||
public boolean hasMufflerMechanics() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected void formStructure(PatternMatchContext context) { | ||
super.formStructure(context); | ||
|
||
Object type = context.get("CoilType"); | ||
if (type instanceof IHeatingCoilBlockStats) { | ||
this.coilTier = ((IHeatingCoilBlockStats) type).getTier(); | ||
} else { | ||
this.coilTier = 0; | ||
} | ||
} | ||
|
||
@Override | ||
public void invalidateStructure() { | ||
super.invalidateStructure(); | ||
|
||
this.coilTier = -1; | ||
} | ||
|
||
@Override | ||
protected void addDisplayText(List<ITextComponent> textList) { | ||
MultiblockDisplayText.builder(textList, isStructureFormed()) | ||
.setWorkingStatus(recipeMapWorkable.isWorkingEnabled(), recipeMapWorkable.isActive()) | ||
.addEnergyUsageLine(getEnergyContainer()) | ||
.addEnergyTierLine(GTUtility.getTierByVoltage(recipeMapWorkable.getMaxVoltage())) | ||
.addCustom(tl -> { | ||
// Coil energy discount line | ||
if (isStructureFormed()) { | ||
ITextComponent energyDiscount = TextComponentUtil.stringWithColor(TextFormatting.AQUA, | ||
Math.max(0.1, 100 - 10 * coilTier) + "%"); | ||
|
||
ITextComponent base = TextComponentUtil.translationWithColor( | ||
TextFormatting.GRAY, | ||
"gregtech.multiblock.cracking_unit.energy", | ||
energyDiscount); | ||
|
||
ITextComponent hover = TextComponentUtil.translationWithColor( | ||
TextFormatting.GRAY, | ||
"gregtech.multiblock.cracking_unit.energy_hover"); | ||
|
||
tl.add(TextComponentUtil.setHover(base, hover)); | ||
} | ||
}) | ||
.addParallelsLine(recipeMapWorkable.getParallelLimit()) | ||
.addWorkingStatusLine() | ||
.addProgressLine(recipeMapWorkable.getProgressPercent()); | ||
} | ||
|
||
@SideOnly(Side.CLIENT) | ||
@Override | ||
public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) { | ||
return GCYMTextures.BLAST_CASING; | ||
} | ||
|
||
protected int getCoilTier() { | ||
return coilTier; | ||
} | ||
|
||
@SuppressWarnings("InnerClassMayBeStatic") | ||
private class LargeAlloySmelterRecipeLogic extends GCYMMultiblockRecipeLogic { | ||
|
||
public LargeAlloySmelterRecipeLogic(RecipeMapMultiblockController tileEntity) { | ||
super(tileEntity); | ||
} | ||
|
||
@Override | ||
protected void modifyOverclockPost(int[] overclockResults, @NotNull IRecipePropertyStorage storage) { | ||
super.modifyOverclockPost(overclockResults, storage); | ||
|
||
int coilTier = ((MetaTileEntityLargeAlloySmelter) metaTileEntity).getCoilTier(); | ||
if (coilTier <= 0) return; | ||
|
||
overclockResults[0] = (int) Math.max(1, overclockResults[0] * (1.0f - coilTier * 0.1)); | ||
} | ||
} | ||
} |
Oops, something went wrong.