Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use frame predicate & static states #284

Merged
merged 5 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected BlockPattern createStructurePattern() {
.where('X', casing.or(abilities))
.where('P', states(getPipeCasingState()))
.where('D', states(MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.STAINLESS_CLEAN)))
.where('E', states(MetaBlocks.FRAMES.get(Materials.StainlessSteel).getBlock(Materials.StainlessSteel)))
.where('E', frames(Materials.StainlessSteel))
.where('C', states(MetaBlocks.TURBINE_CASING.getState(TurbineCasingType.STAINLESS_STEEL_GEARBOX)))
.where(' ', any())
.build();
Expand All @@ -75,11 +75,11 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.INERT_PTFE_CASING;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.PTFE_INERT_CASING);
}

protected IBlockState getPipeCasingState() {
protected static IBlockState getPipeCasingState() {
return MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected BlockPattern createStructurePattern() {
.setMinGlobalLimited(24)
.or(autoAbilities(true, true, true, true, true, true, false)))
.where('P', states(MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.TITANIUM_PIPE)))
.where('F', states(MetaBlocks.FRAMES.get(Materials.Titanium).getBlock(Materials.Titanium)))
.where('F', frames(Materials.Titanium))
.where('M', abilities(MultiblockAbility.MUFFLER_HATCH))
.where(' ', any())
.where('#', air())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected BlockPattern createStructurePattern() {
.where('C', states(MetaBlocks.BOILER_CASING.getState((BoilerCasingType.STEEL_PIPE))))
.where('D', states(SuSyBlocks.MULTIBLOCK_TANK.getState(BlockMultiblockTank.MultiblockTankType.CLARIFIER)))
.where('E', states(MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STEEL_GEARBOX)))
.where('F', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)))
.where('F', frames(Materials.Steel))
.where(' ', any())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,19 @@ protected BlockPattern createStructurePattern() {
.aisle(" FF FF", " ")
.where('S', this.selfPredicate())
.where('P', states(this.getPipeCasingState()))
.where('F', states(this.getFrameState()))
.where('F', frames(Materials.Steel))
.where('C', states(this.getCasingState()).setMinGlobalLimited(20)
.or(this.autoAbilities()))
.build();
}
public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.SOLID_STEEL_CASING;
}
protected IBlockState getFrameState() {
return MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel);
}
protected IBlockState getCasingState() {

protected static IBlockState getCasingState() {
return MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID);
}
protected IBlockState getPipeCasingState() {
protected static IBlockState getPipeCasingState() {
return MetaBlocks.BOILER_CASING.getState(BoilerCasingType.STEEL_PIPE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ protected BlockPattern createStructurePattern() {
.where('S', selfPredicate())
.where('A', casingPredicate
.or(autoAbilities(true, true, true, true, true, true, false)))
.where('B', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)))
.where('C', states(MetaBlocks.FRAMES.get(Materials.StainlessSteel).getBlock(Materials.StainlessSteel)))
.where('B', frames(Materials.Steel))
.where('C', frames(Materials.StainlessSteel))
.where('D', states(MetaBlocks.BOILER_CASING.getState(BoilerCasingType.STEEL_PIPE)))
.where('E', casingPredicate)
.where(' ', any())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected BlockPattern createStructurePattern() {
.aisle("BBBB", "C##A", "BBBB")
.aisle("A A", "BSBB", "A A")
.where('S', selfPredicate())
.where('A', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)))
.where('A', frames(Materials.Steel))
.where('B', states(MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID)))
.where('C', abilities(MultiblockAbility.IMPORT_FLUIDS).setExactLimit(1))
.where(' ', any())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.SOLID_STEEL_CASING;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID);
}
protected IBlockState getPipeCasingState() {
protected static IBlockState getPipeCasingState() {
return MetaBlocks.BOILER_CASING.getState(BoilerCasingType.STEEL_PIPE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected BlockPattern createStructurePattern() {
.where('X', states(MetaBlocks.MACHINE_CASING.getState(MachineCasingType.ULV))
.setMinGlobalLimited(40)
.or(autoAbilities(true, true, true, true, true, true, false)))
.where('F', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)))
.where('F', frames(Materials.Steel))
.where('M', abilities(MultiblockAbility.MUFFLER_HATCH))
.where(' ', any())
.where('#', air())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.SOLID_STEEL_CASING;
}

protected IBlockState getFireboxCasingState() {
protected static IBlockState getFireboxCasingState() {
return MetaBlocks.BOILER_FIREBOX_CASING.getState(BlockFireboxCasing.FireboxCasingType.STEEL_FIREBOX);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected BlockPattern createStructurePattern() {
.aisle(" ", "XPX", "XPX", "XPX", "XPX")
.aisle("F F", "XSX", "XXX", "XXX", "XXX")
.where('S', this.selfPredicate())
.where('F', states(this.getFrameState()))
.where('F', frames(Materials.Steel))
.where('P', states(this.getPipeCasingState()))
.where('X', states(this.getCasingState()).setMinGlobalLimited(18)
.or(this.autoAbilities(true, true, true, true, true, true, false)))
Expand All @@ -52,14 +52,11 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.INERT_PTFE_CASING;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return MetaBlocks.METAL_CASING.getState(MetalCasingType.PTFE_INERT_CASING);
}
protected IBlockState getFrameState() {
return MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel);
}

protected IBlockState getPipeCasingState() {
protected static IBlockState getPipeCasingState() {
return MetaBlocks.BOILER_CASING.getState(BoilerCasingType.POLYTETRAFLUOROETHYLENE_PIPE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected BlockPattern createStructurePattern() {
.aisle("CCC", "CDC", "ACA")
.aisle("CCC", "BSB", "ACA")
.where('S', selfPredicate())
.where('A', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)))
.where('A', frames(Materials.Steel))
.where('B', autoAbilities(false, false, false, false, false, true, false).setMinGlobalLimited(2)
.or(autoAbilities(false, false, false, false, true, false, false).setMinGlobalLimited(2)))
.where('C', states(MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.FROST_PROOF_CASING;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return MetaBlocks.METAL_CASING.getState(MetalCasingType.ALUMINIUM_FROSTPROOF);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return SusyTextures.SILICON_CARBIDE_CASING;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return SuSyBlocks.MULTIBLOCK_CASING.getState(BlockSuSyMultiblockCasing.CasingType.SILICON_CARBIDE_CASING);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected BlockPattern createStructurePattern() {
.where('S', selfPredicate())
.where('A', states(MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID)))
.where('B', states(MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STEEL_GEARBOX)))
.where('C', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel))
.where('C', frames(Materials.Steel)
.or(autoAbilities(false, true, false, false, false, false, false).setExactLimit(1)))
.where('D', states(MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID)).setMinGlobalLimited(4)
.or(autoAbilities(false, false, true, false, true, false, false)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.FROST_PROOF_CASING;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return MetaBlocks.METAL_CASING.getState(MetalCasingType.ALUMINIUM_FROSTPROOF);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected BlockPattern createStructurePattern() {
.aisle(" ", " DDDDD ", " DDDDD ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ")
.where('S', selfPredicate())
.where('A', states(MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID)))
.where('B', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)).setMinGlobalLimited(275)
.where('B', frames(Materials.Steel).setMinGlobalLimited(275)
.or(autoAbilities(true, true, true, true, true, true, false)))
.where('C', states(MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STEEL_GEARBOX)))
.where('D', states(MetaBlocks.STONE_BLOCKS.get(StoneVariantBlock.StoneVariant.SMOOTH).getState(StoneVariantBlock.StoneType.CONCRETE_LIGHT)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected BlockPattern createStructurePattern() {
.aisle(" FFF ", " FSF ", " FFF ", " FFF ", " B ")
.where('S', selfPredicate())
.where('B', states(MetaBlocks.BOILER_CASING.getState((BlockBoilerCasing.BoilerCasingType.STEEL_PIPE))))
.where('C', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)))
.where('C', frames(Materials.Steel))
.where('A', casingPredicate
.or(maintenanceEnergy))
.where('D', states(MetaBlocks.METAL_CASING.getState(MetalCasingType.STAINLESS_CLEAN))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,19 +307,19 @@ protected ICubeRenderer getFrontOverlay() {
return SusyTextures.OCEANIC_DRILL_OVERLAY;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.STEEL_SOLID);
}

protected IBlockState getGrateState() {
protected static IBlockState getGrateState() {
return MetaBlocks.MULTIBLOCK_CASING.getState(BlockMultiblockCasing.MultiblockCasingType.GRATE_CASING);
}

protected IBlockState getPipeCasingState() {
protected static IBlockState getPipeCasingState() {
return MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.STEEL_PIPE);
}

protected IBlockState getConcreteState() {
protected static IBlockState getConcreteState() {
return MetaBlocks.STONE_BLOCKS.get(StoneVariantBlock.StoneVariant.SMOOTH).getState(StoneVariantBlock.StoneType.CONCRETE_LIGHT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected BlockPattern createStructurePattern() {
.aisle("ABBBA", "B###B", "ABBBA", " D D ")
.aisle("ABSBA", "ABBBA", "ABBBA", " D D ")
.where('S', selfPredicate())
.where('A', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)))
.where('A', frames(Materials.Steel))
.where('B', states(MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID))
.setMinGlobalLimited(16)
.or(autoAbilities(true, true, true, true, false, false, false)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected BlockPattern createStructurePattern() {
.aisle(" ", "XPX", "XPX", "XPX", "XPX")
.aisle("F F", "XSX", "XXX", "XXX", "XXX")
.where('S', this.selfPredicate())
.where('F', states(this.getFrameState()))
.where('F', frames(Materials.Steel))
.where('P', states(this.getPipeCasingState()))
.where('X', states(this.getCasingState()).setMinGlobalLimited(18)
.or(this.autoAbilities(true, true, true, true, true, true, false)))
Expand All @@ -51,14 +51,11 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.SOLID_STEEL_CASING;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID);
}
protected IBlockState getFrameState() {
return MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel);
}

protected IBlockState getPipeCasingState() {
protected static IBlockState getPipeCasingState() {
return MetaBlocks.BOILER_CASING.getState(BoilerCasingType.STEEL_PIPE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected BlockPattern createStructurePattern() {
.where('A', casingPredicate)
.where('B', states(MetaBlocks.BOILER_CASING.getState(BoilerCasingType.STEEL_PIPE)))
.where('C', states(MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STAINLESS_STEEL_GEARBOX)))
.where('D', states(MetaBlocks.FRAMES.get(Materials.StainlessSteel).getBlock(Materials.StainlessSteel)))
.where('D', frames(Materials.StainlessSteel))
.where('F', autoAbilities(false, false, false, false, false, true, false).setExactLimit(1)
.or(autoAbilities(false, false, false, false, true, false, false).setExactLimit(1)))
.where('G', casingPredicate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ protected BlockPattern createStructurePattern() {
.aisle(" ", " ", " ", " ", " ", " ", " ", " ", " F F ", " ")
.aisle(" ", " ", " ", " ", " ", " ", " ", " ", " F F ", " ")
.where('S', selfPredicate())
.where('F', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)))
.where('F', frames(Materials.Steel))
.where('M', states(MetaBlocks.METAL_CASING.getState(MetalCasingType.STEEL_SOLID)))
.where('G', states(MetaBlocks.TURBINE_CASING.getState(BlockTurbineCasing.TurbineCasingType.STEEL_GEARBOX)))
.where('C', states(MetaBlocks.STONE_BLOCKS.get(StoneVariantBlock.StoneVariant.SMOOTH).getState(StoneVariantBlock.StoneType.CONCRETE_LIGHT)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected BlockPattern createStructurePattern() {
.where('X', states(MetaBlocks.METAL_CASING.getState(BlockMetalCasing.MetalCasingType.INVAR_HEATPROOF)).setMinGlobalLimited(13)
.or(autoAbilities(true, true, true, true, true, true, false)))
.where('P', states(MetaBlocks.BOILER_CASING.getState(BlockBoilerCasing.BoilerCasingType.STEEL_PIPE)))
.where('F', states(MetaBlocks.FRAMES.get(Materials.Invar).getBlock(Materials.Invar)))
.where('F', frames(Materials.Invar))
.where('M', abilities(MultiblockAbility.MUFFLER_HATCH))
.where('B', states(MetaBlocks.BOILER_FIREBOX_CASING.getState(BlockFireboxCasing.FireboxCasingType.STEEL_FIREBOX)))
.where('#', air())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected BlockPattern createStructurePattern() {
.aisle("A A A", "A A A", "LCCCCMCCCCR", "L#########R", "LCCCCMCCCCR")
.aisle("A A A", "A A A", "L A R", "LCCCCSCCCCR", "L A R")
.where('S', selfPredicate())
.where('A', states(MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel)))
.where('A', frames(Materials.Steel))
.where('C', states(MetaBlocks.STONE_BLOCKS.get(StoneVariantBlock.StoneVariant.SMOOTH).getState(StoneVariantBlock.StoneType.CONCRETE_LIGHT)))
.where('L', casingPredicate
.or(autoAbilities(false, false, true, false, false, true, false))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public ICubeRenderer getBaseTexture(IMultiblockPart sourcePart) {
return Textures.FROST_PROOF_CASING;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return MetaBlocks.METAL_CASING.getState(MetalCasingType.ALUMINIUM_FROSTPROOF);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
import gregtech.api.recipes.Recipe;
import gregtech.api.unification.material.Materials;
import gregtech.client.renderer.ICubeRenderer;
import gregtech.client.renderer.texture.Textures;
import gregtech.common.blocks.BlockMachineCasing;
import gregtech.common.blocks.MetaBlocks;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
Expand Down Expand Up @@ -68,14 +65,10 @@ protected ICubeRenderer getFrontOverlay() {
return SusyTextures.SINTERING_OVERLAY;
}

protected IBlockState getCasingState() {
protected static IBlockState getCasingState() {
return SuSyBlocks.MULTIBLOCK_CASING.getState(BlockSuSyMultiblockCasing.CasingType.ULV_STRUCTURAL_CASING);
}

protected IBlockState getFrameState() {
return MetaBlocks.FRAMES.get(Materials.Steel).getBlock(Materials.Steel);
}

@NotNull
@Override
public BlockPattern createStructurePattern() {
Expand All @@ -99,7 +92,7 @@ public BlockPattern createStructurePattern() {
.or(autoAbilities(true, true, false, true, true, false, false)))
.where('C', casingPredicate
.or(autoAbilities(false, false, true, false, false, true, false)))
.where('F', states(getFrameState()))
.where('F', frames(Materials.Steel))
.where('B', SuSyPredicates.sinteringBricks())
.where('#', air())
.where(' ', any())
Expand Down
Loading