aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMatt <mtthw8198@gmail.com>2021-09-07 04:10:41 -0700
committerMatt <mtthw8198@gmail.com>2021-09-07 04:10:41 -0700
commitce0ceebc6bab7d0e496b6c2d64b8282dc80f8b06 (patch)
treeff4f885c42bab69cb316e182ce6dad78c99e64f2 /src/main/java
parent98cace3dadb3bfdbc2c527b29dc809bea769453e (diff)
downloadGT5-Unofficial-ce0ceebc6bab7d0e496b6c2d64b8282dc80f8b06.tar.gz
GT5-Unofficial-ce0ceebc6bab7d0e496b6c2d64b8282dc80f8b06.tar.bz2
GT5-Unofficial-ce0ceebc6bab7d0e496b6c2d64b8282dc80f8b06.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_TM_microwave.java66
1 files changed, 45 insertions, 21 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java
index 674ffe8c3e..5791a67c8a 100644
--- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java
+++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_TM_microwave.java
@@ -1,19 +1,20 @@
package com.github.technus.tectech.thing.metaTileEntity.multi;
import com.github.technus.tectech.Reference;
-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.*;
import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture;
import com.github.technus.tectech.util.CommonValues;
-import com.github.technus.tectech.util.Vec3Impl;
+import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable;
+import com.gtnewhorizon.structurelib.structure.IStructureDefinition;
+import com.gtnewhorizon.structurelib.structure.StructureDefinition;
+import com.gtnewhorizon.structurelib.util.Vec3Impl;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Utility;
+import gregtech.api.util.IGT_HatchAdder;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -30,7 +31,9 @@ import static com.github.technus.tectech.loader.MainLoader.microwaving;
import static com.github.technus.tectech.mechanics.structure.Structure.adders;
import static com.github.technus.tectech.recipe.TT_recipeAdder.nullItem;
import static com.github.technus.tectech.thing.metaTileEntity.multi.base.LedStatus.*;
+import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock;
import static gregtech.api.GregTech_API.sBlockCasings4;
+import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional;
import static net.minecraft.util.AxisAlignedBB.getBoundingBox;
import static net.minecraft.util.StatCollector.translateToLocal;
@@ -44,26 +47,40 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
//region structure
//use multi A energy inputs, use less power the longer it runs
- private static final String[][] shape = new String[][]{
- {"00000", "00000", "00.00", "0 0",},
- {"0---0", "0---0", "0---0", " 000 ",},
- {"0---0", "0---0", "0---0", " 000 ",},
- {"0---0", "0---0", "0---0", " 000 ",},
- {"00000", "00000", "00000", "0 0",},
- };
- private static final Block[] blockType = new Block[]{sBlockCasings4};
- private static final byte[] blockMeta = new byte[]{1};
-
- private static final IHatchAdder<GT_MetaTileEntity_TM_microwave>[] addingMethods = adders(
- GT_MetaTileEntity_TM_microwave::addClassicToMachineList);
- private static final short[] casingTextures = new short[]{49};
- private static final Block[] blockTypeFallback = new Block[]{sBlockCasings4};
- private static final byte[] blockMetaFallback = new byte[]{1};
private static final String[] description = new String[]{
EnumChatFormatting.AQUA + translateToLocal("tt.keyphrase.Hint_Details") + ":",
translateToLocal("gt.blockmachines.multimachine.tm.microwave.hint.0"),//1 - Classic Hatches or Clean Stainless Steel Casing
translateToLocal("gt.blockmachines.multimachine.tm.microwave.hint.1"),//Also acts like a hopper so give it an Output Bus
};
+
+ private static final IStructureDefinition<GT_MetaTileEntity_TM_microwave> STRUCTURE_DEFINITION =
+ StructureDefinition.<GT_MetaTileEntity_TM_microwave>builder()
+ .addShape("main", new String[][]{
+ {"AAAAA","A---A","A---A","A---A","AAAAA"},
+ {"AAAAA","A---A","A---A","A---A","AAAAA"},
+ {"AA~AA","A---A","A---A","A---A","AAAAA"},
+ {"ABBBA","BAAAB","BAAAB","BAAAB","ABBBA"}
+ })
+ .addElement('A', ofBlock(sBlockCasings4, 1))
+ .addElement('B', ofHatchAdderOptional(GT_MetaTileEntity_TM_microwave::addClassicToMachineList, 49, 1, sBlockCasings4, 1))
+ .build();
+
+// private static final String[][] shape = new String[][]{
+// {"00000", "00000", "00.00", "0 0",},
+// {"0---0", "0---0", "0---0", " 000 ",},
+// {"0---0", "0---0", "0---0", " 000 ",},
+// {"0---0", "0---0", "0---0", " 000 ",},
+// {"00000", "00000", "00000", "0 0",},
+// };
+// private static final Block[] blockType = new Block[]{sBlockCasings4};
+// private static final byte[] blockMeta = new byte[]{1};
+//
+// private static final IGT_HatchAdder<GT_MetaTileEntity_TM_microwave>[] addingMethods = adders(
+// GT_MetaTileEntity_TM_microwave::addClassicToMachineList);
+// private static final short[] casingTextures = new short[]{49};
+// private static final Block[] blockTypeFallback = new Block[]{sBlockCasings4};
+// private static final byte[] blockMetaFallback = new byte[]{1};
+
//endregion
//region parameters
@@ -101,7 +118,8 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
@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
@@ -249,7 +267,13 @@ public class GT_MetaTileEntity_TM_microwave extends GT_MetaTileEntity_Multiblock
@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<? extends GT_MetaTileEntity_MultiblockBase_EM> getStructure_EM() {
+ return STRUCTURE_DEFINITION;
}
@Override