From 2925808690e683ec4c659dc91338cfebeb37c6a2 Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 9 Oct 2017 23:24:33 +0200 Subject: Add structure to EM Machine. --- .../multi/GT_MetaTileEntity_EM_machine.java | 52 +++++++++++++++++----- 1 file changed, 42 insertions(+), 10 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java index f380fcebda..533807984b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_machine.java @@ -1,27 +1,48 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.thing.block.QuantumGlassBlock; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.common.blocks.GT_Block_Machines; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import static com.github.technus.tectech.Util.StructureBuilder; +import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; +import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; + /** * Created by danie_000 on 17.12.2016. */ -public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBase_EM { +public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { public final static String machine="EM Machinery"; - + + //region structure private static final String[][] shape = new String[][]{ - {"",//left to right top - "", - ""},//front - {},//behind front - {} //behind + {"B0","A ","0 - 0","A ","B0",}, + {"A000","00000","00.00","00000","A000",}, + {"A121","1C1","2C2","1C1","A121",}, + {"A131","1C1","3C3","1C1","A131",}, + {"A121","1C1","2C2","1C1","A121",}, + {"A000","00000","00A00","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 String[] addingMethods = new String[]{"addClassicToMachineList", "addElementalToMachineList", "addElementalInputToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset, textureOffset + 4, textureOffset + 4}; + private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT, sBlockCasingsTT, sBlockCasingsTT}; + private static final byte[] blockMetaFallback = new byte[]{0, 4, 4}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic Hatches or High Power Casing", + "2 - Elemental Hatches or Molecular Casing", + "2 - Elemental Input Hatch", }; - private static final Block[] blockType = new Block[]{}; - private static final byte[] blockMeta = new byte[]{}; + //endregion public GT_MetaTileEntity_EM_machine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); @@ -37,7 +58,18 @@ public class GT_MetaTileEntity_EM_machine extends GT_MetaTileEntity_MultiblockBa @Override public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { - return false; + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 2, 2, 1) + && eInputHatches.size()==1 && iGregTechTileEntity.getBlockAtSideAndDistance(iGregTechTileEntity.getBackFacing(),5) instanceof GT_Block_Machines; + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilder(shape, blockType, blockMeta,2, 2, 1, getBaseMetaTileEntity(),hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; } @Override -- cgit