aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMatt <mtthw8198@gmail.com>2021-09-05 13:13:30 -0700
committerMatt <mtthw8198@gmail.com>2021-09-05 13:13:30 -0700
commit18e1af912c3d22011f0d23291df7ed164fa9e840 (patch)
treec80d4200fd0718391e385d54b9e0ef6629e865a8 /src/main/java
parentecf780470664ceaa4f39d0a9cbd6623d58dff3cb (diff)
downloadGT5-Unofficial-18e1af912c3d22011f0d23291df7ed164fa9e840.tar.gz
GT5-Unofficial-18e1af912c3d22011f0d23291df7ed164fa9e840.tar.bz2
GT5-Unofficial-18e1af912c3d22011f0d23291df7ed164fa9e840.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/GT_MetaTileEntity_EM_decay.java77
1 files changed, 53 insertions, 24 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
index d534b41fec..e49a4980ed 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_decay.java
@@ -1,10 +1,7 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
-import com.github.technus.tectech.mechanics.constructable.IConstructable;
import com.github.technus.tectech.mechanics.elementalMatter.core.cElementalInstanceStackMap;
import com.github.technus.tectech.mechanics.elementalMatter.core.stacks.cElementalInstanceStack;
-import com.github.technus.tectech.mechanics.structure.adders.IHatchAdder;
-import com.github.technus.tectech.mechanics.structure.Structure;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_EnergyMulti;
import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_InputElemental;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM;
@@ -13,6 +10,9 @@ import com.github.technus.tectech.thing.metaTileEntity.multi.base.IStatusFunctio
import com.github.technus.tectech.thing.metaTileEntity.multi.base.Parameters;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
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.enums.Textures;
@@ -21,6 +21,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
+import gregtech.api.util.IGT_HatchAdder;
import ic2.core.init.MainConfig;
import ic2.core.util.ConfigUtil;
import net.minecraft.block.Block;
@@ -33,12 +34,15 @@ import org.apache.commons.lang3.reflect.FieldUtils;
import static com.github.technus.tectech.mechanics.elementalMatter.core.transformations.bTransformationInfo.AVOGADRO_CONSTANT;
import static com.github.technus.tectech.mechanics.structure.Structure.adders;
+import static com.github.technus.tectech.mechanics.structure.Structure.builder;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset;
import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage;
import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_OK;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.STATUS_TOO_LOW;
import static com.github.technus.tectech.util.CommonValues.VN;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.StatCollector.translateToLocal;
import static net.minecraft.util.StatCollector.translateToLocalFormatted;
@@ -58,30 +62,48 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
//endregion
//region structure
- private static final String[][] shape = new String[][]{
- {"0C0", "A ", "A . ", "A ", "0C0",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
- {"01110", "12221", "12221", "12221", "01110",},
- {"01310", "12221", "32223", "12221", "01310",},
- {"01110", "12221", "12221", "12221", "01110",},
- {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
- {"00000", "00000", "00000", "00000", "00000",},
- {"0C0", "A ", "A ", "A ", "0C0",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
- private static final byte[] blockMeta = new byte[]{4, 5, 8, 6};
- private static final IHatchAdder<GT_MetaTileEntity_EM_decay>[] addingMethods = adders(
- GT_MetaTileEntity_EM_decay::addClassicToMachineList,
- GT_MetaTileEntity_EM_decay::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.decay.hint.0"),//1 - Classic Hatches or High Power Casing
translateToLocal("gt.blockmachines.multimachine.em.decay.hint.1"),//2 - Elemental Hatches or Molecular Casing
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_EM_decay> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_EM_decay>builder()
+ .addShape("main", new String[][]{
+ {"A A","AAAAA","A A","ABBBA","ABCBA","ABBBA","A A","AAAAA","A A"},
+ {" FFF ","AAAAA"," EEE ","BDDDB","BDDDB","BDDDB"," EEE ","AAAAA"," FFF "},
+ {" F~F ","AAAAA"," EAE ","BDDDB","CDDDC","BDDDB"," EAE ","AAAAA"," FFF "},
+ {" FFF ","AAAAA"," EEE ","BDDDB","BDDDB","BDDDB"," EEE ","AAAAA"," FFF "},
+ {"A A","AAAAA","A A","ABBBA","ABCBA","ABBBA","A A","AAAAA","A A"}
+ })
+ .addElement('A', ofBlock(sBlockCasingsTT, 4))
+ .addElement('B', ofBlock(sBlockCasingsTT, 5))
+ .addElement('C', ofBlock(sBlockCasingsTT, 6))
+ .addElement('D', ofBlock(sBlockCasingsTT, 8))
+ .addElement('E', ofHatchAdderOptional(GT_MetaTileEntity_EM_decay::addElementalToMachineList, textureOffset + 4, 2, sBlockCasingsTT, 4))
+ .addElement('F', ofHatchAdderOptional(GT_MetaTileEntity_EM_decay::addClassicToMachineList, textureOffset, 1, sBlockCasingsTT, 0))
+ .build();
+// private static final String[][] shape = new String[][]{
+// {"0C0", "A ", "A . ", "A ", "0C0",},
+// {"00000", "00000", "00000", "00000", "00000",},
+// {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
+// {"01110", "12221", "12221", "12221", "01110",},
+// {"01310", "12221", "32223", "12221", "01310",},
+// {"01110", "12221", "12221", "12221", "01110",},
+// {"0C0", "A!!!", "A!0!", "A!!!", "0C0",},
+// {"00000", "00000", "00000", "00000", "00000",},
+// {"0C0", "A ", "A ", "A ", "0C0",},
+// };
+// private static final Block[] blockType = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT};
+// private static final byte[] blockMeta = new byte[]{4, 5, 8, 6};
+// private static final IGT_HatchAdder<GT_MetaTileEntity_EM_decay>[] addingMethods = adders(
+// GT_MetaTileEntity_EM_decay::addClassicToMachineList,
+// GT_MetaTileEntity_EM_decay::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
@@ -110,7 +132,8 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
@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
@@ -248,7 +271,13 @@ public class GT_MetaTileEntity_EM_decay extends GT_MetaTileEntity_MultiblockBase
@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_decay> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@Override