diff options
18 files changed, 133 insertions, 14 deletions
diff --git a/src/main/java/com/github/technus/tectech/Util.java b/src/main/java/com/github/technus/tectech/Util.java new file mode 100644 index 0000000000..87df06e7d9 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/Util.java @@ -0,0 +1,21 @@ +package com.github.technus.tectech; + +/** + * Created by Tec on 21.03.2017. + */ +public class Util { + public static String intToString(int number, int groupSize) { + StringBuilder result = new StringBuilder(); + + for(int i = 31; i >= 0 ; i--) { + int mask = 1 << i; + result.append((number & mask) != 0 ? "1" : "0"); + + if (i % groupSize == 0) + result.append(" "); + } + result.replace(result.length() - 1, result.length(), ""); + + return result.toString(); + } +} 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 d149e37da5..e3a1349490 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 @@ -188,6 +188,7 @@ public class GT_Loader_Machines implements Runnable { 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_Switch.set(new GT_MetaTileEntity_EM_switch(12173, "multimachine.em.switch", "Network Switch with QoS").getStackForm(1L)); // =================================================================================================== // Hatches EM @@ -195,8 +196,8 @@ public class GT_Loader_Machines implements Runnable { 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)); + dataIn_Hatch.set(new GT_MetaTileEntity_Hatch_InputData(12183, "hatch.datain.tier.08", "Optical Slave Connector", 8).getStackForm(1L)); + dataOut_Hatch.set(new GT_MetaTileEntity_Hatch_OutputData(12184, "hatch.dataout.tier.08", "Optical Master Connector", 8).getStackForm(1L)); // =================================================================================================== // EM pipe 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 0de21e30a0..a64f219f59 100644 --- a/src/main/java/com/github/technus/tectech/thing/CustomItemList.java +++ b/src/main/java/com/github/technus/tectech/thing/CustomItemList.java @@ -28,10 +28,10 @@ public enum CustomItemList implements IItemContainer { 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, dataIn_Hatch, dataOut_Hatch, - eM_Casing, eM_Field, eM_Field_Casing, eM_Coil, eM_Tele, eM_TimeSpaceWarp, + eM_Casing, eM_Field, eM_Field_Casing, eM_Coil, eM_Tele, eM_TimeSpaceWarp, eM_computer, eM_computerAdv, eM_computerVent, debugBlock, Machine_Multi_MatterToEM, Machine_Multi_EMToMatter, Machine_Multi_EMjunction, - Machine_Multi_Transformer, Machine_Multi_Computer, Machine_Multi_Infuser, + Machine_Multi_Transformer, Machine_Multi_Computer, Machine_Multi_Infuser, Machine_Multi_Switch, Machine_Multi_BHG, Machine_Multi_EMmachine, Machine_Multi_Stabilizer, Machine_Multi_Collider, Machine_Multi_Wormhole, Machine_Multi_EMCrafter, Machine_Multi_Scanner; diff --git a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java index ffd798f487..d369b681ed 100644 --- a/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java +++ b/src/main/java/com/github/technus/tectech/thing/casing/GT_Block_CasingsTT.java @@ -23,7 +23,7 @@ import java.util.List; public class GT_Block_CasingsTT extends GT_Block_Casings_Abstract { - private static IIcon eM3, eM4, eM5, eM6, eM7, eM8, eM9; + private static IIcon eM0s,eM1s,eM2s,eM0,eM1,eM2,eM3, eM4, eM5, eM6, eM7, eM8, eM9; private static IIcon debug[] = new IIcon[6]; public GT_Block_CasingsTT() { @@ -33,6 +33,9 @@ public class GT_Block_CasingsTT Textures.BlockIcons.CASING_BLOCKS[(i + 96)] = new GT_CopiedBlockTexture(this, 6, i); /*IMPORTANT for block recoloring*/ } + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".0.name", "Computer Casing");//adding + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".1.name", "Advanced Computer Casing");//adding + GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".2.name", "Computer Heat Vent");//adding GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".3.name", "Molecular Containment Casing");//adding GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".4.name", "Containment Field Generator");//adding GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".5.name", "Containment Field Generator Casing");//adding @@ -43,6 +46,9 @@ public class GT_Block_CasingsTT GT_LanguageManager.addStringLocalization(getUnlocalizedName() + ".9.name", "Debug Sides");//adding + CustomItemList.eM_computer.set(new ItemStack(this, 1, 0));//adding + CustomItemList.eM_computerAdv.set(new ItemStack(this, 1, 1));//adding + CustomItemList.eM_computerVent.set(new ItemStack(this, 1, 2));//adding CustomItemList.eM_Casing.set(new ItemStack(this, 1, 3));//adding CustomItemList.eM_Field.set(new ItemStack(this, 1, 4));//adding CustomItemList.eM_Field_Casing.set(new ItemStack(this, 1, 5));//adding @@ -56,6 +62,12 @@ public class GT_Block_CasingsTT @Override public void registerBlockIcons(IIconRegister aIconRegister) { //super.registerBlockIcons(aIconRegister); + eM0s = aIconRegister.registerIcon("gregtech:iconsets/EM_PC"); + eM1s = aIconRegister.registerIcon("gregtech:iconsets/EM_PC_ADV"); + eM2s = aIconRegister.registerIcon("gregtech:iconsets/EM_PC_VENT"); + eM0 = aIconRegister.registerIcon("gregtech:iconsets/EM_PC_NONSIDE"); + eM1 = aIconRegister.registerIcon("gregtech:iconsets/EM_PC_ADV_NONSIDE"); + eM2 = aIconRegister.registerIcon("gregtech:iconsets/EM_PC_VENT_NONSIDE"); eM3 = aIconRegister.registerIcon("gregtech:iconsets/EM_CASING"); eM4 = aIconRegister.registerIcon("gregtech:iconsets/EM_FIELD"); eM5 = aIconRegister.registerIcon("gregtech:iconsets/EM_FIELD_CASING"); @@ -75,6 +87,15 @@ public class GT_Block_CasingsTT public IIcon getIcon(int aSide, int aMeta) { switch (aMeta) { + case 0: + if (aSide < 2) return eM0; + return eM0s; + case 1: + if (aSide < 2) return eM1; + return eM1s; + case 2: + if (aSide < 2) return eM2; + return eM2s; case 3: return eM3; case 4: @@ -107,7 +128,7 @@ public class GT_Block_CasingsTT @Override public void getSubBlocks(Item aItem, CreativeTabs par2CreativeTabs, List aList) { - for (int i = 3; i <= 9; i++) { + for (int i = 0; i <= 9; i++) { aList.add(new ItemStack(aItem, 1, i)); } } 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 index 5bab844128..cb970e10be 100644 --- 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 @@ -57,6 +57,8 @@ public class GT_MetaTileEntity_Hatch_OutputData extends GT_MetaTileEntity_Hatch_ if (aMetaTileEntity != null) { if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputData && opposite == aMetaTileEntity.getBaseMetaTileEntity().getFrontFacing()) { + ((GT_MetaTileEntity_Hatch_InputData) aMetaTileEntity).timeout=3; + ((GT_MetaTileEntity_Hatch_InputData) aMetaTileEntity).data=data; return; } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Pipe_Data) { if (((GT_MetaTileEntity_Pipe_Data) aMetaTileEntity).connectionCount > 2) return; diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java index 822b7aed1c..df0c333dea 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_computer.java @@ -1,8 +1,13 @@ package com.github.technus.tectech.thing.metaTileEntity.multi; +import com.github.technus.tectech.TecTech; +import com.github.technus.tectech.Util; import com.github.technus.tectech.elementalMatter.commonValues; +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.objects.GT_RenderedTexture; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; @@ -35,6 +40,14 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB } @Override + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[97], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[97]}; + } + + @Override public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { return false; } @@ -43,8 +56,8 @@ public class GT_MetaTileEntity_EM_computer extends GT_MetaTileEntity_MultiblockB public String[] getDescription() { return new String[]{ commonValues.tecMark, - "Processing quantum matter since...", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "the time u started using it." + Util.intToString(TecTech.Rnd.nextInt(),8), + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "You need it to process the number above" }; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java index 38f6e9e4a8..ea1e49575d 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_dequantizer.java @@ -58,8 +58,8 @@ public class GT_MetaTileEntity_EM_dequantizer extends GT_MetaTileEntity_Multiblo public String[] getDescription() { return new String[]{ commonValues.tecMark, - "Transform quantum form back to regular one...", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "but why?" + "Transform quantum form back to...", + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "regular one, but why?" }; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java index 52cc4abcb2..01d656980e 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_stabilizer.java @@ -43,8 +43,8 @@ public class GT_MetaTileEntity_EM_stabilizer extends GT_MetaTileEntity_Multibloc public String[] getDescription() { return new String[]{ commonValues.tecMark, - "Processing quantum matter since...", - EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "the time u started using it." + "Alters time to stabilize matter", + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Wbbly wobbly timey wimey, stuff." }; } } diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java new file mode 100644 index 0000000000..ea38a216c0 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_switch.java @@ -0,0 +1,61 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi; + +import com.github.technus.tectech.elementalMatter.commonValues; +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.objects.GT_RenderedTexture; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +/** + * Created by danie_000 on 17.12.2016. + */ +public class GT_MetaTileEntity_EM_switch extends GT_MetaTileEntity_MultiblockBase_EM { + private static final String[][] shape = new String[][]{ + {"",//left to right top + "", + ""},//front + {},//behind front + {} //behind + }; + private static final int[] casingRequirements = new int[]{}; + private static final Block[] blockType = new Block[]{}; + private static final byte[] blockMeta = new byte[]{}; + + public GT_MetaTileEntity_EM_switch(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GT_MetaTileEntity_EM_switch(String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_EM_switch(this.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.CASING_BLOCKS[96], new GT_RenderedTexture(aActive ? ScreenON : ScreenOFF)}; + } + return new ITexture[]{Textures.BlockIcons.CASING_BLOCKS[96]}; + } + + @Override + public boolean checkMachine(IGregTechTileEntity iGregTechTileEntity, ItemStack itemStack) { + return false; + } + + @Override + public String[] getDescription() { + return new String[]{ + commonValues.tecMark, + "User controller computation power routing", + EnumChatFormatting.AQUA.toString() + EnumChatFormatting.BOLD + "Quality of service is a must" + }; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java index 9fdd922c83..6346351859 100644 --- a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_MultiblockBase_EM.java @@ -46,8 +46,8 @@ public abstract class GT_MetaTileEntity_MultiblockBase_EM extends GT_MetaTileEnt public final static ItemStack[] nothingI = new ItemStack[0]; public final static FluidStack[] nothingF = new FluidStack[0]; - private static Textures.BlockIcons.CustomIcon ScreenOFF; - private static Textures.BlockIcons.CustomIcon ScreenON; + protected static Textures.BlockIcons.CustomIcon ScreenOFF; + protected static Textures.BlockIcons.CustomIcon ScreenON; public ArrayList<GT_MetaTileEntity_Hatch_InputElemental> eInputHatches = new ArrayList<>(); public ArrayList<GT_MetaTileEntity_Hatch_OutputElemental> eOutputHatches = new ArrayList<>(); diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC.png Binary files differnew file mode 100644 index 0000000000..df6c3a0688 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_ADV.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_ADV.png Binary files differnew file mode 100644 index 0000000000..8c3c5b621e --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_ADV.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_ADV_NONSIDE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_ADV_NONSIDE.png Binary files differnew file mode 100644 index 0000000000..03d8bad1cd --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_ADV_NONSIDE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_NONSIDE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_NONSIDE.png Binary files differnew file mode 100644 index 0000000000..aa27ecdd29 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_NONSIDE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_VENT.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_VENT.png Binary files differnew file mode 100644 index 0000000000..ee6a7079e2 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_VENT.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_VENT_NONSIDE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_VENT_NONSIDE.png Binary files differnew file mode 100644 index 0000000000..c1a1d44471 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/EM_PC_VENT_NONSIDE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_EM_D_ACTIVE.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_EM_D_ACTIVE.png Binary files differindex abfcf2b8f0..1752cc6eb1 100644 --- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_EM_D_ACTIVE.png +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_EM_D_ACTIVE.png diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_EM_D_SIDES.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_EM_D_SIDES.png Binary files differindex b50c1b7707..453391fdf6 100644 --- a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_EM_D_SIDES.png +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_EM_D_SIDES.png |