diff options
author | Matt <mtthw8198@gmail.com> | 2021-09-05 14:37:21 -0700 |
---|---|---|
committer | Matt <mtthw8198@gmail.com> | 2021-09-05 14:37:21 -0700 |
commit | b18e9791588f985e593c6f680e54d30f65faf9ae (patch) | |
tree | 6ea7009dafddab30c0bb0645b940f1991adc2f50 /src/main | |
parent | f2bfd412ee8bca9066e430fe5e01e47c4848e306 (diff) | |
download | GT5-Unofficial-b18e9791588f985e593c6f680e54d30f65faf9ae.tar.gz GT5-Unofficial-b18e9791588f985e593c6f680e54d30f65faf9ae.tar.bz2 GT5-Unofficial-b18e9791588f985e593c6f680e54d30f65faf9ae.zip |
I think I did this right
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java | 60 |
1 files changed, 43 insertions, 17 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java index 82fd2df5ed..5a5c778f69 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_infuser.java @@ -3,17 +3,18 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import cofh.api.energy.IEnergyContainerItem; import com.github.technus.tectech.Reference; import com.github.technus.tectech.TecTech; -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.metaTileEntity.multi.base.GT_Container_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_GUIContainer_MultiMachineEM; import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; 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 cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.IGT_HatchAdder; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; import net.minecraft.block.Block; @@ -27,7 +28,9 @@ import static com.github.technus.tectech.loader.TecTechConfig.DEBUG_MODE; 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.GregTech_API.mEUtoRF; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; import static net.minecraft.util.StatCollector.translateToLocal; /** @@ -35,22 +38,38 @@ import static net.minecraft.util.StatCollector.translateToLocal; */ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { //region structure - private static final String[][] shape = new String[][]{ - {" ", "000", "1.1", "000", " ",}, - {" ", "010", "111", "010", " ",}, - {" ", "000", "111", "000", " ",}, - }; - private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; - private static final byte[] blockMeta = new byte[]{7, 4}; - private static final IHatchAdder<GT_MetaTileEntity_EM_infuser>[] addingMethods = adders( - GT_MetaTileEntity_EM_infuser::addClassicToMachineList); - private static final short[] casingTextures = new short[]{textureOffset}; - private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; - private static final byte[] blockMetaFallback = new byte[]{0}; private static final String[] description = new String[]{ EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":", translateToLocal("gt.blockmachines.multimachine.em.infuser.hint"),//1 - Classic Hatches or High Power Casing }; + + private static final IStructureDefinition<GT_MetaTileEntity_EM_infuser> STRUCTURE_DEFINITION = + StructureDefinition.<GT_MetaTileEntity_EM_infuser>builder() + .addShape("main", new String[][]{ + {"CCC","CCC","CCC"}, + {"BBB","BAB","BBB"}, + {"A~A","AAA","AAA"}, + {"BBB","BAB","BBB"}, + {"CCC","CCC","CCC"} + }) + .addElement('A', ofBlock(sBlockCasingsTT, 4)) + .addElement('B', ofBlock(sBlockCasingsTT, 7)) + .addElement('C', ofHatchAdderOptional(GT_MetaTileEntity_EM_infuser::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0)) + .build(); + +// private static final String[][] shape = new String[][]{ +// {" ", "000", "1.1", "000", " ",}, +// {" ", "010", "111", "010", " ",}, +// {" ", "000", "111", "000", " ",}, +// }; +// private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT}; +// private static final byte[] blockMeta = new byte[]{7, 4}; +// private static final IGT_HatchAdder<GT_MetaTileEntity_EM_infuser>[] addingMethods = adders( +// GT_MetaTileEntity_EM_infuser::addClassicToMachineList); +// private static final short[] casingTextures = new short[]{textureOffset}; +// private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; +// private static final byte[] blockMetaFallback = new byte[]{0}; + //endregion public GT_MetaTileEntity_EM_infuser(int aID, String aName, String aNameRegional) { @@ -114,7 +133,8 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, 0); + //return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 2, 0); + return structureCheck_EM("main", 1, 2, 0); } @Override @@ -185,7 +205,13 @@ public class GT_MetaTileEntity_EM_infuser extends GT_MetaTileEntity_MultiblockBa @Override public void construct(ItemStack stackSize, boolean hintsOnly) { - Structure.builder(shape, blockType, blockMeta, 1, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + //Structure.builder(shape, blockType, blockMeta, 1, 2, 0, getBaseMetaTileEntity(), getExtendedFacing(), hintsOnly); + structureBuild_EM("main", 1, 2, 0, hintsOnly, stackSize); + } + + @Override + public IStructureDefinition<GT_MetaTileEntity_EM_infuser> getStructure_EM() { + return STRUCTURE_DEFINITION; } @Override |