aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/covers
diff options
context:
space:
mode:
authorDream-Master <dream-master@gmx.net>2016-06-21 19:32:31 +0200
committerDream-Master <dream-master@gmx.net>2016-06-21 19:32:31 +0200
commitfafe1bcc8823158382ed9d45c1e1fc42e02fa9c5 (patch)
tree1768cb06f91170eeb7cfd76ca9904507b702d734 /src/main/java/gregtech/common/covers
parent4f1900142313bf92a82f48fc146bd8c806734d7a (diff)
downloadGT5-Unofficial-fafe1bcc8823158382ed9d45c1e1fc42e02fa9c5.tar.gz
GT5-Unofficial-fafe1bcc8823158382ed9d45c1e1fc42e02fa9c5.tar.bz2
GT5-Unofficial-fafe1bcc8823158382ed9d45c1e1fc42e02fa9c5.zip
reverse commit
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, 23 insertions, 32 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 7206bedccc..4ee6e1beb1 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 65ba326625..9bbdc3a726 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_ControlsWork.java
@@ -53,8 +53,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 3;
- if(aCoverVariable <0){aCoverVariable = 2;}
+ aCoverVariable = (aCoverVariable + 1) % 3;
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 8467506d97..58025a0659 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,8 +35,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 12;
- if(aCoverVariable <0){aCoverVariable = 11;}
+ aCoverVariable = (aCoverVariable + 1) % 12;
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 08acc6faa1..3ae4116193 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java
@@ -28,8 +28,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 4;
- if(aCoverVariable <0){aCoverVariable = 3;}
+ aCoverVariable = (aCoverVariable + 1) % 4;
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 5aaef6fc2f..7c1aa03d5a 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java
@@ -58,8 +58,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 6;
- if(aCoverVariable <0){aCoverVariable = 5;}
+ aCoverVariable = (aCoverVariable + 1) % 6;
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 41a24767a7..ce3dc28f26 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java
@@ -91,8 +91,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 12;
- if(aCoverVariable <0){aCoverVariable = 11;}
+ aCoverVariable = (aCoverVariable + 1) % 12;
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 b1f92da27b..56845d2b68 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java
@@ -28,15 +28,16 @@ public class GT_Cover_ItemMeter
}
}
tAll /= 14;
- 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)));
+ 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));
+ }
return aCoverVariable;
}
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- aCoverVariable = (aCoverVariable + (aPlayer.isSneaking()? -1 : 1)) % (2 + aTileEntity.getSizeInventory());
+ aCoverVariable = (aCoverVariable + 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 83c37e35a4..2c60daa679 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java
@@ -44,8 +44,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 10;
- if(aCoverVariable <0){aCoverVariable = 9;}
+ aCoverVariable = (aCoverVariable + 1) % 10;
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 9c61f4feee..ee2ce60bd4 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java
@@ -53,8 +53,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 3;
- if(aCoverVariable <0){aCoverVariable = 2;}
+ aCoverVariable = (aCoverVariable + 1) % 3;
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 f93d6c0db7..fa96d36f52 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,8 +68,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 12;
- if(aCoverVariable <0){aCoverVariable = 11;}
+ aCoverVariable = (aCoverVariable + 1) % 12;
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 5e5a5579a6..52b6748022 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java
@@ -18,8 +18,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 7;
- if(aCoverVariable <0){aCoverVariable = 6;}
+ aCoverVariable = (aCoverVariable + 1) % 7;
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 f632561994..107d452f46 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 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;
}
+
+ public int getTickRate(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity) {
+ return 1;
+ }
}
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 d4fa9ba1d5..296969d0d8 100644
--- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java
+++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java
@@ -14,8 +14,7 @@ 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 + (aPlayer.isSneaking()? -1 : 1)) % 4;
- if(aCoverVariable <0){aCoverVariable = 3;}
+ aCoverVariable = (aCoverVariable + 1) % 4;
switch(aCoverVariable) {
case 0: GT_Utility.sendChatToPlayer(aPlayer, "Open if work enabled"); break;
case 1: GT_Utility.sendChatToPlayer(aPlayer, "Open if work disabled"); break;