aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations
diff options
context:
space:
mode:
authorAlexdoru <57050655+Alexdoru@users.noreply.github.com>2024-10-02 07:31:08 +0200
committerGitHub <noreply@github.com>2024-10-02 05:31:08 +0000
commit3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3 (patch)
tree107d9d2442891990ef1cdef1d8bb2df6bb96952a /src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations
parentbfc7b2b07f72d0903a70791ff96f9c837ddd5ff0 (diff)
downloadGT5-Unofficial-3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3.tar.gz
GT5-Unofficial-3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3.tar.bz2
GT5-Unofficial-3b9bd1188e932e6bb8041f7bb9afbf3ce75e26d3.zip
Cleanup the codebase (#3311)
Co-authored-by: boubou19 <miisterunknown@gmail.com>
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java36
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java16
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java7
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java40
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java23
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java8
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java9
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java78
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java2
12 files changed, 91 insertions, 134 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java
index e475037c63..6786fabc31 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/METHatchAirIntake.java
@@ -101,27 +101,27 @@ public class METHatchAirIntake extends MTEHatchFluidGenerator {
aWorld.spawnParticle(
name,
- (double) (xPos + ran1 * 0.5f),
- (double) (yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) (zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) xSpd,
- (double) -ySpd,
- (double) zSpd);
+ xPos + ran1 * 0.5f,
+ yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ xSpd,
+ -ySpd,
+ zSpd);
aWorld.spawnParticle(
name,
- (double) (xPos + ran2 * 0.5f),
- (double) (yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) (zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) xSpd,
- (double) -ySpd,
- (double) zSpd);
+ xPos + ran2 * 0.5f,
+ yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ xSpd,
+ -ySpd,
+ zSpd);
aWorld.spawnParticle(
name,
- (double) (xPos + ran3 * 0.5f),
- (double) (yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) (zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f),
- (double) xSpd,
- (double) -ySpd,
- (double) zSpd);
+ xPos + ran3 * 0.5f,
+ yPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ zPos + METHatchAirIntake.floatGen.nextFloat() * 0.5f,
+ xSpd,
+ -ySpd,
+ zSpd);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java
index 0043819b23..68396fee78 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchElementalDataOrbHolder.java
@@ -125,22 +125,16 @@ public class MTEHatchElementalDataOrbHolder extends MTEHatch implements IConfigu
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
Logger.INFO("Checking if we can pull " + aStack.getDisplayName() + " from slot " + aIndex);
- if (aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)
- && side == getBaseMetaTileEntity().getFrontFacing()) {
- return true;
- }
- return false;
+ return aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)
+ && side == getBaseMetaTileEntity().getFrontFacing();
}
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
ItemStack aStack) {
Logger.INFO("Checking if we can put " + aStack.getDisplayName() + " into slot " + aIndex);
- if (aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)
- && side == getBaseMetaTileEntity().getFrontFacing()) {
- return true;
- }
- return false;
+ return aIndex == mInventory.length - 1 && ItemUtils.isControlCircuit(aStack)
+ && side == getBaseMetaTileEntity().getFrontFacing();
}
public ArrayList<ItemStack> getInventory() {
@@ -154,7 +148,7 @@ public class MTEHatchElementalDataOrbHolder extends MTEHatch implements IConfigu
public ItemStack getOrbByCircuit() {
ItemStack aCirc = getBaseMetaTileEntity().getStackInSlot(getCircuitSlot());
- if (aCirc != null && ItemUtils.isControlCircuit(aCirc)) {
+ if (ItemUtils.isControlCircuit(aCirc)) {
int slot = aCirc.getItemDamage() - 1; // slots are 0 indexed but there's no 0 circuit
if (slot < getBaseMetaTileEntity().getSizeInventory() - 1) {
return getBaseMetaTileEntity().getStackInSlot(slot);
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java
index 3a5640cd88..9eafd09a10 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchFluidGenerator.java
@@ -9,7 +9,6 @@ import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import gregtech.api.enums.Textures;
-import gregtech.api.interfaces.IIconContainer;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
@@ -58,14 +57,12 @@ public abstract class MTEHatchFluidGenerator extends MTEHatchInput {
@Override
public ITexture[] getTexturesActive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture,
- new GTRenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER) };
+ return new ITexture[] { aBaseTexture, new GTRenderedTexture(Textures.BlockIcons.OVERLAY_MUFFLER) };
}
@Override
public ITexture[] getTexturesInactive(final ITexture aBaseTexture) {
- return new ITexture[] { aBaseTexture,
- new GTRenderedTexture((IIconContainer) Textures.BlockIcons.OVERLAY_MUFFLER) };
+ return new ITexture[] { aBaseTexture, new GTRenderedTexture(Textures.BlockIcons.OVERLAY_MUFFLER) };
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java
index 2cf1ed3efe..dd38f1ab26 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchMufflerAdvanced.java
@@ -299,8 +299,8 @@ public class MTEHatchMufflerAdvanced extends MTEHatchMuffler implements IAddGreg
float zSpd;
if (aDir.offsetY == -1) {
float temp = GTPPCore.RANDOM.nextFloat() * 2.0F * GTPPCore.PI;
- xSpd = (float) Math.sin((double) temp) * 0.1F;
- zSpd = (float) Math.cos((double) temp) * 0.1F;
+ xSpd = (float) Math.sin(temp) * 0.1F;
+ zSpd = (float) Math.cos(temp) * 0.1F;
} else {
xSpd = (float) aDir.offsetX * (0.1F + 0.2F * GTPPCore.RANDOM.nextFloat());
zSpd = (float) aDir.offsetZ * (0.1F + 0.2F * GTPPCore.RANDOM.nextFloat());
@@ -309,34 +309,34 @@ public class MTEHatchMufflerAdvanced extends MTEHatchMuffler implements IAddGreg
if (chk1) {
aWorld.spawnParticle(
name,
- (double) (xPos + ran1 * 0.5F),
- (double) (yPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) (zPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) xSpd,
- (double) ySpd,
- (double) zSpd);
+ xPos + ran1 * 0.5F,
+ yPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ zPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ xSpd,
+ ySpd,
+ zSpd);
}
if (chk2) {
aWorld.spawnParticle(
name,
- (double) (xPos + ran2 * 0.5F),
- (double) (yPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) (zPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) xSpd,
- (double) ySpd,
- (double) zSpd);
+ xPos + ran2 * 0.5F,
+ yPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ zPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ xSpd,
+ ySpd,
+ zSpd);
}
if (chk3) {
aWorld.spawnParticle(
name,
- (double) (xPos + ran3 * 0.5F),
- (double) (yPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) (zPos + GTPPCore.RANDOM.nextFloat() * 0.5F),
- (double) xSpd,
- (double) ySpd,
- (double) zSpd);
+ xPos + ran3 * 0.5F,
+ yPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ zPos + GTPPCore.RANDOM.nextFloat() * 0.5F,
+ xSpd,
+ ySpd,
+ zSpd);
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java
index e95cea2762..a87d992139 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchSuperBusInput.java
@@ -38,7 +38,7 @@ public class MTEHatchSuperBusInput extends MTEHatchInputBus {
@Override
public String[] getDescription() {
- return new String[] { "Item Input for Multiblocks", "" + getSlots(this.mTier) + " Slots",
+ return new String[] { "Item Input for Multiblocks", getSlots(this.mTier) + " Slots",
GTPPCore.GT_Tooltip.get() };
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java
index 09c3dd6efb..ee40ffdbe8 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbine.java
@@ -106,8 +106,7 @@ public class MTEHatchTurbine extends MTEHatch {
public boolean hasTurbine() {
ItemStack aStack = this.mInventory[0];
- boolean aIsValid = MTELargerTurbineBase.isValidTurbine(aStack);
- return aIsValid;
+ return MTELargerTurbineBase.isValidTurbine(aStack);
}
public ItemStack getTurbine() {
@@ -194,15 +193,10 @@ public class MTEHatchTurbine extends MTEHatch {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (this.mHasController) {
if (aTick % 20 == 0) {
- if (isControllerActive()) {
- this.getBaseMetaTileEntity()
- .setActive(true);
- } else {
- this.getBaseMetaTileEntity()
- .setActive(false);
- }
+ this.getBaseMetaTileEntity()
+ .setActive(isControllerActive());
}
- } else if (!this.mHasController && this.mControllerLocation != null) {
+ } else if (this.mControllerLocation != null) {
// Weird Invalid State
if (setController(BlockPos.generateBlockPos(mControllerLocation))) {
// Valid
@@ -224,7 +218,7 @@ public class MTEHatchTurbine extends MTEHatch {
}
public MTELargerTurbineBase getController() {
- if (this.mHasController && this.mControllerLocation != null && this.mControllerLocation.length() > 0) {
+ if (this.mHasController && this.mControllerLocation != null && !this.mControllerLocation.isEmpty()) {
BlockPos p = BlockPos.generateBlockPos(mControllerLocation);
if (p != null) {
// Logger.INFO(p.getLocationString());
@@ -246,10 +240,7 @@ public class MTEHatchTurbine extends MTEHatch {
}
public boolean canSetNewController() {
- if ((mControllerLocation != null && mControllerLocation.length() > 0) || this.mHasController) {
- return false;
- }
- return true;
+ return (mControllerLocation == null || mControllerLocation.isEmpty()) && !this.mHasController;
}
public boolean setController(BlockPos aPos) {
@@ -395,7 +386,7 @@ public class MTEHatchTurbine extends MTEHatch {
aHasTurbine ? "Cannot remove turbine, no free inventory space." : "No turbine to remove.");
}
} else if (GTUtility.isStackInList(tCurrentItem, GregTechAPI.sSolderingToolList)) {
- if (mControllerLocation != null && mControllerLocation.length() > 0) {
+ if (mControllerLocation != null && !mControllerLocation.isEmpty()) {
if (setController(BlockPos.generateBlockPos(mControllerLocation))) {
if (PlayerUtils.isCreative(aPlayer)
|| GTModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java
index 6a501a2531..5d0bc5c554 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTEHatchTurbineProvider.java
@@ -110,18 +110,14 @@ public class MTEHatchTurbineProvider extends MTEHatchInputBus {
public boolean isItemStackTurbine(ItemStack aStack) {
if (aStack.getItem() instanceof MetaGeneratedTool) {
- if (aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 176) {
- return true;
- }
+ return aStack.getItemDamage() >= 170 && aStack.getItemDamage() <= 176;
}
return false;
}
public boolean isItemStackScrewdriver(ItemStack aStack) {
if (aStack.getItem() instanceof MetaGeneratedTool) {
- if (aStack.getItemDamage() == 22 || aStack.getItemDamage() == 150) {
- return true;
- }
+ return aStack.getItemDamage() == 22 || aStack.getItemDamage() == 150;
}
return false;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java
index 686589b38a..0ea35495fa 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/MTESuperBusOutput.java
@@ -1,7 +1,5 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
-import net.minecraft.inventory.IInventory;
-
import com.gtnewhorizons.modularui.api.screen.ModularWindow.Builder;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
import com.gtnewhorizons.modularui.common.widget.Scrollable;
@@ -68,8 +66,8 @@ public class MTESuperBusOutput extends MTEHatchOutputBus {
if (this.mInventory[j] != null && (this.mInventory[i] == null
|| GTUtility.areStacksEqual(this.mInventory[i], this.mInventory[j]))) {
GTUtility.moveStackFromSlotAToSlotB(
- (IInventory) this.getBaseMetaTileEntity(),
- (IInventory) this.getBaseMetaTileEntity(),
+ this.getBaseMetaTileEntity(),
+ this.getBaseMetaTileEntity(),
j,
i,
(byte) 64,
@@ -83,10 +81,9 @@ public class MTESuperBusOutput extends MTEHatchOutputBus {
@Override
public String[] getDescription() {
- String[] aDesc = new String[] { "Item Output for Multiblocks", "" + getSlots(this.mTier) + " Slots",
+ return new String[] { "Item Output for Multiblocks", getSlots(this.mTier) + " Slots",
"Left click with data stick to save filter config", "Right click with data stick to load filter config",
GTPPCore.GT_Tooltip.get() };
- return aDesc;
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java
index b969227977..df55649bb5 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GTPPMultiBlockBase.java
@@ -139,7 +139,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
public String[] getInfoData() {
ArrayList<String> mInfo = new ArrayList<>();
if (!this.getMetaName()
- .equals("")) {
+ .isEmpty()) {
mInfo.add(this.getMetaName());
}
@@ -148,11 +148,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
if (extra == null) {
extra = new String[0];
}
- if (extra.length > 0) {
- for (String s : extra) {
- mInfo.add(s);
- }
- }
+ mInfo.addAll(Arrays.asList(extra));
long seconds = (this.mTotalRunTime / 20);
int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7);
@@ -183,20 +179,18 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy") + ":");
mInfo.add(
StatCollector.translateToLocal(
- "" + EnumChatFormatting.GREEN
- + Long.toString(storedEnergy)
+ EnumChatFormatting.GREEN.toString() + storedEnergy
+ EnumChatFormatting.RESET
+ " EU / "
+ EnumChatFormatting.YELLOW
- + Long.toString(maxEnergy)
+ + maxEnergy
+ EnumChatFormatting.RESET
+ " EU"));
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei") + ":");
mInfo.add(
StatCollector.translateToLocal(
- "" + EnumChatFormatting.YELLOW
- + Long.toString(getMaxInputVoltage())
+ EnumChatFormatting.YELLOW.toString() + getMaxInputVoltage()
+ EnumChatFormatting.RESET
+ " EU/t(*2A) "
+ StatCollector.translateToLocal("GTPP.machines.tier")
@@ -211,12 +205,11 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy") + " In Dynamos:");
mInfo.add(
StatCollector.translateToLocal(
- "" + EnumChatFormatting.GREEN
- + Long.toString(storedEnergy)
+ EnumChatFormatting.GREEN.toString() + storedEnergy
+ EnumChatFormatting.RESET
+ " EU / "
+ EnumChatFormatting.YELLOW
- + Long.toString(maxEnergy)
+ + maxEnergy
+ EnumChatFormatting.RESET
+ " EU"));
}
@@ -242,7 +235,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
+ StatCollector.translateToLocal("GTPP.multiblock.efficiency")
+ ": "
+ EnumChatFormatting.YELLOW
- + Float.toString(mEfficiency / 100.0F)
+ + mEfficiency / 100.0F
+ EnumChatFormatting.RESET
+ " %");
@@ -270,11 +263,11 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
mInfo.add(
"Total Time Since Built: " + EnumChatFormatting.DARK_GREEN
- + Integer.toString(weeks)
+ + weeks
+ EnumChatFormatting.RESET
+ " Weeks, "
+ EnumChatFormatting.DARK_GREEN
- + Integer.toString(days)
+ + days
+ EnumChatFormatting.RESET
+ " Days, ");
mInfo.add(
@@ -282,17 +275,16 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
+ EnumChatFormatting.RESET
+ " Hours, "
+ EnumChatFormatting.DARK_GREEN
- + Long.toString(minutes)
+ + minutes
+ EnumChatFormatting.RESET
+ " Minutes, "
+ EnumChatFormatting.DARK_GREEN
- + Long.toString(second)
+ + second
+ EnumChatFormatting.RESET
+ " Seconds.");
- mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + Long.toString(this.mTotalRunTime));
+ mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + this.mTotalRunTime);
- String[] mInfo2 = mInfo.toArray(new String[mInfo.size()]);
- return mInfo2;
+ return mInfo.toArray(new String[0]);
}
public int getPollutionReductionForAllMufflers() {
@@ -409,10 +401,8 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
}
public boolean isMachineRunning() {
- boolean aRunning = this.getBaseMetaTileEntity()
+ return this.getBaseMetaTileEntity()
.isActive();
- // log("Queried Multiblock is currently running: "+aRunning);
- return aRunning;
}
@Override
@@ -423,19 +413,16 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
.doExplosion(GTValues.V[8])) {
tTileEntity = localIterator.next();
}
- tTileEntity = null;
for (final Iterator<MTEHatchOutputBattery> localIterator = this.mDischargeHatches.iterator(); localIterator
.hasNext(); tTileEntity.getBaseMetaTileEntity()
.doExplosion(GTValues.V[8])) {
tTileEntity = localIterator.next();
}
- tTileEntity = null;
for (final Iterator<MTEHatch> localIterator = this.mTecTechDynamoHatches.iterator(); localIterator
.hasNext(); tTileEntity.getBaseMetaTileEntity()
.doExplosion(GTValues.V[8])) {
tTileEntity = localIterator.next();
}
- tTileEntity = null;
for (final Iterator<MTEHatch> localIterator = this.mTecTechEnergyHatches.iterator(); localIterator
.hasNext(); tTileEntity.getBaseMetaTileEntity()
.doExplosion(GTValues.V[8])) {
@@ -465,7 +452,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
}
public ItemStack findItemInInventory(ItemStack aSearchStack) {
- if (aSearchStack != null && this.mInputBusses.size() > 0) {
+ if (aSearchStack != null && !this.mInputBusses.isEmpty()) {
for (MTEHatchInputBus bus : this.mInputBusses) {
if (bus != null) {
for (ItemStack uStack : bus.mInventory) {
@@ -513,8 +500,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
}
public boolean checkHatch() {
- return mMaintenanceHatches.size() <= 1
- && (this.getPollutionPerSecond(null) > 0 ? !mMufflerHatches.isEmpty() : true);
+ return mMaintenanceHatches.size() <= 1 && (this.getPollutionPerSecond(null) <= 0 || !mMufflerHatches.isEmpty());
}
@Override
@@ -610,8 +596,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
if (aTileEntity == null) {
return null;
}
- final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity();
- return aMetaTileEntity;
+ return aTileEntity.getMetaTileEntity();
}
@Override
@@ -782,28 +767,27 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
if (aTileEntity == null) {
return false;
}
- final IMetaTileEntity aMetaTileEntity = aTileEntity;
- if (aMetaTileEntity instanceof MTEHatchInput || aMetaTileEntity instanceof MTEHatchInputBus
- || aMetaTileEntity instanceof MteHatchSteamBusInput) {
- if (aMetaTileEntity instanceof MTEHatchInput) {
- ((MTEHatchInput) aMetaTileEntity).mRecipeMap = null;
- ((MTEHatchInput) aMetaTileEntity).mRecipeMap = aMap;
+ if (aTileEntity instanceof MTEHatchInput || aTileEntity instanceof MTEHatchInputBus
+ || aTileEntity instanceof MteHatchSteamBusInput) {
+ if (aTileEntity instanceof MTEHatchInput) {
+ ((MTEHatchInput) aTileEntity).mRecipeMap = null;
+ ((MTEHatchInput) aTileEntity).mRecipeMap = aMap;
if (aMap != null) {
log("Remapped Input Hatch to " + aMap.unlocalizedName + ".");
} else {
log("Cleared Input Hatch.");
}
- } else if (aMetaTileEntity instanceof MTEHatchInputBus) {
- ((MTEHatchInputBus) aMetaTileEntity).mRecipeMap = null;
- ((MTEHatchInputBus) aMetaTileEntity).mRecipeMap = aMap;
+ } else if (aTileEntity instanceof MTEHatchInputBus) {
+ ((MTEHatchInputBus) aTileEntity).mRecipeMap = null;
+ ((MTEHatchInputBus) aTileEntity).mRecipeMap = aMap;
if (aMap != null) {
log("Remapped Input Bus to " + aMap.unlocalizedName + ".");
} else {
log("Cleared Input Bus.");
}
} else {
- ((MteHatchSteamBusInput) aMetaTileEntity).mRecipeMap = null;
- ((MteHatchSteamBusInput) aMetaTileEntity).mRecipeMap = aMap;
+ ((MteHatchSteamBusInput) aTileEntity).mRecipeMap = null;
+ ((MteHatchSteamBusInput) aTileEntity).mRecipeMap = aMap;
if (aMap != null) {
log("Remapped Input Bus to " + aMap.unlocalizedName + ".");
} else {
@@ -997,8 +981,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
}
}
// Do Super
- boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, side, aX, aY, aZ);
- return aSuper;
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer, side, aX, aY, aZ);
}
public boolean onPlungerRightClick(EntityPlayer aPlayer, ForgeDirection side, float aX, float aY, float aZ) {
@@ -1371,8 +1354,7 @@ public abstract class GTPPMultiBlockBase<T extends MTEExtendedPowerMultiBlockBas
() -> StatCollector.translateToLocal("GTPP.multiblock.specialvalue") + ": "
+ EnumChatFormatting.RED
+ getLastRecipeEU()
- + EnumChatFormatting.RESET
- + "")
+ + EnumChatFormatting.RESET)
.setDefaultColor(COLOR_TEXT_WHITE.get())
.setEnabled(
widget -> mMachine && getLastRecipeEU() != 0
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java
index 6387624a1c..ed6432a58f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTEBoilerBase.java
@@ -225,7 +225,7 @@ public abstract class MTEBoilerBase extends MTEBasicTank {
}
if ((aTick % 10L) == 0L) {
if (this.mTemperature > 100) {
- if ((this.mFluid == null) || (!GTModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
+ if ((!GTModHandler.isWater(this.mFluid)) || (this.mFluid.amount <= 0)) {
this.mHadNoWater = true;
} else {
if (this.mHadNoWater) {
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java
index ae5e653de0..40678f203f 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/MTERocketFuelGeneratorBase.java
@@ -232,7 +232,7 @@ public abstract class MTERocketFuelGeneratorBase extends MTEBasicTank implements
if ((tFluidAmountToUse > 0)
&& aBaseMetaTileEntity.increaseStoredEnergyUnits(tFluidAmountToUse * tFuelValue, true)) {
int aSafeFloor = (int) Math.max(((tFluidAmountToUse * tConsumed) / 3), 1);
- this.mFluid.amount -= (int) aSafeFloor;
+ this.mFluid.amount -= aSafeFloor;
PollutionUtils.addPollution(getBaseMetaTileEntity(), 10 * getPollution());
}
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java
index b626bcc8ba..8cf42533c7 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchNbtConsumable.java
@@ -211,7 +211,7 @@ public abstract class MTEHatchNbtConsumable extends MTEHatch implements IAddGreg
// Then Move stack to Usage slots
for (int i = getSlotID_FirstUsage(); i <= getSlotID_LastUsage(); i++) {
if (mInventory[i] == null) {
- if ((aFoundMatching && aAllowMultiOfSameTypeInUsageSlots) || !aFoundMatching) {
+ if (!aFoundMatching || aAllowMultiOfSameTypeInUsageSlots) {
mInventory[i] = aStackToMove;
aDidSet = true;
Logger.INFO("Moving new stack to usage slots.");