diff options
| author | Tec <daniel112092@gmail.com> | 2018-03-10 10:27:59 +0100 |
|---|---|---|
| committer | Tec <daniel112092@gmail.com> | 2018-03-10 10:27:59 +0100 |
| commit | 506db95920cc313ebb2b6d3afffcb0ec13fcfc2c (patch) | |
| tree | 4dfcb0b4daf4ea46d6a1c6b8a992346599e85acd /src/main | |
| parent | c0fd973ba6812825160b49db0c59c08ca67eca4d (diff) | |
| download | GT5-Unofficial-506db95920cc313ebb2b6d3afffcb0ec13fcfc2c.tar.gz GT5-Unofficial-506db95920cc313ebb2b6d3afffcb0ec13fcfc2c.tar.bz2 GT5-Unofficial-506db95920cc313ebb2b6d3afffcb0ec13fcfc2c.zip | |
Add gtpp back
Diffstat (limited to 'src/main')
3 files changed, 161 insertions, 1 deletions
diff --git a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java index a977796a76..70bf8dcf4a 100644 --- a/src/main/java/com/github/technus/tectech/loader/MachineLoader.java +++ b/src/main/java/com/github/technus/tectech/loader/MachineLoader.java @@ -240,6 +240,7 @@ public class MachineLoader implements Runnable { Machine_Multi_Scanner.set(new GT_MetaTileEntity_EM_scanner(15330, "multimachine.em.scanner", "Elemental Scanner").getStackForm(1L)); Machine_Multi_Research.set(new GT_MetaTileEntity_EM_research(15331, "multimachine.em.research", "Research station").getStackForm(1L)); + Machine_Multi_DataBank.set(new GT_MetaTileEntity_EM_research(15332, "multimachine.em.databank", "Data Bank").getStackForm(1L)); Machine_Multi_Collider.set(new GT_MetaTileEntity_EM_collider(15340, "multimachine.em.collider", "Matter Collider").getStackForm(1L)); @@ -298,5 +299,6 @@ public class MachineLoader implements Runnable { GT_MetaTileEntity_Hatch_Rack.run(); GT_MetaTileEntity_EM_computer.run(); GT_MetaTileEntity_EM_research.run(); + GT_MEtaTileEntity_EM_dataBank.run(); } } diff --git a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java index 5d9823b84a..0f7bb3997e 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -42,7 +42,7 @@ public enum CustomItemList implements IItemContainer { debugBlock, Machine_Multi_Microwave, Machine_Multi_Transformer, - Machine_Multi_Computer, Machine_Multi_Switch, Machine_Multi_Research, + Machine_Multi_Computer, Machine_Multi_Switch, Machine_Multi_Research, Machine_Multi_DataBank, Machine_Multi_MatterToEM, Machine_Multi_EMToMatter, Machine_Multi_EMjunction, Machine_Multi_Scanner, Machine_Multi_EssentiaToEM, Machine_Multi_EMToEssentia, Machine_Multi_Infuser, Machine_Multi_Collider, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MEtaTileEntity_EM_dataBank.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MEtaTileEntity_EM_dataBank.java new file mode 100644 index 0000000000..fc4ff8600f --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MEtaTileEntity_EM_dataBank.java @@ -0,0 +1,158 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi; + +import com.github.technus.tectech.CommonValues; +import com.github.technus.tectech.auxiliary.Reference; +import com.github.technus.tectech.auxiliary.TecTechConfig; +import com.github.technus.tectech.thing.metaTileEntity.IConstructable; +import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_OutputDataAccess; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedTexture; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +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.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +import java.util.ArrayList; + +import static com.github.technus.tectech.Util.StructureBuilderExtreme; +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; + +public class GT_MEtaTileEntity_EM_dataBank extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + private final ArrayList<GT_MetaTileEntity_Hatch_OutputDataAccess> eStacksDataOutputs = new ArrayList<>(); + private final ArrayList<GT_MetaTileEntity_Hatch_DataAccess> eDataAccessHatches = new ArrayList<>(); + + //region Structure + private static final String[][] shape = new String[][]{ + {" "," . "," ",}, + {" "," 0 "," ",}, + {" "," "," ",}, + }; + private static final Block[] blockType = new Block[]{sBlockCasingsTT}; + private static final byte[] blockMeta = new byte[]{3}; + private static final String[] addingMethods = new String[]{"addClassicToMachineList"}; + private static final short[] casingTextures = new short[]{textureOffset+1}; + private static final Block[] blockTypeFallback = new Block[]{sBlockCasingsTT}; + private static final byte[] blockMetaFallback = new byte[]{1}; + private static final String[] description = new String[]{ + EnumChatFormatting.AQUA+"Hint Details:", + "1 - Classic/Data Hatches or Computer casing", + }; + //endregion + + public GT_MEtaTileEntity_EM_dataBank(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MEtaTileEntity_EM_dataBank(String aName) { + super(aName); + } + + public final static ResourceLocation activitySound=new ResourceLocation(Reference.MODID+":fx_hi_freq"); + + @Override + @SideOnly(Side.CLIENT) + protected ResourceLocation getActivitySound(){ + return activitySound; + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MEtaTileEntity_EM_dataBank(mName); + } + + @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1], new TT_RenderedTexture(aActive ? GT_MetaTileEntity_MultiblockBase_EM.ScreenON : GT_MetaTileEntity_MultiblockBase_EM.ScreenOFF)}; + } + return new ITexture[]{Textures.BlockIcons.casingTexturePages[texturePage][1]}; + } + + @Override + public boolean checkMachine_EM(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return structureCheck_EM(shape, blockType, blockMeta, addingMethods, casingTextures, blockTypeFallback, blockMetaFallback, 1, 1, 0); + } + + @Override + public void construct(int stackSize, boolean hintsOnly) { + StructureBuilderExtreme(shape, blockType, blockMeta,1, 1, 0, getBaseMetaTileEntity(),this,hintsOnly); + } + + @Override + public String[] getStructureDescription(int stackSize) { + return description; + } + + @Override + public boolean checkRecipe_EM(ItemStack itemStack) { + + return false; + } + + @Override + public void outputAfterRecipe_EM() { + + } + + @Override + public String[] getDescription() { + return new String[]{ + CommonValues.TEC_MARK_EM, + "Remote assembly data delivery", + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Apply directly to the forehead" + }; + } + + //NEW METHOD + public final boolean addStackDataOutputToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputDataAccess) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return eStacksDataOutputs.add((GT_MetaTileEntity_Hatch_OutputDataAccess) aMetaTileEntity); + } + return false; + } + + //NEW METHOD + public final boolean addDataAccessToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return eDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity); + } + return false; + } + + public static void run(){ + try { + adderMethodMap.put("addStackDataOutputToMachineList", GT_MEtaTileEntity_EM_dataBank.class.getMethod("addStackDataOutputToMachineList", IGregTechTileEntity.class, int.class)); + adderMethodMap.put("addDataAccessToMachineList", GT_MEtaTileEntity_EM_dataBank.class.getMethod("addDataAccessToMachineList", IGregTechTileEntity.class, int.class)); + } catch (NoSuchMethodException e) { + if (TecTechConfig.DEBUG_MODE) { + e.printStackTrace(); + } + } + } +} |
