From 2d7a1087273a3dcb9e36fa68edffd7fc1bd62f50 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Sat, 24 Oct 2015 18:41:53 +0200 Subject: fixed naquadah cell reverse processing --- src/main/java/gregtech/api/enums/Materials.java | 2 ++ src/main/java/gregtech/api/util/GT_OreDictUnificator.java | 1 + src/main/java/gregtech/api/util/GT_RecipeRegistrator.java | 1 + 3 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index 14dd8e0a5f..a5c382a227 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -1676,4 +1676,6 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { public short[] getRGBA() { return mRGBa; } + + public static volatile int VERSION = 509; } \ No newline at end of file diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java index 63b6699200..39eabad202 100644 --- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java +++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java @@ -317,6 +317,7 @@ public class GT_OreDictUnificator { public static ItemStack getIngotOrDust(MaterialStack aMaterial) { ItemStack rStack = getIngot(aMaterial); + if(aMaterial!=null&&aMaterial.mMaterial!=null&&(aMaterial.mMaterial==Materials.Naquadah||aMaterial.mMaterial==Materials.NaquadahEnriched))rStack = getDust(aMaterial); if (rStack == null) rStack = getDust(aMaterial); return rStack; } diff --git a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java index 3eea24785f..ab35b292f1 100644 --- a/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java +++ b/src/main/java/gregtech/api/util/GT_RecipeRegistrator.java @@ -160,6 +160,7 @@ public class GT_RecipeRegistrator { if (aStack == null || aMaterial == null || aMaterialAmount <= 0 || aMaterial.contains(SubTag.NO_SMELTING) || (aMaterialAmount > M && aMaterial.contains(SubTag.METAL))) return; aMaterialAmount /= aStack.stackSize; + if(aMaterial==Materials.Naquadah||aMaterial==Materials.NaquadahEnriched)return; if (aAllowAlloySmelter) GT_ModHandler.addSmeltingAndAlloySmeltingRecipe(GT_Utility.copyAmount(1, aStack), GT_OreDictUnificator.getIngot(aMaterial.mSmeltInto, aMaterialAmount)); else -- cgit From 756e7edc64d3d3495e72e199928b0bcb193d2381 Mon Sep 17 00:00:00 2001 From: Shawn Buckley Date: Sat, 24 Oct 2015 13:45:06 -0400 Subject: Fix version for stable build --- src/main/java/gregtech/api/enums/Materials.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/gregtech/api/enums/Materials.java b/src/main/java/gregtech/api/enums/Materials.java index a5c382a227..494195a861 100644 --- a/src/main/java/gregtech/api/enums/Materials.java +++ b/src/main/java/gregtech/api/enums/Materials.java @@ -1677,5 +1677,5 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer { return mRGBa; } - public static volatile int VERSION = 509; + public static volatile int VERSION = 508; } \ No newline at end of file -- cgit From 46f4473de67d66676f3ecc36c6e441db3d1eebfe Mon Sep 17 00:00:00 2001 From: Shawn Buckley Date: Sun, 25 Oct 2015 09:27:29 -0400 Subject: Change if chains to switches --- .../gregtech/common/covers/GT_Cover_Conveyor.java | 48 ++++++---------------- .../gregtech/common/covers/GT_Cover_DoesWork.java | 16 +++----- .../gregtech/common/covers/GT_Cover_Drain.java | 24 ++++------- .../gregtech/common/covers/GT_Cover_EUMeter.java | 48 ++++++---------------- .../common/covers/GT_Cover_EnergyOnly.java | 12 ++---- .../gregtech/common/covers/GT_Cover_ItemMeter.java | 10 ++--- .../common/covers/GT_Cover_NeedMaintainance.java | 40 +++++------------- .../common/covers/GT_Cover_PlayerDetector.java | 12 ++---- .../java/gregtech/common/covers/GT_Cover_Pump.java | 48 ++++++---------------- .../common/covers/GT_Cover_RedstoneConductor.java | 27 ++++-------- .../common/covers/GT_Cover_RedstoneSignalizer.java | 10 ++--- .../gregtech/common/covers/GT_Cover_Shutter.java | 16 +++----- 12 files changed, 90 insertions(+), 221 deletions(-) (limited to 'src') 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 746b11a59d..9d4816fb68 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Conveyor.java @@ -36,41 +36,19 @@ 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; - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Export"); - } - if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Import"); - } - if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); - } - if (aCoverVariable == 3) { - GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); - } - if (aCoverVariable == 4) { - GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); - } - if (aCoverVariable == 5) { - GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); - } - if (aCoverVariable == 6) { - GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); - } - if (aCoverVariable == 7) { - GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); - } - if (aCoverVariable == 8) { - GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); - } - if (aCoverVariable == 9) { - GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); - } - if (aCoverVariable == 10) { - GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); - } - if (aCoverVariable == 11) { - GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); + switch(aCoverVariable) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Export"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break; + case 4: GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); break; + case 5: GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); break; + case 6: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); break; + case 7: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); break; + case 8: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); break; + case 9: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); break; + case 10: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); break; + case 11: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); break; } return aCoverVariable; } 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 cd1f095396..5355a53d51 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_DoesWork.java @@ -29,17 +29,11 @@ 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; - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Normal"); - } - if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); - } - if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Ready to work"); - } - if (aCoverVariable == 3) { - GT_Utility.sendChatToPlayer(aPlayer, "Not ready to work"); + switch(aCoverVariable) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Ready to work"); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, "Not ready to work"); break; } return aCoverVariable; } 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 e27346e776..8d47d4a5d0 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Drain.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Drain.java @@ -59,23 +59,13 @@ 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; - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Import"); - } - if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); - } - if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); - } - if (aCoverVariable == 3) { - GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away"); - } - if (aCoverVariable == 4) { - GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (conditional)"); - } - if (aCoverVariable == 5) { - GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (invert cond)"); + switch(aCoverVariable) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away"); break; + case 4: GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (conditional)"); break; + case 5: GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (invert cond)"); break; } return aCoverVariable; } 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 d723721b63..bc228d5f25 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EUMeter.java @@ -92,41 +92,19 @@ 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; - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Normal Universal Storage"); - } - if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted Universal Storage"); - } - if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage"); - } - if (aCoverVariable == 3) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage"); - } - if (aCoverVariable == 4) { - GT_Utility.sendChatToPlayer(aPlayer, "Normal Steam Storage"); - } - if (aCoverVariable == 5) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted Steam Storage"); - } - if (aCoverVariable == 6) { - GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Input"); - } - if (aCoverVariable == 7) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Input"); - } - if (aCoverVariable == 8) { - GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Output"); - } - if (aCoverVariable == 9) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Output"); - } - if (aCoverVariable == 10) { - GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage(Including Batterys)"); - } - if (aCoverVariable == 11) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage(Including Batterys)"); + switch(aCoverVariable) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal Universal Storage"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Universal Storage"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage"); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage"); break; + case 4: GT_Utility.sendChatToPlayer(aPlayer, "Normal Steam Storage"); break; + case 5: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Steam Storage"); break; + case 6: GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Input"); break; + case 7: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Input"); break; + case 8: GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Output"); break; + case 9: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Output"); break; + case 10: GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage(Including Batteries)"); break; + case 11: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage(Including Batteries)"); break; } return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java index 5c0f1ea001..49d2e09ac9 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_EnergyOnly.java @@ -11,14 +11,10 @@ public class GT_Cover_EnergyOnly 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; - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Allow"); - } - if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Allow (conditional)"); - } - if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Disallow (conditional)"); + switch(aCoverVariable) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Allow"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Allow (conditional)"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Disallow (conditional)"); break; } return aCoverVariable; } 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 874ba55728..33722e64e1 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_ItemMeter.java @@ -38,12 +38,10 @@ public class GT_Cover_ItemMeter 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()); - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Normal"); - } else if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); - } else { - GT_Utility.sendChatToPlayer(aPlayer, "Slot: " + (aCoverVariable - 2)); + switch(aCoverVariable) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); break; + default: GT_Utility.sendChatToPlayer(aPlayer, "Slot: " + (aCoverVariable - 2)); break; } return aCoverVariable; } 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 78f71e1135..2c60daa679 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_NeedMaintainance.java @@ -45,35 +45,17 @@ 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; - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintainance Needed"); - } - if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintainance Needed(inverted)"); - } - if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintainance Needed"); - } - if (aCoverVariable == 3) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintainance Needed(inverted)"); - } - if (aCoverVariable == 4) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 3 Maintainance Needed"); - } - if (aCoverVariable == 5) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 3 Maintainance Needed(inverted)"); - } - if (aCoverVariable == 6) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 4 Maintainance Needed"); - } - if (aCoverVariable == 7) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 4 Maintainance Needed(inverted)"); - } - if (aCoverVariable == 8) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintainance Needed"); - } - if (aCoverVariable == 9) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintainance Needed(inverted)"); + 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; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintenance Needed"); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintenance Needed(inverted)"); break; + case 4: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 3 Maintenance Needed"); break; + case 5: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 3 Maintenance Needed(inverted)"); break; + case 6: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 4 Maintenance Needed"); break; + case 7: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 4 Maintenance Needed(inverted)"); break; + case 8: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintenance Needed"); break; + case 9: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintenance Needed(inverted)"); break; } return aCoverVariable; } 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 c89e46be79..ee2ce60bd4 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_PlayerDetector.java @@ -54,14 +54,10 @@ 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; - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if any Player is close"); - } - if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if you are close"); - } - if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Emit if other player is close"); + 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; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Emit if other player is close"); break; } return aCoverVariable; } 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 52170883c7..373ad3bd01 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Pump.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Pump.java @@ -69,41 +69,19 @@ 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; - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Export"); - } - if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Import"); - } - if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); - } - if (aCoverVariable == 3) { - GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); - } - if (aCoverVariable == 4) { - GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); - } - if (aCoverVariable == 5) { - GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); - } - if (aCoverVariable == 6) { - GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); - } - if (aCoverVariable == 7) { - GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); - } - if (aCoverVariable == 8) { - GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); - } - if (aCoverVariable == 9) { - GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); - } - if (aCoverVariable == 10) { - GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); - } - if (aCoverVariable == 11) { - GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); + switch(aCoverVariable) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Export"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break; + case 4: GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); break; + case 5: GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); break; + case 6: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); break; + case 7: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); break; + case 8: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); break; + case 9: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); break; + case 10: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); break; + case 11: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); break; } return aCoverVariable; } 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 955e8435d5..def941cd4e 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneConductor.java @@ -20,26 +20,13 @@ 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; switch (aCoverVariable) { - case 0: - GT_Utility.sendChatToPlayer(aPlayer, "Conducts strongest Input"); - break; - case 1: - GT_Utility.sendChatToPlayer(aPlayer, "Conducts from bottom Input"); - break; - case 2: - GT_Utility.sendChatToPlayer(aPlayer, "Conducts from top Input"); - break; - case 3: - GT_Utility.sendChatToPlayer(aPlayer, "Conducts from north Input"); - break; - case 4: - GT_Utility.sendChatToPlayer(aPlayer, "Conducts from south Input"); - break; - case 5: - GT_Utility.sendChatToPlayer(aPlayer, "Conducts from west Input"); - break; - case 6: - GT_Utility.sendChatToPlayer(aPlayer, "Conducts from east Input"); + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Conducts strongest Input"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from bottom Input"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from top Input"); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from north Input"); break; + case 4: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from south Input"); break; + case 5: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from west Input"); break; + case 6: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from east Input"); break; } return aCoverVariable; } diff --git a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java index cd1bcd628b..fa1af824b3 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_RedstoneSignalizer.java @@ -11,12 +11,10 @@ public class GT_Cover_RedstoneSignalizer 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) % 48; - if (aCoverVariable / 16 == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Signal = " + (aCoverVariable & 0xF)); - } else if (aCoverVariable / 16 == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Conditional Signal = " + (aCoverVariable & 0xF)); - } else if (aCoverVariable / 16 == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Inverted Conditional Signal = " + (aCoverVariable & 0xF)); + switch(aCoverVariable / 16) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Signal = " + (aCoverVariable & 0xF)); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Conditional Signal = " + (aCoverVariable & 0xF)); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Conditional Signal = " + (aCoverVariable & 0xF)); break; } return aCoverVariable; } 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 95f3cf1d7f..e6b8aa9b07 100644 --- a/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java +++ b/src/main/java/gregtech/common/covers/GT_Cover_Shutter.java @@ -15,17 +15,11 @@ 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; - if (aCoverVariable == 0) { - GT_Utility.sendChatToPlayer(aPlayer, "Open if work enabled"); - } - if (aCoverVariable == 1) { - GT_Utility.sendChatToPlayer(aPlayer, "Open if work disabled"); - } - if (aCoverVariable == 2) { - GT_Utility.sendChatToPlayer(aPlayer, "Only Output allowed"); - } - if (aCoverVariable == 3) { - GT_Utility.sendChatToPlayer(aPlayer, "Only Input allowed"); + switch(aCoverVariable) { + case 0: GT_Utility.sendChatToPlayer(aPlayer, "Open if work enabled"); break; + case 1: GT_Utility.sendChatToPlayer(aPlayer, "Open if work disabled"); break; + case 2: GT_Utility.sendChatToPlayer(aPlayer, "Only Output allowed"); break; + case 3: GT_Utility.sendChatToPlayer(aPlayer, "Only Input allowed"); break; } return aCoverVariable; } -- cgit