Change if chains to switches

This commit is contained in:
Shawn Buckley 2015-10-25 09:27:29 -04:00
parent 756e7edc64
commit 46f4473de6
12 changed files with 90 additions and 221 deletions

View file

@ -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) { 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 + 1) % 12;
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Export"); case 0: GT_Utility.sendChatToPlayer(aPlayer, "Export"); break;
} case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break;
if (aCoverVariable == 1) { case 2: GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Import"); case 3: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break;
} case 4: GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); break;
if (aCoverVariable == 2) { case 5: GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); case 6: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); break;
} case 7: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); break;
if (aCoverVariable == 3) { case 8: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); case 9: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); break;
} case 10: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); break;
if (aCoverVariable == 4) { case 11: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); break;
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)");
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -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) { 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 + 1) % 4;
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Normal"); case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal"); break;
} case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); break;
if (aCoverVariable == 1) { case 2: GT_Utility.sendChatToPlayer(aPlayer, "Ready to work"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); case 3: GT_Utility.sendChatToPlayer(aPlayer, "Not ready to work"); break;
}
if (aCoverVariable == 2) {
GT_Utility.sendChatToPlayer(aPlayer, "Ready to work");
}
if (aCoverVariable == 3) {
GT_Utility.sendChatToPlayer(aPlayer, "Not ready to work");
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -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) { 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 + 1) % 6;
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Import"); case 0: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break;
} case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break;
if (aCoverVariable == 1) { case 2: GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); case 3: GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away"); break;
} case 4: GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (conditional)"); break;
if (aCoverVariable == 2) { case 5: GT_Utility.sendChatToPlayer(aPlayer, "Keep Liquids Away (invert cond)"); break;
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)");
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -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) { 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 + 1) % 12;
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Normal Universal Storage"); case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal Universal Storage"); break;
} case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Universal Storage"); break;
if (aCoverVariable == 1) { case 2: GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Inverted Universal Storage"); case 3: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage"); break;
} case 4: GT_Utility.sendChatToPlayer(aPlayer, "Normal Steam Storage"); break;
if (aCoverVariable == 2) { case 5: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Steam Storage"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage"); case 6: GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Input"); break;
} case 7: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Input"); break;
if (aCoverVariable == 3) { case 8: GT_Utility.sendChatToPlayer(aPlayer, "Normal Average Electric Output"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage"); case 9: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Average Electric Output"); break;
} case 10: GT_Utility.sendChatToPlayer(aPlayer, "Normal Electricity Storage(Including Batteries)"); break;
if (aCoverVariable == 4) { case 11: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Electricity Storage(Including Batteries)"); break;
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)");
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -11,14 +11,10 @@ public class GT_Cover_EnergyOnly
extends GT_CoverBehavior { extends GT_CoverBehavior {
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { 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 + 1) % 3;
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Allow"); case 0: GT_Utility.sendChatToPlayer(aPlayer, "Allow"); break;
} case 1: GT_Utility.sendChatToPlayer(aPlayer, "Allow (conditional)"); break;
if (aCoverVariable == 1) { case 2: GT_Utility.sendChatToPlayer(aPlayer, "Disallow (conditional)"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Allow (conditional)");
}
if (aCoverVariable == 2) {
GT_Utility.sendChatToPlayer(aPlayer, "Disallow (conditional)");
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -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) { 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 + 1) % (2 + aTileEntity.getSizeInventory());
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Normal"); case 0: GT_Utility.sendChatToPlayer(aPlayer, "Normal"); break;
} else if (aCoverVariable == 1) { case 1: GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Inverted"); default: GT_Utility.sendChatToPlayer(aPlayer, "Slot: " + (aCoverVariable - 2)); break;
} else {
GT_Utility.sendChatToPlayer(aPlayer, "Slot: " + (aCoverVariable - 2));
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -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) { 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 + 1) % 10;
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintainance Needed"); 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;
if (aCoverVariable == 1) { case 2: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintenance Needed"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Emit if 1 Maintainance Needed(inverted)"); 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;
if (aCoverVariable == 2) { case 5: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 3 Maintenance Needed(inverted)"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintainance Needed"); 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;
if (aCoverVariable == 3) { case 8: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintenance Needed"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Emit if 2 Maintainance Needed(inverted)"); case 9: GT_Utility.sendChatToPlayer(aPlayer, "Emit if 5 Maintenance Needed(inverted)"); break;
}
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)");
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -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) { 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 + 1) % 3;
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Emit if any Player is close"); 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;
if (aCoverVariable == 1) { case 2: GT_Utility.sendChatToPlayer(aPlayer, "Emit if other player is close"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Emit if you are close");
}
if (aCoverVariable == 2) {
GT_Utility.sendChatToPlayer(aPlayer, "Emit if other player is close");
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -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) { 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 + 1) % 12;
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Export"); case 0: GT_Utility.sendChatToPlayer(aPlayer, "Export"); break;
} case 1: GT_Utility.sendChatToPlayer(aPlayer, "Import"); break;
if (aCoverVariable == 1) { case 2: GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Import"); case 3: GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); break;
} case 4: GT_Utility.sendChatToPlayer(aPlayer, "Export (invert cond)"); break;
if (aCoverVariable == 2) { case 5: GT_Utility.sendChatToPlayer(aPlayer, "Import (invert cond)"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Export (conditional)"); case 6: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input"); break;
} case 7: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output"); break;
if (aCoverVariable == 3) { case 8: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (conditional)"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Import (conditional)"); case 9: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (conditional)"); break;
} case 10: GT_Utility.sendChatToPlayer(aPlayer, "Export allow Input (invert cond)"); break;
if (aCoverVariable == 4) { case 11: GT_Utility.sendChatToPlayer(aPlayer, "Import allow Output (invert cond)"); break;
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)");
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -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) { 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 + 1) % 7;
switch (aCoverVariable) { switch (aCoverVariable) {
case 0: case 0: GT_Utility.sendChatToPlayer(aPlayer, "Conducts strongest Input"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Conducts strongest Input"); case 1: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from bottom Input"); break;
break; case 2: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from top Input"); break;
case 1: case 3: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from north Input"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Conducts from bottom Input"); case 4: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from south Input"); break;
break; case 5: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from west Input"); break;
case 2: case 6: GT_Utility.sendChatToPlayer(aPlayer, "Conducts from east Input"); break;
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");
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -11,12 +11,10 @@ public class GT_Cover_RedstoneSignalizer
extends GT_CoverBehavior { extends GT_CoverBehavior {
public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) { public int onCoverScrewdriverclick(byte aSide, int aCoverID, int aCoverVariable, ICoverable aTileEntity, EntityPlayer aPlayer, float aX, float aY, float aZ) {
aCoverVariable = (aCoverVariable + 1) % 48; aCoverVariable = (aCoverVariable + 1) % 48;
if (aCoverVariable / 16 == 0) { switch(aCoverVariable / 16) {
GT_Utility.sendChatToPlayer(aPlayer, "Signal = " + (aCoverVariable & 0xF)); case 0: GT_Utility.sendChatToPlayer(aPlayer, "Signal = " + (aCoverVariable & 0xF)); break;
} else if (aCoverVariable / 16 == 1) { case 1: GT_Utility.sendChatToPlayer(aPlayer, "Conditional Signal = " + (aCoverVariable & 0xF)); break;
GT_Utility.sendChatToPlayer(aPlayer, "Conditional Signal = " + (aCoverVariable & 0xF)); case 2: GT_Utility.sendChatToPlayer(aPlayer, "Inverted Conditional Signal = " + (aCoverVariable & 0xF)); break;
} else if (aCoverVariable / 16 == 2) {
GT_Utility.sendChatToPlayer(aPlayer, "Inverted Conditional Signal = " + (aCoverVariable & 0xF));
} }
return aCoverVariable; return aCoverVariable;
} }

View file

@ -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) { 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 + 1) % 4;
if (aCoverVariable == 0) { switch(aCoverVariable) {
GT_Utility.sendChatToPlayer(aPlayer, "Open if work enabled"); case 0: GT_Utility.sendChatToPlayer(aPlayer, "Open if work enabled"); break;
} case 1: GT_Utility.sendChatToPlayer(aPlayer, "Open if work disabled"); break;
if (aCoverVariable == 1) { case 2: GT_Utility.sendChatToPlayer(aPlayer, "Only Output allowed"); break;
GT_Utility.sendChatToPlayer(aPlayer, "Open if work disabled"); case 3: GT_Utility.sendChatToPlayer(aPlayer, "Only Input allowed"); break;
}
if (aCoverVariable == 2) {
GT_Utility.sendChatToPlayer(aPlayer, "Only Output allowed");
}
if (aCoverVariable == 3) {
GT_Utility.sendChatToPlayer(aPlayer, "Only Input allowed");
} }
return aCoverVariable; return aCoverVariable;
} }