From 6b2e08b2caa68af1b73553b7b3384e55b26de90e Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Thu, 10 Dec 2015 18:25:07 +0100 Subject: [PATCH] shift + screwdriver for all covers --- .../implementations/GT_MetaTileEntity_Buffer.java | 1 + .../java/gregtech/common/covers/GT_Cover_ControlsWork.java | 3 ++- src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java | 3 ++- src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java | 3 ++- src/main/java/gregtech/common/covers/GT_Cover_Drain.java | 3 ++- src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java | 3 ++- .../java/gregtech/common/covers/GT_Cover_NeedMaintainance.java | 3 ++- .../java/gregtech/common/covers/GT_Cover_PlayerDetector.java | 3 ++- src/main/java/gregtech/common/covers/GT_Cover_Pump.java | 3 ++- .../gregtech/common/covers/GT_Cover_RedstoneConductor.java | 3 ++- src/main/java/gregtech/common/covers/GT_Cover_Shutter.java | 3 ++- 11 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java index 70086be2..cffa8883 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Buffer.java @@ -206,6 +206,7 @@ public abstract class GT_MetaTileEntity_Buffer extends GT_MetaTileEntity_TieredM if (aSide == getBaseMetaTileEntity().getBackFacing()) { mTargetStackSize = (byte) ((mTargetStackSize + (aPlayer.isSneaking()? -1 : 1)) % 65); + if(mTargetStackSize <0){mTargetStackSize = 64;} if (mTargetStackSize == 0) { GT_Utility.sendChatToPlayer(aPlayer, "Do not regulate Item Stack Size"); } else { 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 ed53f298..abb6d0a3 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 9d4816fb..d52cf94a 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -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 5355a53d..0a440c5a 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 8d47d4a5..1a369dc2 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 bc228d5f..8a593262 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_NeedMaintainance.java b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java index 2c60daa6..83c37e35 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 ee2ce60b..9c61f4fe 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 373ad3bd..bef8fd4b 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -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 def941cd..9675ef6c 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_Shutter.java b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java index e6b8aa9b..a936d8db 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;