aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/covers
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common/covers')
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Arm.java2
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java3
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java3
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Drain.java3
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java3
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java11
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java3
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java3
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Pump.java5
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java3
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java8
-rw-r--r--src/main/java/gregtech/common/covers/GT_Cover_Shutter.java3
13 files changed, 32 insertions, 23 deletions
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java
index 4ee6e1beb1..7206bedccc 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Arm.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Arm.java
@@ -21,7 +21,7 @@ public class GT_Cover_Arm
return aCoverVariable;
}
TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide);
- aTileEntity.decreaseStoredEnergyUnits(1L, true);
+ //aTileEntity.decreaseStoredEnergyUnits(1L, true);
if (aTileEntity.getUniversalEnergyCapacity() >= 128L) {
if (aTileEntity.isUniversalEnergyStored(256L)) {
aTileEntity.decreaseStoredEnergyUnits(4 * GT_Utility.moveOneItemStackIntoSlot(aCoverVariable > 0 ? aTileEntity : tTileEntity, aCoverVariable > 0 ? tTileEntity : aTileEntity, aCoverVariable > 0 ? aSide : GT_Utility.getOppositeSide(aSide), Math.abs(aCoverVariable) - 1, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1), true);
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java
index 9bbdc3a726..65ba326625 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java
@@ -53,7 +53,8 @@ public class GT_Cover_ControlsWork
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 3;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 3;
+ if(aCoverVariable <0){aCoverVariable = 2;}
if (aCoverVariable == 0) {
GT_Utility.sendChatToPlayer(aPlayer, "Normal");
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java
index 58025a0659..8467506d97 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java
@@ -23,7 +23,7 @@ public class GT_Cover_Conveyor
}
}
TileEntity tTileEntity = aTileEntity.getTileEntityAtSide(aSide);
- aTileEntity.decreaseStoredEnergyUnits(1L, true);
+ //aTileEntity.decreaseStoredEnergyUnits(1L, true);
if (((aCoverVariable % 2 != 1) || (aSide != 1)) && ((aCoverVariable % 2 != 0) || (aSide != 0)) && (aTileEntity.getUniversalEnergyCapacity() >= 128L)) {
if (aTileEntity.isUniversalEnergyStored(256L)) {
aTileEntity.decreaseStoredEnergyUnits(4 * GT_Utility.moveOneItemStack(aCoverVariable % 2 == 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? aTileEntity : tTileEntity, aCoverVariable % 2 != 0 ? GT_Utility.getOppositeSide(aSide) : aSide, aCoverVariable % 2 == 0 ? GT_Utility.getOppositeSide(aSide) : aSide, null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1), true);
@@ -35,7 +35,8 @@ public class GT_Cover_Conveyor
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 12;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12;
+ if(aCoverVariable <0){aCoverVariable = 11;}
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Export"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java
index 3ae4116193..08acc6faa1 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java
@@ -28,7 +28,8 @@ public class GT_Cover_DoesWork
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 4;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 4;
+ if(aCoverVariable <0){aCoverVariable = 3;}
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); break;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java
index 7c1aa03d5a..5aaef6fc2f 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java
@@ -58,7 +58,8 @@ public class GT_Cover_Drain
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 6;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 6;
+ if(aCoverVariable <0){aCoverVariable = 5;}
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java
index ce3dc28f26..41a24767a7 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java
@@ -91,7 +91,8 @@ public class GT_Cover_EUMeter
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 12;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12;
+ if(aCoverVariable <0){aCoverVariable = 11;}
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal Universal Storage"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Universal Storage"); break;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
index 56845d2b68..b1f92da27b 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
@@ -28,16 +28,15 @@ public class GT_Cover_ItemMeter
}
}
tAll /= 14;
- if (tAll > 0) {
- aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable != 1 ? 0 : tFull > 0 ? (byte) (tFull / tAll + 1) : (byte) (15 - (tFull > 0 ? tFull / tAll + 1 : 0)));
- } else {
- aTileEntity.setOutputRedstoneSignal(aSide, (byte) (aCoverVariable != 1 ? 0 : 15));
- }
+ if(tAll > 0)
+ aTileEntity.setOutputRedstoneSignal(aSide, aCoverVariable == 1 ? (byte)(15 - (tFull <= 0 ? 0 : tFull / tAll + 1)) : tFull <= 0 ? 0 : (byte)(tFull / tAll + 1));
+ else
+ aTileEntity.setOutputRedstoneSignal(aSide, ((byte)(aCoverVariable == 1 ? 15 : 0)));
return aCoverVariable;
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % (2 + aTileEntity.getSizeInventory());
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % (2 + aTileEntity.getSizeInventory());
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); break;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java
index 2c60daa679..83c37e35a4 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java
@@ -44,7 +44,8 @@ public class GT_Cover_NeedMaintainance extends GT_CoverBehavior {
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 10;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 10;
+ if(aCoverVariable <0){aCoverVariable = 9;}
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintenance Needed"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintenance Needed(inverted)"); break;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java
index ee2ce60bd4..9c61f4feee 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java
@@ -53,7 +53,8 @@ public class GT_Cover_PlayerDetector extends GT_CoverBehavior {
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 3;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 3;
+ if(aCoverVariable <0){aCoverVariable = 2;}
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Emit if any Player is close"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Emit if you are close"); break;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java
index fa96d36f52..f93d6c0db7 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java
@@ -27,7 +27,7 @@ public class GT_Cover_Pump
if ((aTileEntity instanceof IFluidHandler)) {
IFluidHandler tTank2 = aTileEntity.getITankContainerAtSide(aSide);
if (tTank2 != null) {
- aTileEntity.decreaseStoredEnergyUnits(GT_Utility.getTier(this.mTransferRate), true);
+ //aTileEntity.decreaseStoredEnergyUnits(GT_Utility.getTier(this.mTransferRate), true);
IFluidHandler tTank1 = (IFluidHandler) aTileEntity;
if (aCoverVariable % 2 == 0) {
FluidStack tLiquid = tTank1.drain(ForgeDirection.getOrientation(aSide), this.mTransferRate, false);
@@ -68,7 +68,8 @@ public class GT_Cover_Pump
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 12;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 12;
+ if(aCoverVariable <0){aCoverVariable = 11;}
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Export"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java
index 52b6748022..5e5a5579a6 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java
@@ -18,7 +18,8 @@ public class GT_Cover_RedstoneConductor
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 7;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 7;
+ if(aCoverVariable <0){aCoverVariable = 6;}
switch (aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Conducts strongest Input"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from bottom Input"); break;
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java
index 107d452f46..f632561994 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneTransmitterInternal.java
@@ -14,11 +14,11 @@ public class GT_Cover_RedstoneTransmitterInternal
return true;
}
- public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
- return true;
- }
-
public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
return 1;
}
+
+ public boolean manipulatesSidedRedstoneOutput(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return true;
+ }
}
diff --git a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java
index 296969d0d8..d4fa9ba1d5 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java
@@ -14,7 +14,8 @@ public class GT_Cover_Shutter
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + 1) % 4;
+ aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % 4;
+ if(aCoverVariable <0){aCoverVariable = 3;}
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Open if work enabled"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Open if work disabled"); break;