diff options
author | Matt <mtthw8198@gmail.com> | 2021-09-07 20:36:16 -0700 |
---|---|---|
committer | Matt <mtthw8198@gmail.com> | 2021-09-07 20:36:16 -0700 |
commit | 115e7b212d95e3dbdf0fa2db8841f01a0e8f0075 (patch) | |
tree | 2c05bfa4457107e4cd1feafc45d8868e78de665a /src | |
parent | 32a6cb64fcb1d2323b02b3f46b28be7ee47123bd (diff) | |
download | GT5-Unofficial-115e7b212d95e3dbdf0fa2db8841f01a0e8f0075.tar.gz GT5-Unofficial-115e7b212d95e3dbdf0fa2db8841f01a0e8f0075.tar.bz2 GT5-Unofficial-115e7b212d95e3dbdf0fa2db8841f01a0e8f0075.zip |
I think I did this right
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java | 71 |
1 files changed, 51 insertions, 20 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index dcd85af99d..2b7c85ffc2 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -1,13 +1,15 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; -import com.github.technus.tectech.mechanics.constructable.IConstructable; -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.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.em_machine.GT_MetaTileEntity_EM_machine; import com.github.technus.tectech.util.CommonValues; +import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; +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 gregtech.api.util.IGT_HatchAdder; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -15,6 +17,8 @@ import net.minecraft.util.EnumChatFormatting; 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.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; /** @@ -22,26 +26,46 @@ import static net.minecraft.util.StatCollector.translateToLocal; */ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure - private static final String[][] shape = new String[][]{ - {"A010", "0 0", "1 . 1", "0 0", "A010",}, - {"23232", "32223", "22222", "32223", "23232",}, - {"12!21", "22422", "!444!", "22422", "12!21",}, - {"23232", "32223", "22222", "32223", "23232",}, - {"A010", "0 0", "1 1", "0 0", "A010",}, - }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMeta = new byte[]{4, 0, 5, 6, 9}; - private static final IHatchAdder<GT_MetaTileEntity_EM_stabilizer>[] addingMethods = adders( - GT_MetaTileEntity_EM_stabilizer::addClassicToMachineList, - GT_MetaTileEntity_EM_stabilizer::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.stabilizer.hint.0"),//1 - Classic Hatches or High Power Casing translateToLocal("gt.blockmachines.multimachine.em.stabilizer.hint.1"),//2 - Elemental Hatches or Molecular Casing }; + + private static final IStructureDefinition<GT_MetaTileEntity_EM_stabilizer> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_EM_stabilizer>builder() + .addShape("main", new String[][]{ + {" AFA ","BCBCB","FBGBF","BCBCB"," AFA "}, + {"AEEEA","CBBBC","BBDBB","CBBBC","AEEEA"}, + {"FE~EF","BBBBB","GDDDG","BBBBB","FEEEF"}, + {"AEEEA","CBBBC","BBDBB","CBBBC","AEEEA"}, + {" AFA ","BCBCB","FBGBF","BCBCB"," AFA "} + }) + .addElement('A', ofBlock(sBlockCasingsTT, 4)) + .addElement('B', ofBlock(sBlockCasingsTT, 5)) + .addElement('C', ofBlock(sBlockCasingsTT, 6)) + .addElement('D', ofBlock(sBlockCasingsTT, 9)) + .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_stabilizer::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .addElement('F', ofBlock(QuantumGlassBlock.INSTANCE, 0)) + .addElement('G', ofHatchAdderOptional(GT_MetaTileEntity_EM_stabilizer::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4)) + .build(); + +// private static final String[][] shape = new String[][]{ +// {"A010", "0 0", "1 . 1", "0 0", "A010",}, +// {"23232", "32223", "22222", "32223", "23232",}, +// {"12!21", "22422", "!444!", "22422", "12!21",}, +// {"23232", "32223", "22222", "32223", "23232",}, +// {"A010", "0 0", "1 1", "0 0", "A010",}, +// }; +// private static final Block[] blockType = new Block[]{sBlockCasingsTT, QuantumGlassBlock.INSTANCE, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; +// private static final byte[] blockMeta = new byte[]{4, 0, 5, 6, 9}; +// private static final IGT_HatchAdder<GT_MetaTileEntity_EM_stabilizer>[] addingMethods = adders( +// GT_MetaTileEntity_EM_stabilizer::addClassicToMachineList, +// GT_MetaTileEntity_EM_stabilizer::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 public GT_MetaTileEntity_EM_stabilizer(int aID, String aName, String aNameRegional) { @@ -59,7 +83,8 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); + //return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 0); + return structureCheck_EM("main", 2, 2, 0); } @Override @@ -73,7 +98,13 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + //Structure.builder(shape, blockType, blockMeta, 2, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + structureBuild_EM("main", 2, 2, 0, hintsOnly, stackSize); + } + + @Override + public IStructureDefinition<GT_MetaTileEntity_EM_stabilizer> getStructure_EM() { + return STRUCTURE_DEFINITION; } @Override |