diff options
| author | Technus <daniel112092@gmail.com> | 2017-03-21 11:00:59 +0100 |
|---|---|---|
| committer | Technus <daniel112092@gmail.com> | 2017-03-21 11:00:59 +0100 |
| commit | 73bd4c1cc06267ff3574230e5076c654ea300429 (patch) | |
| tree | db30f918f4945e679b929c0cf6843cfc05941ed6 | |
| parent | 637632dcaccff55ed9f0631b95654dfe2b3abaed (diff) | |
| download | GT5-Unofficial-73bd4c1cc06267ff3574230e5076c654ea300429.tar.gz GT5-Unofficial-73bd4c1cc06267ff3574230e5076c654ea300429.tar.bz2 GT5-Unofficial-73bd4c1cc06267ff3574230e5076c654ea300429.zip | |
Initial work on computation multiblocks, implementing cables and I/O's
36 files changed, 582 insertions, 169 deletions
diff --git a/build.properties b/build.properties index f77bc158d5..86db1215b7 100644 --- a/build.properties +++ b/build.properties @@ -11,4 +11,4 @@ cofhcore.version=[1.7.10]3.0.3-303-dev cofhlib.cf=2246/918 cofhlib.version=[1.7.10]1.0.3-175-dev -yamcore.version=0.5.70
\ No newline at end of file +yamcore.version=0.5.73
\ No newline at end of file diff --git a/src/main/java/com/github/technus/tectech/TecTech.java b/src/main/java/com/github/technus/tectech/TecTech.java index a2879c16d8..b373ef3ec9 100644 --- a/src/main/java/com/github/technus/tectech/TecTech.java +++ b/src/main/java/com/github/technus/tectech/TecTech.java @@ -29,7 +29,7 @@ import net.minecraft.item.ItemStack; import java.util.List; @Mod(modid = Reference.MODID, name = Reference.NAME, version = Reference.VERSION, dependencies = "required-after:Forge@[10.13.4.1614,);" - + "required-after:YAMCore@[0.5.70,);" + "required-after:gregtech;" + "after:CoFHCore") + + "required-after:YAMCore@[0.5.73,);" + "required-after:gregtech;" + "after:CoFHCore") public class TecTech { @SidedProxy(clientSide = Reference.CLIENTSIDE, serverSide = Reference.SERVERSIDE) diff --git a/src/main/java/com/github/technus/tectech/loader/GT_Loader_Machines.java b/src/main/java/com/github/technus/tectech/loader/GT_Loader_Machines.java index 21824b4579..d149e37da5 100644 --- a/src/main/java/com/github/technus/tectech/loader/GT_Loader_Machines.java +++ b/src/main/java/com/github/technus/tectech/loader/GT_Loader_Machines.java @@ -2,6 +2,7 @@ package com.github.technus.tectech.loader; import com.github.technus.tectech.thing.metaTileEntity.hatch.*; import com.github.technus.tectech.thing.metaTileEntity.multi.*; +import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_EM; import static com.github.technus.tectech.thing.CustomItemList.*; @@ -175,10 +176,10 @@ public class GT_Loader_Machines implements Runnable { // =================================================================================================== Machine_Multi_Transformer.set(new GT_MetaTileEntity_EM_transformer(12160, "multimachine.em.transformer", "Active Transformer").getStackForm(1L)); - Machine_Multi_Infuser.set(new GT_MetaTileEntity_EM_infuser(12161,"multimachine.em.infuser","Energy infuser").getStackForm(1)); + Machine_Multi_Infuser.set(new GT_MetaTileEntity_EM_infuser(12161,"multimachine.em.infuser","Energy Infuser").getStackForm(1)); Machine_Multi_MatterToEM.set(new GT_MetaTileEntity_EM_quantizer(12162, "multimachine.em.mattertoem", "Matter Quantizer").getStackForm(1L)); Machine_Multi_EMToMatter.set(new GT_MetaTileEntity_EM_dequantizer(12163, "multimachine.em.emtomatter", "Matter Dequantizer").getStackForm(1L)); - Machine_Multi_EMjunction.set(new GT_MetaTileEntity_EM_junction(12164, "multimachine.em.junction", "Matter junction").getStackForm(1L)); + Machine_Multi_EMjunction.set(new GT_MetaTileEntity_EM_junction(12164, "multimachine.em.junction", "Matter Junction").getStackForm(1L)); Machine_Multi_EMmachine.set(new GT_MetaTileEntity_EM_machine(12165, "multimachine.em.processing", "Quantum Processing Machine").getStackForm(1L)); Machine_Multi_EMCrafter.set(new GT_MetaTileEntity_EM_crafter(12166, "multimachine.em.crafter", "Matter Assembler").getStackForm(1L)); Machine_Multi_Collider.set(new GT_MetaTileEntity_EM_collider(12167, "multimachine.em.collider", "Matter Collider").getStackForm(1L)); @@ -186,18 +187,21 @@ public class GT_Loader_Machines implements Runnable { Machine_Multi_Wormhole.set(new GT_MetaTileEntity_EM_wormhole(12169, "multimachine.em.wormhole", "Wormhole").getStackForm(1L)); Machine_Multi_Stabilizer.set(new GT_MetaTileEntity_EM_stabilizer(12170, "multimachine.em.stabilizer", "Elemental Stabilizer").getStackForm(1L)); Machine_Multi_Scanner.set(new GT_MetaTileEntity_EM_scanner(12171, "multimachine.em.scanner", "Elemental Scanner").getStackForm(1L)); - Machine_Multi_Computer.set(new GT_MetaTileEntity_EM_computer(12172, "multimachine.em.computer", "Quantum computer").getStackForm(1L)); + Machine_Multi_Computer.set(new GT_MetaTileEntity_EM_computer(12172, "multimachine.em.computer", "Quantum Computer").getStackForm(1L)); // =================================================================================================== // Hatches EM // =================================================================================================== - Parametrizer_Hatch.set(new GT_MetaTileEntity_Hatch_Param(12180, "hatch.param.tier.06", "Parametrizer for machines", 6).getStackForm(1L)); - Uncertainty_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(12181, "hatch.certain.tier.06", "Uncertainty resolver", 6).getStackForm(1L)); - UncertaintyX_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(12182, "hatch.certain.tier.10", "Uncertainty resolver X", 10).getStackForm(1L)); + Parametrizer_Hatch.set(new GT_MetaTileEntity_Hatch_Param(12180, "hatch.param.tier.08", "Parametrizer", 8).getStackForm(1L)); + Uncertainty_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(12181, "hatch.certain.tier.08", "Uncertainty Resolver", 10).getStackForm(1L)); + UncertaintyX_Hatch.set(new GT_MetaTileEntity_Hatch_Uncertainty(12182, "hatch.certain.tier.10", "Uncertainty Resolver X", 10).getStackForm(1L)); + dataIn_Hatch.set(new GT_MetaTileEntity_Hatch_InputData(12183, "hatch.datain.tier.08", "Optical Host Connector", 8).getStackForm(1L)); + dataOut_Hatch.set(new GT_MetaTileEntity_Hatch_OutputData(12184, "hatch.dataout.tier.08", "Optical Server Connector", 8).getStackForm(1L)); // =================================================================================================== // EM pipe // =================================================================================================== - EMpipe.set(new GT_MetaTileEntity_Pipe_EM(12199, "pipe.elementalmatter", "Quantum tunnel").getStackForm(1L)); + EMpipe.set(new GT_MetaTileEntity_Pipe_EM(12200, "pipe.elementalmatter", "Quantum Tunnel").getStackForm(1L)); + DATApipe.set(new GT_MetaTileEntity_Pipe_Data(12201, "pipe.datastream", "Optical Fiber Cable").getStackForm(1L)); } } 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 e40b478325..0de21e30a0 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -11,7 +11,7 @@ import net.minecraft.item.ItemStack; import static gregtech.api.enums.GT_Values.W; public enum CustomItemList implements IItemContainer { - EMpipe, + EMpipe,DATApipe, eM_dynamomulti4_UV, eM_dynamomulti16_UV, eM_dynamomulti64_UV, eM_dynamomulti4_UHV, eM_dynamomulti16_UHV, eM_dynamomulti64_UHV, eM_dynamomulti4_UEV, eM_dynamomulti16_UEV, eM_dynamomulti64_UEV, @@ -27,7 +27,7 @@ public enum CustomItemList implements IItemContainer { eM_in_UV, eM_in_UHV, eM_in_UEV, eM_in_UIV, eM_in_UMV, eM_in_UXV, eM_out_UV, eM_out_UHV, eM_out_UEV, eM_out_UIV, eM_out_UMV, eM_out_UXV, eM_muffler_UV, eM_muffler_UHV, eM_muffler_UEV, eM_muffler_UIV, eM_muffler_UMV, eM_muffler_UXV, - Parametrizer_Hatch, Uncertainty_Hatch, UncertaintyX_Hatch, + Parametrizer_Hatch, Uncertainty_Hatch, UncertaintyX_Hatch, dataIn_Hatch, dataOut_Hatch, eM_Casing, eM_Field, eM_Field_Casing, eM_Coil, eM_Tele, eM_TimeSpaceWarp, debugBlock, Machine_Multi_MatterToEM, Machine_Multi_EMToMatter, Machine_Multi_EMjunction, diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java new file mode 100644 index 0000000000..ea4c7f0e2b --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_DataConnector.java @@ -0,0 +1,152 @@ +package com.github.technus.tectech.thing.metaTileEntity.hatch; + +import com.github.technus.tectech.elementalMatter.commonValues; +import com.github.technus.tectech.thing.machineTT; +import com.github.technus.tectech.thing.metaTileEntity.pipe.iConnectsToDataPipe; +import gregtech.api.enums.Dyes; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fluids.FluidStack; + +import static com.github.technus.tectech.elementalMatter.commonValues.moveAt; +import static gregtech.api.enums.Dyes.MACHINE_METAL; + +/** + * Created by danie_000 on 11.12.2016. + */ +public abstract class GT_MetaTileEntity_Hatch_DataConnector extends GT_MetaTileEntity_Hatch implements iConnectsToDataPipe, machineTT { + private static Textures.BlockIcons.CustomIcon EM_D_SIDES; + private static Textures.BlockIcons.CustomIcon EM_D_ACTIVE; + private static Textures.BlockIcons.CustomIcon EM_D_CONN; + + public short id = -1; + public int data = 0; + public byte timeout=3; + + public GT_MetaTileEntity_Hatch_DataConnector(int aID, String aName, String aNameRegional, int aTier, String descr) { + super(aID, aName, aNameRegional, aTier, 0, descr); + } + + public GT_MetaTileEntity_Hatch_DataConnector(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, 0, aDescription, aTextures); + } + + @Override + public void registerIcons(IIconRegister aBlockIconRegister) { + super.registerIcons(aBlockIconRegister); + EM_D_ACTIVE = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_EM_D_ACTIVE"); + EM_D_SIDES = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_EM_D_SIDES"); + EM_D_CONN = new Textures.BlockIcons.CustomIcon("iconsets/EM_DATA_CONN"); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_D_ACTIVE, Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), new GT_RenderedTexture(EM_D_CONN)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_D_SIDES, Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), new GT_RenderedTexture(EM_D_CONN)}; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setShort("eID", id); + aNBT.setInteger("eDATA",data); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + id = aNBT.getShort("eID"); + data=aNBT.getInteger("eDATA"); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (aBaseMetaTileEntity.isServerSide()) { + if (moveAt == aTick % 20) { + if(timeout>0) timeout--; + else data=0; + moveAround(aBaseMetaTileEntity); + getBaseMetaTileEntity().setActive(data>0); + } + } + } + + public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isLiquidInput(byte aSide) { + return false; + } + + @Override + public boolean isFluidInputAllowed(FluidStack aFluid) { + return false; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean isValidSlot(int aIndex) { + return false; + } + + @Override + public boolean isGivingInformation() { + return true; + } + + @Override + public String[] getInfoData() { + if (id > 0) return new String[]{ + "ID: "+ EnumChatFormatting.AQUA +id, + "Computation: "+ EnumChatFormatting.AQUA +data + }; + return new String[]{"Computation: "+ EnumChatFormatting.AQUA +data}; + } + + @Override + public String[] getDescription() { + return new String[]{ + commonValues.tecMark, + mDescription, + "High speed fibre optics connector.", + EnumChatFormatting.AQUA + "Must be painted to work" + }; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/GT_MetaTileEntity_Hatch_ElementalContainer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java index 6fd6eaa403..212d14586e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/GT_MetaTileEntity_Hatch_ElementalContainer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_ElementalContainer.java @@ -1,4 +1,4 @@ -package com.github.technus.tectech.thing.metaTileEntity; +package com.github.technus.tectech.thing.metaTileEntity.hatch; import com.github.technus.tectech.TecTech; import com.github.technus.tectech.elementalMatter.classes.cElementalInstanceStackTree; @@ -6,7 +6,6 @@ import com.github.technus.tectech.elementalMatter.classes.tElementalException; import com.github.technus.tectech.elementalMatter.commonValues; import com.github.technus.tectech.elementalMatter.interfaces.iElementalInstanceContainer; import com.github.technus.tectech.thing.machineTT; -import com.github.technus.tectech.thing.metaTileEntity.hatch.GT_MetaTileEntity_Hatch_MufflerElemental; import com.github.technus.tectech.thing.metaTileEntity.pipe.iConnectsToEMpipe; import gregtech.api.enums.Dyes; import gregtech.api.enums.Textures; @@ -32,6 +31,7 @@ import static gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Mult public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_MetaTileEntity_Hatch implements iElementalInstanceContainer, iConnectsToEMpipe, machineTT { private static Textures.BlockIcons.CustomIcon EM_T_SIDES; private static Textures.BlockIcons.CustomIcon EM_T_ACTIVE; + private static Textures.BlockIcons.CustomIcon EM_T_CONN; protected cElementalInstanceStackTree content = new cElementalInstanceStackTree(); //float lifeTimeMult=1f; @@ -53,16 +53,17 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta super.registerIcons(aBlockIconRegister); EM_T_ACTIVE = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_EM_T_ACTIVE"); EM_T_SIDES = new Textures.BlockIcons.CustomIcon("iconsets/OVERLAY_EM_T_SIDES"); + EM_T_CONN = new Textures.BlockIcons.CustomIcon("iconsets/EM_PIPE_CONN"); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_T_ACTIVE, Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_T_ACTIVE, Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), new GT_RenderedTexture(EM_T_CONN)}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_T_SIDES, Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)}; + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(EM_T_SIDES, Dyes.getModulation(getBaseMetaTileEntity().getColorization(), MACHINE_METAL.getRGBA())), new GT_RenderedTexture(EM_T_CONN)}; } @Override @@ -102,12 +103,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta if (overflowMatter <= 0) { deathDelay = 3; } else { - if (deathDelay == 2) { - if (TecTech.ModConfig.BOOM_ENABLE && TecTech.Rnd.nextInt(10) == 0) - aBaseMetaTileEntity.setOnFire(); - else - TecTech.proxy.broadcast("Container0 FIRE! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord()); - } else if (deathDelay == 1) { + if (deathDelay == 1) { IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide(aBaseMetaTileEntity.getBackFacing()); if (tGTTileEntity == null || !(tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_MufflerElemental)) tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSide((byte) 0); @@ -116,16 +112,18 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta if (tGTTileEntity != null && (tGTTileEntity.getMetaTileEntity() instanceof GT_MetaTileEntity_Hatch_MufflerElemental)) { GT_MetaTileEntity_Hatch_MufflerElemental aMetaTileEntity = (GT_MetaTileEntity_Hatch_MufflerElemental) tGTTileEntity.getMetaTileEntity(); aMetaTileEntity.overflowMatter += overflowMatter; + overflowMatter = 0F; + deathDelay=3;//needed in some cases like repetitive failures. Should be 4 since there is -- at end but meh... if (aMetaTileEntity.overflowMatter > aMetaTileEntity.overflowMax) { if (TecTech.ModConfig.BOOM_ENABLE) tGTTileEntity.doExplosion(V[14]); else TecTech.proxy.broadcast("Container1 BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord()); - } else overflowMatter = 0F; + } } } else if (deathDelay < 1) { if (TecTech.ModConfig.BOOM_ENABLE) getBaseMetaTileEntity().doExplosion(V[14]); else - TecTech.proxy.broadcast("Container2 BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord()); + TecTech.proxy.broadcast("Container0 BOOM! " + getBaseMetaTileEntity().getXCoord() + " " + getBaseMetaTileEntity().getYCoord() + " " + getBaseMetaTileEntity().getZCoord()); } deathDelay--; } @@ -136,8 +134,7 @@ public abstract class GT_MetaTileEntity_Hatch_ElementalContainer extends GT_Meta } } - public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) { - } + public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) {} @Override public cElementalInstanceStackTree getContainerHandler() { diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java new file mode 100644 index 0000000000..121f91b76a --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputData.java @@ -0,0 +1,43 @@ +package com.github.technus.tectech.thing.metaTileEntity.hatch; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; + +/** + * Created by danie_000 on 27.10.2016. + */ +public class GT_MetaTileEntity_Hatch_InputData extends GT_MetaTileEntity_Hatch_DataConnector { + public GT_MetaTileEntity_Hatch_InputData(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Data Input for Multiblocks"); + } + + public GT_MetaTileEntity_Hatch_InputData(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_InputData(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean isInputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isOutputFacing(byte aSide) { + return false; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean canConnect(byte side) { + return isInputFacing(side); + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java index 4cb7f22284..c0b825d12b 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_InputElemental.java @@ -1,6 +1,5 @@ package com.github.technus.tectech.thing.metaTileEntity.hatch; -import com.github.technus.tectech.thing.metaTileEntity.GT_MetaTileEntity_Hatch_ElementalContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java new file mode 100644 index 0000000000..5bab844128 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputData.java @@ -0,0 +1,71 @@ +package com.github.technus.tectech.thing.metaTileEntity.hatch; + +import com.github.technus.tectech.thing.metaTileEntity.pipe.GT_MetaTileEntity_Pipe_Data; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.util.GT_Utility; + +/** + * Created by danie_000 on 27.10.2016. + */ +public class GT_MetaTileEntity_Hatch_OutputData extends GT_MetaTileEntity_Hatch_DataConnector { + public GT_MetaTileEntity_Hatch_OutputData(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, "Data Output for Multiblocks"); + } + + public GT_MetaTileEntity_Hatch_OutputData(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_OutputData(mName, mTier, mDescription, mTextures); + } + + @Override + public boolean isInputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public boolean isOutputFacing(byte aSide) { + return false; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean canConnect(byte side) { + return isInputFacing(side); + } + + @Override + public void moveAround(IGregTechTileEntity aBaseMetaTileEntity) {//TODO + byte color = getBaseMetaTileEntity().getColorization(); + if (color < 0) return; + byte front = aBaseMetaTileEntity.getFrontFacing(); + byte opposite = GT_Utility.getOppositeSide(getBaseMetaTileEntity().getFrontFacing()); + for (byte dist = 1; dist < 16; dist++) { + IGregTechTileEntity tGTTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityAtSideAndDistance(front, dist); + if (tGTTileEntity != null && tGTTileEntity.getColorization() == color) { + IMetaTileEntity aMetaTileEntity = tGTTileEntity.getMetaTileEntity(); + if (aMetaTileEntity != null) { + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputData && + opposite == aMetaTileEntity.getBaseMetaTileEntity().getFrontFacing()) { + return; + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Data) { + if (((GT_MetaTileEntity_Pipe_Data) aMetaTileEntity).connectionCount > 2) return; + } else return; + } else return; + } else return; + } + //trace optics all the way to the end, no branching splitting etc. + //Coloring requirement! + //set data to match this and timout to 3 + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java index c8e65b6451..221e00e514 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/hatch/GT_MetaTileEntity_Hatch_OutputElemental.java +++ b/ |
