diff options
author | Matt <mtthw8198@gmail.com> | 2021-09-07 11:05:51 -0700 |
---|---|---|
committer | Matt <mtthw8198@gmail.com> | 2021-09-07 11:05:51 -0700 |
commit | 999e4b621a60587ec211451cdd64bce93c606dad (patch) | |
tree | f40ba56061355de136f7a240abe3cab58aefdf00 /src/main/java | |
parent | ce0ceebc6bab7d0e496b6c2d64b8282dc80f8b06 (diff) | |
download | GT5-Unofficial-999e4b621a60587ec211451cdd64bce93c606dad.tar.gz GT5-Unofficial-999e4b621a60587ec211451cdd64bce93c606dad.tar.bz2 GT5-Unofficial-999e4b621a60587ec211451cdd64bce93c606dad.zip |
I think I did this right
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java | 65 |
1 files changed, 46 insertions, 19 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java index 6b26132292..b91a911def 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/em_machine/GT_MetaTileEntity_EM_machine.java @@ -7,9 +7,12 @@ import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder; import com.github.technus.tectech.mechanics.structure.Structure; import com.github.technus.tectech.thing.block.QuantumGlassBlock; import com.github.technus.tectech.thing.block.QuantumStuffBlock; +import com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_computer; import com.github.technus.tectech.thing.metaTileEntity.multi.base.*; import com.github.technus.tectech.util.CommonValues; import com.github.technus.tectech.util.Util; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.block.Block; @@ -27,6 +30,8 @@ import static com.github.technus.tectech.mechanics.structure.Structure.adders; import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; /** @@ -41,26 +46,46 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa //endregion //region structure - private static final String[][] shape = new String[][]{ - {"B0", "A ", "0 - 0", "A ", "B0",}, - {"A000", "00000", "00.00", "00000", "A000",}, - {"A121", "1---1", "2---2", "1---1", "A121",}, - {"A131", "1---1", "3-A-3", "1---1", "A131",}, - {"A121", "1---1", "2---2", "1---1", "A121",}, - {"A000", "00000", "00-00", "00000", "A000",}, - {"B0", "A!!!", "0!!!0", "A!!!", "B0",},}; - private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMeta = new byte[]{4, 0, 5, 6}; - private static final IHatchAdder<GT_MetaTileEntity_EM_machine>[] addingMethods = adders( - GT_MetaTileEntity_EM_machine::addClassicToMachineList, - GT_MetaTileEntity_EM_machine::addElementalToMachineList); - private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; - private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMetaFallback = new byte[]{0, 4}; private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.processing.hint.0"),//1 - Classic Hatches or High Power Casing - translateToLocal("gt.blockmachines.multimachine.em.processing.hint.1"),};//2 - Elemental Hatches or Molecular Casing + translateToLocal("gt.blockmachines.multimachine.em.processing.hint.1"),//2 - Elemental Hatches or Molecular Casing + }; + + private static final IStructureDefinition<GT_MetaTileEntity_EM_machine> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_EM_machine>builder() + .addShape("main", new String[][]{ + {" A "," AAA "," EBE "," ECE "," EBE "," AAA "," A "}, + {" DDD ","AAAAA","E---E","E---E","E---E","AAAAA"," FFF "}, + {"AD-DA","AA~AA","B---B","C---C","B---B","AA-AA","AFFFA"}, + {" DDD ","AAAAA","E---E","E---E","E---E","AAAAA"," FFF "}, + {" A "," AAA "," EBE "," ECE "," EBE "," AAA "," A "} + }) + .addElement('A', ofBlock(sBlockCasingsTT, 4)) + .addElement('B', ofBlock(sBlockCasingsTT, 5)) + .addElement('C', ofBlock(sBlockCasingsTT, 6)) + .addElement('D', ofHatchAdderOptional(GT_MetaTileEntity_EM_machine::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .addElement('E', ofBlock(QuantumGlassBlock.INSTANCE, 0)) + .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_machine::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) + .build(); + +// private static final String[][] shape = new String[][]{ +// {"B0", "A ", "0 - 0", "A ", "B0",}, +// {"A000", "00000", "00.00", "00000", "A000",}, +// {"A121", "1---1", "2---2", "1---1", "A121",}, +// {"A131", "1---1", "3-A-3", "1---1", "A131",}, +// {"A121", "1---1", "2---2", "1---1", "A121",}, +// {"A000", "00000", "00-00", "00000", "A000",}, +// {"B0", "A!!!", "0!!!0", "A!!!", "B0",},}; +// private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT}; +// private static final byte[] blockMeta = new byte[]{4, 0, 5, 6}; +// private static final IHatchAdder<GT_MetaTileEntity_EM_machine>[] addingMethods = adders( +// GT_MetaTileEntity_EM_machine::addClassicToMachineList, +// GT_MetaTileEntity_EM_machine::addElementalToMachineList); +// private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4}; +// private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; +// private static final byte[] blockMetaFallback = new byte[]{0, 4}; + //endregion //region parameters @@ -190,7 +215,8 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 1); + //return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 1); + return structureCheck_EM("main", 2, 2, 1); } @Override @@ -354,7 +380,8 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - Structure.builder(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + //Structure.builder(shape, blockType, blockMeta, 2, 2, 1, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + structureBuild_EM("main", 2, 2, 1, hintsOnly, stackSize); } @Override |