From 7c0de38a9fe24ef60ab328e074432881ce4fbda4 Mon Sep 17 00:00:00 2001 From: Blood Asp Date: Mon, 27 Apr 2015 23:38:12 +0200 Subject: Add and fix More Bugfixes, Soldering Iron and Magic Energy Absorber --- .../common/covers/GT_Cover_ControlsWork.java | 25 +++---- .../gregtech/common/covers/GT_Cover_Shutter.java | 79 +++++++++++----------- 2 files changed, 50 insertions(+), 54 deletions(-) (limited to 'main/java/gregtech/common/covers') diff --git a/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java index 6367cf67a1..40819e8eef 100644 --- a/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java +++ b/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java @@ -12,21 +12,16 @@ /* 12: */ { /* 13: */ public int doCoverThings(byte aSide, byte aInputRedstone, int aCoverID, int aCoverVariable, ICoverable aTileEntity, long aTimer) /* 14: */ { -/* 15:13 */ if ((aTileEntity instanceof IMachineProgress)) -/* 16: */ { -/* 17:14 */ if ((aInputRedstone > 0 ? 1 : 0) == (aCoverVariable == 0 ? 1 : 0)) { -/* 18:14 */ if (aCoverVariable != 2) -/* 19: */ { -/* 20:14 */ ((IMachineProgress)aTileEntity).enableWorking(); -/* 21: */ //break label59; -/* 22: */ } -/* 23: */ } -/* 24:14 */ ((IMachineProgress)aTileEntity).disableWorking(); -/* 25: */ //label59: -/* 26:15 */ ((IMachineProgress)aTileEntity).setWorkDataValue(aInputRedstone); -/* 27: */ } -/* 28:17 */ return aCoverVariable; -/* 29: */ } + if(aTileEntity instanceof IMachineProgress) + { + if((aInputRedstone > 0) == (aCoverVariable == 0) && aCoverVariable != 2) + ((IMachineProgress)aTileEntity).enableWorking(); + else + ((IMachineProgress)aTileEntity).disableWorking(); + ((IMachineProgress)aTileEntity).setWorkDataValue(aInputRedstone); + } + return aCoverVariable; +} /* 30: */ /* 31: */ public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) /* 32: */ { diff --git a/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/main/java/gregtech/common/covers/GT_Cover_Shutter.java index f0cf70e5e5..1defd5b62a 100644 --- a/main/java/gregtech/common/covers/GT_Cover_Shutter.java +++ b/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -1,6 +1,7 @@ /* 1: */ package gregtech.common.covers; /* 2: */ /* 3: */ import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IMachineProgress; /* 4: */ import gregtech.api.util.GT_CoverBehavior; /* 5: */ import gregtech.api.util.GT_Utility; /* 6: */ import net.minecraft.entity.player.EntityPlayer; @@ -32,45 +33,45 @@ /* 32:23 */ return aCoverVariable; /* 33: */ } /* 34: */ -/* 35: */ public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) -/* 36: */ { -/* 37:28 */ return aCoverVariable % 2 == 0; -/* 38: */ } -/* 39: */ -/* 40: */ public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) -/* 41: */ { -/* 42:33 */ return aCoverVariable % 2 == 0; -/* 43: */ } -/* 44: */ -/* 45: */ public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) -/* 46: */ { -/* 47:38 */ return aCoverVariable % 2 == 0; -/* 48: */ } -/* 49: */ -/* 50: */ public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) -/* 51: */ { -/* 52:43 */ return aCoverVariable % 2 == 0; -/* 53: */ } -/* 54: */ -/* 55: */ public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) -/* 56: */ { -/* 57:48 */ return aCoverVariable % 2 == 0; -/* 58: */ } -/* 59: */ -/* 60: */ public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) -/* 61: */ { -/* 62:53 */ return aCoverVariable % 2 == 0; -/* 63: */ } -/* 64: */ -/* 65: */ public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) -/* 66: */ { -/* 67:58 */ return aCoverVariable % 2 == 0; -/* 68: */ } -/* 69: */ -/* 70: */ public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) -/* 71: */ { -/* 72:63 */ return aCoverVariable % 2 == 0; -/* 73: */ } +/* 35: */ public boolean letsRedstoneGoIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +public boolean letsRedstoneGoOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +public boolean letsEnergyIn(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +public boolean letsEnergyOut(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +public boolean letsFluidIn(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +public boolean letsFluidOut(byte aSide, int aCoverID, int aCoverVariable, Fluid aFluid, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +public boolean letsItemsIn(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 3 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} + +public boolean letsItemsOut(byte aSide, int aCoverID, int aCoverVariable, int aSlot, ICoverable aTileEntity) +{ + return aCoverVariable >= 2 ? aCoverVariable == 2 : (aTileEntity instanceof IMachineProgress) ? ((IMachineProgress)aTileEntity).isAllowedToWork() ? aCoverVariable % 2 == 0 : aCoverVariable % 2 != 0 : true; +} /* 74: */ /* 75: */ public boolean alwaysLookConnected(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) /* 76: */ { -- cgit