diff options
Diffstat (limited to 'src/main/java/gregtech/common')
9 files changed, 43 insertions, 30 deletions
diff --git a/src/main/java/gregtech/common/GT_Worldgenerator.java b/src/main/java/gregtech/common/GT_Worldgenerator.java index 5b8432e43f..64f034c350 100644 --- a/src/main/java/gregtech/common/GT_Worldgenerator.java +++ b/src/main/java/gregtech/common/GT_Worldgenerator.java @@ -51,7 +51,8 @@ public class GT_Worldgenerator this.mList.add(new WorldGenContainer(new XSTR(aRandom.nextInt()), aX * 16, aZ * 16, ((aChunkGenerator instanceof ChunkProviderEnd)) || (aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8) == BiomeGenBase.sky) ? 1 : ((aChunkGenerator instanceof ChunkProviderHell)) || (aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8) == BiomeGenBase.hell) ? -1 : 0, aWorld, aChunkGenerator, aChunkProvider, aWorld.getBiomeGenForCoords(aX * 16 + 8, aZ * 16 + 8).biomeName));
if (!this.mIsGenerating) {
this.mIsGenerating = true;
- for (int i = 0; i < this.mList.size(); i++) {
+ int mList_sS=this.mList.size();
+ for (int i = 0; i < mList_sS; i++) {
((Runnable) this.mList.get(i)).run();
}
this.mList.clear();
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java index 105c39022a..38a9f6facd 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_DataStick.java @@ -24,8 +24,8 @@ public class Behaviour_DataStick tString = GT_Utility.ItemNBT.getPunchCardData(aStack);
if (GT_Utility.isStringValid(tString)) {
aList.add("Punch Card Data");
- int i = 0;
- for (int j = tString.length(); i < j; i += 64) {
+ int i = 0;int j = tString.length();
+ for (; i < j; i += 64) {
aList.add(tString.substring(i, Math.min(i + 64, j)));
}
}
diff --git a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java index efea09bce3..187027a563 100644 --- a/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java +++ b/src/main/java/gregtech/common/items/behaviors/Behaviour_Scanner.java @@ -22,7 +22,8 @@ public class Behaviour_Scanner if (((aPlayer instanceof EntityPlayerMP)) && (aItem.canUse(aStack, 20000.0D))) {
ArrayList<String> tList = new ArrayList();
if (aItem.use(aStack, GT_Utility.getCoordinateScan(tList, aPlayer, aWorld, 1, aX, aY, aZ, aSide, hitX, hitY, hitZ), aPlayer)) {
- for (int i = 0; i < tList.size(); i++) {
+ int tList_sS=tList.size();
+ for (int i = 0; i < tList_sS; i++) {
GT_Utility.sendChatToPlayer(aPlayer, (String) tList.get(i));
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java index a241817edb..493f4407b4 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_DistillationTower.java @@ -161,7 +161,8 @@ public class GT_MetaTileEntity_DistillationTower return false; } GT_MetaTileEntity_Hatch_Output[] tmpHatches = new GT_MetaTileEntity_Hatch_Output[5]; - for (int i = 0; i < this.mOutputHatches.size(); i++) { + int mOutputHatches_sS=this.mOutputHatches.size(); + for (int i = 0; i < mOutputHatches_sS; i++) { int hatchNumber = this.mOutputHatches.get(i).getBaseMetaTileEntity().getYCoord() - 1 - height; if (tmpHatches[hatchNumber] == null) { tmpHatches[hatchNumber] = this.mOutputHatches.get(i); diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java index 62189600eb..a341a47d80 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ElectricBlastFurnace.java @@ -1,8 +1,5 @@ package gregtech.common.tileentities.machines.multi;
-import java.util.ArrayList;
-import java.util.Arrays;
-
import gregtech.api.GregTech_API;
import gregtech.api.enums.Textures;
import gregtech.api.gui.GT_GUIContainer_MultiMachine;
@@ -18,6 +15,9 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
+import java.util.ArrayList;
+import java.util.Arrays;
+
public class GT_MetaTileEntity_ElectricBlastFurnace
extends GT_MetaTileEntity_MultiBlockBase {
private int mHeatingCapacity = 0;
@@ -72,13 +72,14 @@ public class GT_MetaTileEntity_ElectricBlastFurnace public boolean checkRecipe(ItemStack aStack) {
ArrayList<ItemStack> tInputList = getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
+ int tInputList_sS=tInputList.size();
+ for (int i = 0; i < tInputList_sS - 1; i++) {
+ for (int j = i + 1; j < tInputList_sS; j++) {
if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
- tInputList.remove(j--);
+ tInputList.remove(j--); tInputList_sS=tInputList.size();
} else {
- tInputList.remove(i--);
+ tInputList.remove(i--); tInputList_sS=tInputList.size();
break;
}
}
@@ -87,13 +88,14 @@ public class GT_MetaTileEntity_ElectricBlastFurnace ItemStack[] tInputs = (ItemStack[]) Arrays.copyOfRange(tInputList.toArray(new ItemStack[tInputList.size()]), 0, 2);
ArrayList<FluidStack> tFluidList = getStoredFluids();
- for (int i = 0; i < tFluidList.size() - 1; i++) {
- for (int j = i + 1; j < tFluidList.size(); j++) {
+ int tFluidList_sS=tFluidList.size();
+ for (int i = 0; i < tFluidList_sS - 1; i++) {
+ for (int j = i + 1; j < tFluidList_sS; j++) {
if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) {
if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) {
- tFluidList.remove(j--);
+ tFluidList.remove(j--); tFluidList_sS=tFluidList.size();
} else {
- tFluidList.remove(i--);
+ tFluidList.remove(i--); tFluidList_sS=tFluidList.size();
break;
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java index 7d950a490b..9022cddfc2 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_FusionComputer.java @@ -104,19 +104,22 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity && (addIfInjector(xCenter - 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (addIfInjector(xCenter + 6, yCenter - 1, zCenter - 1, aBaseMetaTileEntity)) && (this.mEnergyHatches.size() >= 1) && (this.mOutputHatches.size() >= 1) && (this.mInputHatches.size() >= 2)) { if (this.mEnergyHatches != null) { - for (int i = 0; i < this.mEnergyHatches.size(); i++) { + int mEnergyHatches_sS=this.mEnergyHatches.size(); + for (int i = 0; i < mEnergyHatches_sS; i++) { if (this.mEnergyHatches.get(i).mTier < tier()) return false; } } if (this.mOutputHatches != null) { - for (int i = 0; i < this.mOutputHatches.size(); i++) { + int mOutputHatches_sS=this.mOutputHatches.size(); + for (int i = 0; i < mOutputHatches_sS; i++) { if (this.mOutputHatches.get(i).mTier < tier()) return false; } } if (this.mInputHatches != null) { - for (int i = 0; i < this.mInputHatches.size(); i++) { + int mInputHatches_sS=this.mInputHatches.size(); + for (int i = 0; i < mInputHatches_sS; i++) { if (this.mInputHatches.get(i).mTier < tier()) return false; } @@ -134,7 +137,8 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity private boolean checkTier(byte tier, ArrayList<GT_MetaTileEntity_Hatch> list) { if (list != null) { - for (int i = 0; i < list.size(); i++) { + int list_sS=list.size(); + for (int i = 0; i < list_sS; i++) { if (list.get(i).mTier < tier) { return false; } @@ -250,13 +254,14 @@ public abstract class GT_MetaTileEntity_FusionComputer extends GT_MetaTileEntity @Override public boolean checkRecipe(ItemStack aStack) { ArrayList<FluidStack> tFluidList = getStoredFluids(); - for (int i = 0; i < tFluidList.size() - 1; i++) { - for (int j = i + 1; j < tFluidList.size(); j++) { + int tFluidList_sS=tFluidList.size(); + for (int i = 0; i < tFluidList_sS - 1; i++) { + for (int j = i + 1; j < tFluidList_sS; j++) { if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i), (FluidStack) tFluidList.get(j))) { if (((FluidStack) tFluidList.get(i)).amount >= ((FluidStack) tFluidList.get(j)).amount) { - tFluidList.remove(j--); + tFluidList.remove(j--); tFluidList_sS=tFluidList.size(); } else { - tFluidList.remove(i--); + tFluidList.remove(i--); tFluidList_sS=tFluidList.size(); break; } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java index 6d61e2b01f..c5f6f11122 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_ImplosionCompressor.java @@ -69,13 +69,14 @@ public class GT_MetaTileEntity_ImplosionCompressor public boolean checkRecipe(ItemStack aStack) {
ArrayList<ItemStack> tInputList = getStoredInputs();
- for (int i = 0; i < tInputList.size() - 1; i++) {
- for (int j = i + 1; j < tInputList.size(); j++) {
+ int tInputList_sS=tInputList.size();
+ for (int i = 0; i < tInputList_sS - 1; i++) {
+ for (int j = i + 1; j < tInputList_sS; j++) {
if (GT_Utility.areStacksEqual((ItemStack) tInputList.get(i), (ItemStack) tInputList.get(j))) {
if (((ItemStack) tInputList.get(i)).stackSize >= ((ItemStack) tInputList.get(j)).stackSize) {
- tInputList.remove(j--);
+ tInputList.remove(j--); tInputList_sS=tInputList.size();
} else {
- tInputList.remove(i--);
+ tInputList.remove(i--); tInputList_sS=tInputList.size();
break;
}
}
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java index c5507e0bde..596ff5ec3b 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Gas.java @@ -95,7 +95,8 @@ public class GT_MetaTileEntity_LargeTurbine_Gas extends GT_MetaTileEntity_LargeT int flow = 0; int totalFlow = 0; - for (int i = 0; i < aFluids.size(); i++) { + int aFluids_sS=aFluids.size(); + for (int i = 0; i < aFluids_sS; i++) { if (aFluids.get(i).isFluidEqual(firstFuelType)) { flow = aFluids.get(i).amount; // Get all (steam) in hatch flow = Math.min(flow, Math.min(remainingFlow, (int) (actualOptimalFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java index 923eaabcdb..73b87ec7cb 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_LargeTurbine_Plasma.java @@ -99,7 +99,8 @@ public class GT_MetaTileEntity_LargeTurbine_Plasma extends GT_MetaTileEntity_Lar int flow = 0; int totalFlow = 0; - for (int i = 0; i < aFluids.size(); i++) { + int aFluids_sS=aFluids.size(); + for (int i = 0; i < aFluids_sS; i++) { if (aFluids.get(i).isFluidEqual(firstFuelType)) { flow = aFluids.get(i).amount; // Get all (steam) in hatch flow = Math.min(flow, Math.min(remainingFlow, (int) (actualOptimalFlow * 1.25f))); // try to use up to 125% of optimal flow w/o exceeding remainingFlow |