diff options
12 files changed, 282 insertions, 72 deletions
diff --git a/src/main/java/gregtech/api/enums/ItemList.java b/src/main/java/gregtech/api/enums/ItemList.java index edb7713a22..ed3aea00c4 100644 --- a/src/main/java/gregtech/api/enums/ItemList.java +++ b/src/main/java/gregtech/api/enums/ItemList.java @@ -571,7 +571,7 @@ public enum ItemList implements IItemContainer { Hatch_Output_ULV, Hatch_Output_LV, Hatch_Output_MV, Hatch_Output_HV, Hatch_Output_EV, Hatch_Output_IV, Hatch_Output_LuV, Hatch_Output_ZPM, Hatch_Output_UV, Hatch_Output_MAX, Hatch_Output_Bus_ULV, Hatch_Output_Bus_LV, Hatch_Output_Bus_MV, Hatch_Output_Bus_HV, Hatch_Output_Bus_EV, Hatch_Output_Bus_IV, Hatch_Output_Bus_LuV, Hatch_Output_Bus_ZPM, Hatch_Output_Bus_UV, Hatch_Output_Bus_MAX, Hatch_Muffler_LV, Hatch_Muffler_MV, Hatch_Muffler_HV, Hatch_Muffler_EV, Hatch_Muffler_IV, Hatch_Muffler_LuV, Hatch_Muffler_ZPM, Hatch_Muffler_UV, Hatch_Muffler_MAX, - Hatch_Maintenance, + Hatch_Maintenance, Hatch_DataAccess_EV, Hatch_DataAccess_LuV, Battery_Buffer_1by1_ULV, Battery_Buffer_1by1_LV, Battery_Buffer_1by1_MV, Battery_Buffer_1by1_HV, Battery_Buffer_1by1_EV, Battery_Buffer_1by1_IV, Battery_Buffer_1by1_LuV, Battery_Buffer_1by1_ZPM, Battery_Buffer_1by1_UV, Battery_Buffer_1by1_MAX, Battery_Buffer_2by2_ULV, Battery_Buffer_2by2_LV, Battery_Buffer_2by2_MV, Battery_Buffer_2by2_HV, Battery_Buffer_2by2_EV, Battery_Buffer_2by2_IV, Battery_Buffer_2by2_LuV, Battery_Buffer_2by2_ZPM, Battery_Buffer_2by2_UV, Battery_Buffer_2by2_MAX, diff --git a/src/main/java/gregtech/api/enums/Textures.java b/src/main/java/gregtech/api/enums/Textures.java index 12e67afc99..c42db4f2d7 100644 --- a/src/main/java/gregtech/api/enums/Textures.java +++ b/src/main/java/gregtech/api/enums/Textures.java @@ -69,7 +69,7 @@ public class Textures { OVERLAY_LOCKER_002, OVERLAY_LOCKER_003, OVERLAY_LOCKER_004, OVERLAY_LOCKER_005, OVERLAY_LOCKER_006, OVERLAY_LOCKER_007, OVERLAY_LOCKER_008, OVERLAY_LOCKER_009, OVERLAY_LOCKER_010, OVERLAY_LOCKER_011, OVERLAY_LOCKER_012, OVERLAY_LOCKER_013, OVERLAY_LENS, OVERLAY_PIPE, OVERLAY_PIPE_IN, OVERLAY_PIPE_OUT, OVERLAY_MUFFLER, OVERLAY_CONTROLLER, OVERLAY_ACTIVITYDETECTOR, OVERLAY_ENERGYDETECTOR, OVERLAY_FLUIDDETECTOR, OVERLAY_ITEMDETECTOR, OVERLAY_FUSION1, OVERLAY_FUSION2, OVERLAY_FUSION3, OVERLAY_SCREEN, OVERLAY_QTANK, OVERLAY_QCHEST, OVERLAY_SHUTTER, - OVERLAY_CLOSET, OVERLAY_DUCTTAPE, OVERLAY_MAINTENANCE, OVERLAY_CONVEYOR, OVERLAY_PUMP, OVERLAY_ARM, OVERLAY_DRAIN, OVERLAY_CRAFTING, OVERLAY_ENERGY_IN, OVERLAY_ENERGY_OUT, + OVERLAY_CLOSET, OVERLAY_DUCTTAPE, OVERLAY_MAINTENANCE, OVERLAY_DATA_ACCESS, OVERLAY_CONVEYOR, OVERLAY_PUMP, OVERLAY_ARM, OVERLAY_DRAIN, OVERLAY_CRAFTING, OVERLAY_ENERGY_IN, OVERLAY_ENERGY_OUT, OVERLAY_ENERGY_IN_MULTI, OVERLAY_ENERGY_OUT_MULTI, OVERLAY_FRONT_LARGE_BOILER, OVERLAY_FRONT_LARGE_BOILER_ACTIVE, OVERLAY_FRONT_VACUUM_FREEZER, OVERLAY_FRONT_VACUUM_FREEZER_ACTIVE, OVERLAY_FRONT_MULTI_SMELTER, OVERLAY_FRONT_MULTI_SMELTER_ACTIVE, OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE, OVERLAY_FRONT_ELECTRIC_BLAST_FURNACE_ACTIVE, OVERLAY_FRONT_IMPLOSION_COMPRESSOR, OVERLAY_FRONT_IMPLOSION_COMPRESSOR_ACTIVE, OVERLAY_TOP_POTIONBREWER, OVERLAY_TOP_REPLICATOR, OVERLAY_TOP_MASSFAB, OVERLAY_TOP_STEAM_HAMMER, OVERLAY_TOP_STEAM_FURNACE, OVERLAY_TOP_STEAM_ALLOY_SMELTER, diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java index 29cc403c71..15b23634c4 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_1by1.java @@ -14,6 +14,11 @@ public class GT_GUIContainer_1by1 extends GT_GUIContainerMetaTile_Machine { mName = aName; } + public GT_GUIContainer_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) { + super(new GT_Container_1by1(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "1by1.png"); + mName = aName; + } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRendererObj.drawString(mName, 8, 4, 4210752); diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java index 50653132ce..acf9d54c15 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_2by2.java @@ -14,6 +14,11 @@ public class GT_GUIContainer_2by2 extends GT_GUIContainerMetaTile_Machine { mName = aName; } + public GT_GUIContainer_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) { + super(new GT_Container_2by2(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "2by2.png"); + mName = aName; + } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRendererObj.drawString(mName, 8, 4, 4210752); diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java index de12be9e92..2c95e415d9 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_3by3.java @@ -14,6 +14,11 @@ public class GT_GUIContainer_3by3 extends GT_GUIContainerMetaTile_Machine { mName = aName; } + public GT_GUIContainer_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) { + super(new GT_Container_3by3(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "3by3.png"); + mName = aName; + } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRendererObj.drawString(mName, 8, 4, 4210752); diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java index dd536f41a7..0e94990a99 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_4by4.java @@ -14,6 +14,11 @@ public class GT_GUIContainer_4by4 extends GT_GUIContainerMetaTile_Machine { mName = aName; } + public GT_GUIContainer_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) { + super(new GT_Container_4by4(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "4by4.png"); + mName = aName; + } + @Override protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRendererObj.drawString(mName, 8, 4, 4210752); diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java new file mode 100644 index 0000000000..2a766b0501 --- /dev/null +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java @@ -0,0 +1,99 @@ +package gregtech.api.metatileentity.implementations; + +import gregtech.api.enums.Textures; +import gregtech.api.gui.*; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + +public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch { + public GT_MetaTileEntity_Hatch_DataAccess(int aID, String aName, String aNameRegional, int aTier) { + super(aID, aName, aNameRegional, aTier, 16, "Data Access for Multiblocks"); + } + + public GT_MetaTileEntity_Hatch_DataAccess(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aTier == 4 ? 4 : 16, aDescription, aTextures); + } + + public GT_MetaTileEntity_Hatch_DataAccess(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aTier == 4 ? 4 : 16, aDescription, aTextures); + } + + @Override + public ITexture[] getTexturesActive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_DATA_ACCESS)}; + } + + @Override + public ITexture[] getTexturesInactive(ITexture aBaseTexture) { + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_DATA_ACCESS)}; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isValidSlot(int aIndex) { + return true; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Hatch_DataAccess(mName, mTier, mDescriptionArray, mTextures); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) return true; + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + switch (mTier) { + case 4: + return new GT_Container_2by2(aPlayerInventory, aBaseMetaTileEntity); + default: + return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity); + } + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + switch (mTier) { + case 4: + return new GT_GUIContainer_2by2(aPlayerInventory, aBaseMetaTileEntity, "Data Access Hatch", "DataAccess"); + case 6: + return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Data Access Hatch", "DataAccess"); + default: + return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Data Access Hatch", "DataAccess"); + } + } + + @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; + } +}
\ No newline at end of file diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java index 19adad356a..851d9e9950 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_AssemblyLine.java @@ -1,5 +1,6 @@ package gregtech.common.tileentities.machines.multi; +import java.util.ArrayList; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -8,6 +9,8 @@ import gregtech.api.gui.GT_GUIContainer_MultiMachine; 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 gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Recipe; @@ -20,6 +23,9 @@ import net.minecraftforge.fluids.FluidStack; public class GT_MetaTileEntity_AssemblyLine extends GT_MetaTileEntity_MultiBlockBase { + + public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<GT_MetaTileEntity_Hatch_DataAccess>(); + public GT_MetaTileEntity_AssemblyLine(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); } @@ -35,13 +41,15 @@ public class GT_MetaTileEntity_AssemblyLine public String[] getDescription() { return new String[]{"Assembling Line", "Size: 3x(5-16)x4, variable length", - "Bottom: Solid Steel Machine Casing(or Maintenance or Input Hatch),", - "Input Bus(Last Output Bus), Steel Machine Casing", - "Middle: Reinforced Glass, Assembling Line Casing, Reinforced Glass", - "UpMiddle: Grate Machine Casing, Assembler Machine Casing,", - "Grate Machine Casing(or Controller)", - "Top: Solid Steel Casing(or Energy Hatch)", - "Up to 16 repeating slices, last is Output Bus"}; + "Bottom: Steel Machine Casing(or Maintenance or Input Hatch),", + "Input Bus (Last Output Bus), Steel Machine Casing", + "Middle: Reinforced Glass, Assembly Line, Reinforced Glass", + "UpMiddle: Grate Machine Casing,", + " Assembler Machine Casing,", + " Grate Machine Casing (or Controller or Data Access Hatch)", + "Top: Steel Casing(or Energy Hatch)", + "Up to 16 repeating slices, last is Output Bus", + "Optional 1x Data Access Hatch next to the Controller"}; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { @@ -68,55 +76,78 @@ public class GT_MetaTileEntity_AssemblyLine } public boolean checkRecipe(ItemStack aStack) { - if(GT_Values.D1)System.out.println("Start ALine recipe check"); - if (!GT_Utility.isStackValid(mInventory[1]) || !ItemList.Tool_DataStick.isStackEqual(mInventory[1], false, true)) - return false; - if(GT_Values.D1)System.out.println("Stick accepted"); + if(GT_Values.D1)System.out.println("Start ALine recipe check"); + ArrayList<ItemStack> tDataStickList = getDataItems(2); + if (tDataStickList.size() == 0) return false; + if(GT_Values.D1)System.out.println("Stick accepted, " + tDataStickList.size() + " Data Sticks found"); - NBTTagCompound tTag = mInventory[1].getTagCompound(); - if (tTag == null) return false; ItemStack tStack[] = new ItemStack[15]; - for (int i = 0; i < 15; i++) { - if (!tTag.hasKey("" + i)) continue; - if (mInputBusses.get(i) == null) return false; - tStack[i] = GT_Utility.loadItem(tTag, "" + i); - if (tStack[i] == null) continue; - if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName()); - ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); - if (!GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) || tStack[i].stackSize > stackInSlot.stackSize) { - if(GT_Values.D1)System.out.println(i +" not accepted"); - return false; - } - if(GT_Values.D1)System.out.println(i+" accepted"); - } - if(GT_Values.D1)System.out.println("All Items done, start fluid check"); FluidStack[] tFluids = new FluidStack[4]; - for (int i = 0; i < 4; i++) { - if (!tTag.hasKey("f" + i)) continue; - tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i); - if (tFluids[i] == null) continue; - if(GT_Values.D1)System.out.println("Fluid "+i+" "+tFluids[i].getUnlocalizedName()); - if (mInputHatches.get(i) == null) return false; - FluidStack fluidInHatch = mInputHatches.get(i).mFluid; - if (fluidInHatch == null || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) { - if(GT_Values.D1)System.out.println(i+" not accepted"); - return false; + boolean recipeNA = false; + boolean findRecipe = false; + for (ItemStack tDataStick : tDataStickList){ + recipeNA = false; + NBTTagCompound tTag = tDataStick.getTagCompound(); + if (tTag == null) continue; + for (int i = 0; i < 15; i++) { + if (!tTag.hasKey("" + i)) continue; + if (mInputBusses.get(i) == null) { + recipeNA = true; + break; + } + tStack[i] = GT_Utility.loadItem(tTag, "" + i); + if (tStack[i] == null) continue; + if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName()); + ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); + if (!GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) || tStack[i].stackSize > stackInSlot.stackSize) { + if(GT_Values.D1)System.out.println(i +" not accepted"); + recipeNA = true; + break; + } + if(GT_Values.D1)System.out.println(i+" accepted"); } - if(GT_Values.D1)System.out.println(i+" accepted"); + if (recipeNA) continue; + + if(GT_Values.D1)System.out.println("All Items done, start fluid check"); + for (int i = 0; i < 4; i++) { + if (!tTag.hasKey("f" + i)) continue; + tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i); + if (tFluids[i] == null) continue; + if(GT_Values.D1)System.out.println("Fluid "+i+" "+tFluids[i].getUnlocalizedName()); + if (mInputHatches.get(i) == null) { + recipeNA = true; + break; + } + FluidStack fluidInHatch = mInputHatches.get(i).mFluid; + if (fluidInHatch == null || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) { + if(GT_Values.D1)System.out.println(i+" not accepted"); + recipeNA = true; + break; + } + if(GT_Values.D1)System.out.println(i+" accepted"); + } + if (recipeNA) continue; + + if(GT_Values.D1)System.out.println("Input accepted, check other values"); + if (!tTag.hasKey("output")) continue; + mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")}; + if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0])) + continue; + + if (!tTag.hasKey("time")) continue; + mMaxProgresstime = tTag.getInteger("time"); + if (mMaxProgresstime <= 0) continue; + + if (!tTag.hasKey("eu")) continue; + mEUt = tTag.getInteger("eu"); + + if(GT_Values.D1)System.out.println("Find avaiable recipe"); + findRecipe = true; + break; } - if(GT_Values.D1)System.out.println("Input accepted, check other values"); - if (!tTag.hasKey("output")) return false; - mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")}; - if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0])) - return false; - - if (!tTag.hasKey("time")) return false; - mMaxProgresstime = tTag.getInteger("time"); - if (mMaxProgresstime <= 0) return false; - - if (!tTag.hasKey("eu")) return false; - mEUt = tTag.getInteger("eu"); - if(GT_Values.D1)System.out.println("All checked start consuming inputs"); + if (!findRecipe) return false; + + if(GT_Values.D1)System.out.println("All checked start consuming inputs"); for (int i = 0; i < 15; i++) { if (tStack[i] == null) continue; ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); @@ -130,18 +161,26 @@ public class GT_MetaTileEntity_AssemblyLine mInputHatches.get(i).mFluid = null; } } - if(GT_Values.D1)System.out.println("Check overclock"); + if(GT_Values.D1)System.out.println("Check overclock"); byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage())); this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); this.mEfficiencyIncrease = 10000; - calculateOverclockedNessMulti(mEUt, mMaxProgresstime, 1, getMaxInputVoltage()); - //In case recipe is too OP for that machine - if (mMaxProgresstime == Integer.MAX_VALUE - 1 && mEUt == Integer.MAX_VALUE - 1) - return false; - this.mEUt = this.mEUt > 0 ? -this.mEUt : this.mEUt;//makes it use power... + if (mEUt <= 16) { + this.mEUt = (mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (mMaxProgresstime / (1 << tTier - 1)); + } else { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = -this.mEUt; + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); updateSlots(); - if(GT_Values.D1)System.out.println("Recipe sucessfull"); + if(GT_Values.D1)System.out.println("Recipe sucessfull"); return true; } @@ -159,13 +198,16 @@ public class GT_MetaTileEntity_AssemblyLine for (int r = 0; r <= 16; r++) { int i = r * xDir; + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, 0, i); if (i != 0 && !(aBaseMetaTileEntity.getBlockOffset(0, 0, i) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(0, 0, i) == 10)) { - return false; + if(r == 1 && !addDataAccessToMachineList(tTileEntity, 16)){ + return false; + } } if (!aBaseMetaTileEntity.getBlockOffset(0, -1, i).getUnlocalizedName().equals("blockAlloyGlass")) { return false; } - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i); + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(0, -2, i); if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))) { if (aBaseMetaTileEntity.getBlockOffset(0, -2, i) != GregTech_API.sBlockCasings2) { return false; @@ -216,13 +258,16 @@ public class GT_MetaTileEntity_AssemblyLine for (int r = 0; r <= 16; r++) { int i = r * -zDir; + IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, 0, 0); if (i != 0 && !(aBaseMetaTileEntity.getBlockOffset(i, 0, 0) == GregTech_API.sBlockCasings3 && aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0) == 10)) { - return false; + if(r == 1 && !addDataAccessToMachineList(tTileEntity, 16)){ + return false; + } } if (!aBaseMetaTileEntity.getBlockOffset(i, -1, 0).getUnlocalizedName().equals("blockAlloyGlass")) { return false; } - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0); + tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(i, -2, 0); if ((!addMaintenanceToMachineList(tTileEntity, 16)) && (!addInputToMachineList(tTileEntity, 16))) { if (aBaseMetaTileEntity.getBlockOffset(i, -2, 0) != GregTech_API.sBlockCasings2) { return false; @@ -273,6 +318,47 @@ public class GT_MetaTileEntity_AssemblyLine return false; } + /** + * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb + */ + private boolean isCorrectDataItem(ItemStack aStack, int state){ + if ((state & 1) != 0 && ItemList.Circuit_Integrated.isStackEqual(aStack, false, true)) return true; + if ((state & 2) != 0 && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) return true; + if ((state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) return true; + return false; + } + + /** + * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb + */ + public ArrayList<ItemStack> getDataItems(int state) { + ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); + if (GT_Utility.isStackValid(mInventory[1]) && isCorrectDataItem(mInventory[1], state)) { + rList.add(mInventory[1]); + } + for (GT_MetaTileEntity_Hatch_DataAccess tHatch : mDataAccessHatches) { + if (isValidMetaTileEntity(tHatch)) { + for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null + && isCorrectDataItem(tHatch.getBaseMetaTileEntity().getStackInSlot(i), state)) + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + } + return rList; + } + + public 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).mMachineBlock = (byte) aBaseCasingIndex; + return mDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity); + } + return false; + } + public int getMaxEfficiency(ItemStack aStack) { return 10000; } @@ -288,4 +374,4 @@ public class GT_MetaTileEntity_AssemblyLine public boolean explodesOnComponentBreak(ItemStack aStack) { return false; } -} +}
\ No newline at end of file diff --git a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java index c4db94d544..6f4c21943c 100644 --- a/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java +++ b/src/main/java/gregtech/loaders/preload/GT_Loader_MetaTileEntities.java @@ -366,6 +366,11 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI GT_ModHandler.addCraftingRecipe(ItemList.Hatch_Maintenance.get(1L, new Object[0]), bitsd, new Object[]{"dwx", "hMc", "fsr", 'M', ItemList.Hull_LV}); ItemList.Hatch_AutoMaintenance.set(new GT_MetaTileEntity_Hatch_Maintenance(111, "hatch.maintenance.auto", "Auto Maintenance Hatch", 6, true).getStackForm(1L)); + ItemList.Hatch_DataAccess_EV.set(new GT_MetaTileEntity_Hatch_DataAccess(131, "hatch.dataaccess", "Data Access Hatch", 4).getStackForm(1L)); + ItemList.Hatch_DataAccess_LuV.set(new GT_MetaTileEntity_Hatch_DataAccess(132, "hatch.dataaccess", "Advanced Data Access Hatch", 6).getStackForm(1L)); + + GT_ModHandler.addCraftingRecipe(ItemList.Hatch_DataAccess_EV.get(1L, new Object[0]), bitsd, new Object[]{"COC", "OMO", "COC", 'M', ItemList.Hull_EV, 'O', ItemList.Tool_DataStick , 'C' ,OrePrefixes.circuit.get(Materials.Elite)}); + GT_ModHandler.addCraftingRecipe(ItemList.Hatch_DataAccess_LuV.get(1L, new Object[0]), bitsd, new Object[]{"COC", "OMO", "COC", 'M', ItemList.Hull_LuV, 'O', ItemList.Tool_DataOrb , 'C' ,OrePrefixes.circuit.get(Materials.Ultimate)}); GT_ModHandler.addCraftingRecipe(ItemList.Hatch_AutoMaintenance.get(1L, new Object[0]), bitsd, new Object[]{"CHC", "AMA", "CHC", 'M', ItemList.Hull_LuV,'H',ItemList.Hatch_Maintenance,'A',ItemList.Robot_Arm_LuV,'C',OrePrefixes.circuit.get(Materials.Ultimate)}); @@ -1291,13 +1296,13 @@ public class GT_Loader_MetaTileEntities implements Runnable {//TODO CHECK CIRCUI ItemList.Machine_IV_LightningRod.set(new GT_MetaTileEntity_LightningRod(1176, "basicgenerator.lightningrod.05", "Lightning Rod III", 5).getStackForm(1)); GT_ModHandler.addCraftingRecipe(ItemList.Machine_IV_LightningRod.get(1L, new Object[0]), bitsd, new Object[]{"LTL", "TMT", "LTL", 'M', ItemList.Hull_UV, 'L', ItemList.ZPM2, 'T', ItemList.Transformer_MAX_UV}); - ItemList.Machine_Multi_LargeChemicalReactor.set(new GT_MetaTileEntity_LargeChemicalReactor(1169, "multimachine.chemicalreactor", "Large Chemical Reactor").getStackForm(1)); - GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_LargeChemicalReactor.get(1L, new Object[0]), bitsd, new Object[]{"CRC", "PMP", "CBC", - 'C', OrePrefixes.circuit.get(Materials.Advanced), - 'R', OrePrefixes.rotor.get(Materials.StainlessSteel), - 'P', OrePrefixes.pipeLarge.get(Materials.Polytetrafluoroethylene), - 'M', ItemList.Electric_Motor_HV, - 'B', ItemList.Hull_HV}); + ItemList.Machine_Multi_LargeChemicalReactor.set(new GT_MetaTileEntity_LargeChemicalReactor(1169, "multimachine.chemicalreactor", "Large Chemical Reactor").getStackForm(1)); + GT_ModHandler.addCraftingRecipe(ItemList.Machine_Multi_LargeChemicalReactor.get(1L, new Object[0]), bitsd, new Object[]{"CRC", "PMP", "CBC", + 'C', OrePrefixes.circuit.get(Materials.Advanced), + 'R', OrePrefixes.rotor.get(Materials.StainlessSteel), + 'P', OrePrefixes.pipeLarge.get(Materials.Polytetrafluoroethylene), + 'M', ItemList.Electric_Motor_HV, + 'B', ItemList.Hull_HV}); } private static void run4() { diff --git a/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_DATA_ACCESS.png b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_DATA_ACCESS.png Binary files differnew file mode 100644 index 0000000000..4fe71fe547 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/blocks/iconsets/OVERLAY_DATA_ACCESS.png diff --git a/src/main/resources/assets/gregtech/textures/gui/DataAccess2by2.png b/src/main/resources/assets/gregtech/textures/gui/DataAccess2by2.png Binary files differnew file mode 100644 index 0000000000..99cf426016 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/gui/DataAccess2by2.png diff --git a/src/main/resources/assets/gregtech/textures/gui/DataAccess4by4.png b/src/main/resources/assets/gregtech/textures/gui/DataAccess4by4.png Binary files differnew file mode 100644 index 0000000000..8755bacc85 --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/gui/DataAccess4by4.png |