diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation')
3 files changed, 21 insertions, 43 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTEElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTEElectricAutoWorkbench.java index 05150c8478..73233b7938 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTEElectricAutoWorkbench.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTEElectricAutoWorkbench.java @@ -391,7 +391,9 @@ public class MTEElectricAutoWorkbench extends MTEBasicTank implements IAddGregte tTempStack.stackSize = 1; tRecipe[0] = tTempStack; tOutput = GTOreDictUnificator.get(true, tTempStack); - if (tOutput != null && GTUtility.areStacksEqual(tOutput, tTempStack)) tOutput = null; + if (GTUtility.areStacksEqual(tOutput, tTempStack)) { + tOutput = null; + } if (tOutput == null) { tRecipe[0] = null; if (mInventory[18] == null) { @@ -552,7 +554,7 @@ public class MTEElectricAutoWorkbench extends MTEBasicTank implements IAddGregte mInventory[28] = GTUtility.copy(tOutput); ArrayList<ItemStack> tList = recipeContent(tRecipe), tContent = benchContent(); - if (tList.size() > 0 && tContent.size() > 0) { + if (!tList.isEmpty() && !tContent.isEmpty()) { boolean success = (mMode == 6 || mMode == 7 || mInventory[17] == null); for (byte i = 0; i < tList.size() && success; i++) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java index 08db4e19be..a48bcdace4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractGenerator.java @@ -196,13 +196,10 @@ public class MTETesseractGenerator extends MTEBasicTank { .getOwnerName() != null && !this.getBaseMetaTileEntity() .getOwnerName() - .equals("")) { + .isEmpty()) { if (this.getBaseMetaTileEntity() .getOwnerName() - .toLowerCase() - .equals( - aPlayer.getDisplayName() - .toLowerCase())) { + .equalsIgnoreCase(aPlayer.getDisplayName())) { this.mOwner = PlayerUtils.getPlayersUUIDByName( this.getBaseMetaTileEntity() .getOwnerName()); @@ -684,8 +681,8 @@ public class MTETesseractGenerator extends MTEBasicTank { && (this.getBaseMetaTileEntity() .decreaseStoredEnergyUnits(this.mNeededEnergy, false))) { // Utils.LOG_WARNING("Can Work & Has Energy"); - if ((getGeneratorEntity(Integer.valueOf(this.mFrequency)) == null) - || (!getGeneratorEntity(Integer.valueOf(this.mFrequency)).isValidTesseractGenerator(null, true))) { + if ((getGeneratorEntity(this.mFrequency) == null) + || (!getGeneratorEntity(this.mFrequency).isValidTesseractGenerator(null, true))) { // Utils.LOG_WARNING("storing TE I think to mFreq map?"); TesseractHelper.setGeneratorOwnershipByPlayer( PlayerUtils.getPlayerOnServerFromUUID(mOwner), @@ -693,7 +690,7 @@ public class MTETesseractGenerator extends MTEBasicTank { this); } } else { - if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) { + if (getGeneratorEntity(this.mFrequency) == this) { Logger.WARNING("this gen == mFreq on map - do block update"); TesseractHelper.removeGenerator(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency); this.getBaseMetaTileEntity() @@ -701,7 +698,7 @@ public class MTETesseractGenerator extends MTEBasicTank { } this.isWorking = 0; } - if (getGeneratorEntity(Integer.valueOf(this.mFrequency)) == this) { + if (getGeneratorEntity(this.mFrequency) == this) { // Utils.LOG_WARNING("mFreq == this - do work related things"); if (this.isWorking < 20) { this.isWorking = ((byte) (this.isWorking + 1)); @@ -789,21 +786,11 @@ public class MTETesseractGenerator extends MTEBasicTank { } private MTETesseractGenerator getGeneratorEntity() { - MTETesseractGenerator thisGenerator = TesseractHelper - .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency); - if (thisGenerator != null) { - return thisGenerator; - } - return null; + return TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), this.mFrequency); } private MTETesseractGenerator getGeneratorEntity(int frequency) { - MTETesseractGenerator thisGenerator = TesseractHelper - .getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency); - if (thisGenerator != null) { - return thisGenerator; - } - return null; + return TesseractHelper.getGeneratorByFrequency(PlayerUtils.getPlayerOnServerFromUUID(mOwner), frequency); } @Override @@ -812,7 +799,7 @@ public class MTETesseractGenerator extends MTEBasicTank { .getOwnerName() != null && !this.getBaseMetaTileEntity() .getOwnerName() - .equals("")) { + .isEmpty()) { this.mOwner = PlayerUtils.getPlayersUUIDByName( this.getBaseMetaTileEntity() .getOwnerName()); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java index c34a2ca41b..1935129e32 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/MTETesseractTerminal.java @@ -149,13 +149,10 @@ public class MTETesseractTerminal extends MTEBasicTank { .getOwnerName() != null && !this.getBaseMetaTileEntity() .getOwnerName() - .equals("")) { + .isEmpty()) { if (this.getBaseMetaTileEntity() .getOwnerName() - .toLowerCase() - .equals( - aPlayer.getDisplayName() - .toLowerCase())) { + .equalsIgnoreCase(aPlayer.getDisplayName())) { this.mOwner = PlayerUtils.getPlayersUUIDByName( this.getBaseMetaTileEntity() .getOwnerName()); @@ -194,11 +191,7 @@ public class MTETesseractTerminal extends MTEBasicTank { } PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency); if (this.getTesseract(this.mFrequency, false) != null) { - PlayerUtils.messagePlayer( - aPlayer, - new StringBuilder().append(EnumChatFormatting.GREEN) - .append(" (Connected)") - .toString()); + PlayerUtils.messagePlayer(aPlayer, EnumChatFormatting.GREEN + " (Connected)"); } } } else if (aPlayer.getUniqueID() @@ -250,9 +243,7 @@ public class MTETesseractTerminal extends MTEBasicTank { aPlayer, "Frequency: " + this.mFrequency + (this.getTesseract(this.mFrequency, false) == null ? "" - : new StringBuilder().append(EnumChatFormatting.GREEN) - .append(" (Connected)") - .toString())); + : EnumChatFormatting.GREEN + " (Connected)")); } } else if (aPlayer.getUniqueID() .compareTo(this.mOwner) != 0) { @@ -275,10 +266,8 @@ public class MTETesseractTerminal extends MTEBasicTank { return null; } if (rTesseract.mFrequency != aFrequency) { - TesseractHelper.setTerminalOwnershipByPlayer( - PlayerUtils.getPlayerOnServerFromUUID(mOwner), - Integer.valueOf(aFrequency), - null); + TesseractHelper + .setTerminalOwnershipByPlayer(PlayerUtils.getPlayerOnServerFromUUID(mOwner), aFrequency, null); return null; } if (!rTesseract.isValidTesseractGenerator( @@ -539,7 +528,7 @@ public class MTETesseractTerminal extends MTEBasicTank { this.getBaseMetaTileEntity() .decreaseStoredEnergyUnits(128, false); } - } else if (this.mDidWork == true) { + } else if (this.mDidWork) { this.mDidWork = false; this.getBaseMetaTileEntity() .issueBlockUpdate(); @@ -623,7 +612,7 @@ public class MTETesseractTerminal extends MTEBasicTank { .getOwnerName() != null && !this.getBaseMetaTileEntity() .getOwnerName() - .equals("")) { + .isEmpty()) { this.mOwner = PlayerUtils.getPlayersUUIDByName( this.getBaseMetaTileEntity() .getOwnerName()); |