diff options
author | Blood-Asp <bloodasphendrik@gmail.com> | 2016-03-20 14:57:51 +0100 |
---|---|---|
committer | Blood-Asp <bloodasphendrik@gmail.com> | 2016-03-20 14:57:51 +0100 |
commit | 529c28649af4ab1f088c8a8c1ac758920f30652a (patch) | |
tree | 9c119e0d76a7fdaaf54109a94e24248c667688f6 | |
parent | 29b387fbceed924bf0f6f9fa5b05f7c91927e47b (diff) | |
download | GT5-Unofficial-529c28649af4ab1f088c8a8c1ac758920f30652a.tar.gz GT5-Unofficial-529c28649af4ab1f088c8a8c1ac758920f30652a.tar.bz2 GT5-Unofficial-529c28649af4ab1f088c8a8c1ac758920f30652a.zip |
Fix item detector not working correctly
-rw-r--r-- | src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java | 12 |
1 files changed, 6 insertions, 6 deletions
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 33722e64e1..216877a9d5 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -27,17 +27,17 @@ public class GT_Cover_ItemMeter }
}
}
+ System.out.println("inventory: "+tAll+" "+tFull);
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;
|