For loop changes
This commit is contained in:
parent
ce1195d48c
commit
7d3615d74a
16 changed files with 94 additions and 76 deletions
|
@ -348,7 +348,8 @@ public class GT_Mod
|
|||
List<ModContainer> tModList = tLoadController.getActiveModList();
|
||||
List<ModContainer> tNewModsList = new ArrayList();
|
||||
ModContainer tGregTech = null;
|
||||
for (short i = 0; i < tModList.size(); i = (short) (i + 1)) {
|
||||
short tModList_sS= (short) tModList.size();
|
||||
for (short i = 0; i < tModList_sS; i = (short) (i + 1)) {
|
||||
ModContainer tMod = (ModContainer) tModList.get(i);
|
||||
if (tMod.getModId().equalsIgnoreCase("gregtech")) {
|
||||
tGregTech = tMod;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package gregtech.api.enums;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import gregtech.api.GregTech_API;
|
||||
import gregtech.api.enums.TC_Aspects.TC_AspectStack;
|
||||
|
@ -17,6 +15,8 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static gregtech.api.enums.GT_Values.M;
|
||||
import static gregtech.api.enums.GT_Values.MOD_ID_TC;
|
||||
|
||||
|
@ -1506,7 +1506,8 @@ public enum Materials implements IColorModulationContainer, ISubTagContainer {
|
|||
public boolean remove(ItemStack aStack) {
|
||||
if (aStack == null) return false;
|
||||
boolean temp = false;
|
||||
for (int i = 0; i < mMaterialItems.size(); i++)
|
||||
int mMaterialItems_sS=mMaterialItems.size();
|
||||
for (int i = 0; i < mMaterialItems_sS; i++)
|
||||
if (GT_Utility.areStacksEqual(aStack, mMaterialItems.get(i))) {
|
||||
mMaterialItems.remove(i--);
|
||||
temp = true;
|
||||
|
|
|
@ -299,7 +299,8 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item var1, CreativeTabs aCreativeTab, List aList) {
|
||||
for (int i = 0, j = mEnabledItems.length(); i < j; i++)
|
||||
int j = mEnabledItems.length();
|
||||
for (int i = 0; i < j; i++)
|
||||
if (mVisibleItems.get(i) || (D1 && mEnabledItems.get(i))) {
|
||||
Long[] tStats = mElectricStats.get((short) (mOffset + i));
|
||||
if (tStats != null && tStats[3] < 0) {
|
||||
|
@ -319,7 +320,8 @@ public abstract class GT_MetaGenerated_Item extends GT_MetaBase_Item implements
|
|||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public final void registerIcons(IIconRegister aIconRegister) {
|
||||
for (short i = 0, j = (short) mEnabledItems.length(); i < j; i++)
|
||||
short j = (short) mEnabledItems.length();
|
||||
for (short i = 0; i < j; i++)
|
||||
if (mEnabledItems.get(i)) {
|
||||
for (byte k = 1; k < mIconList[i].length; k++) {
|
||||
mIconList[i][k] = aIconRegister.registerIcon(RES_PATH_ITEM + (GT_Config.troll ? "troll" : getUnlocalizedName() + "/" + i + "/" + k));
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.Collection;
|
|||
|
||||
public class GT_ArrayList<E> extends ArrayList<E> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private int size_sS;
|
||||
|
||||
private final boolean mAllowNulls;
|
||||
|
||||
|
@ -17,13 +18,13 @@ public class GT_ArrayList<E> extends ArrayList<E> {
|
|||
public GT_ArrayList(boolean aAllowNulls, E... aArray) {
|
||||
super(Arrays.asList(aArray));
|
||||
mAllowNulls = aAllowNulls;
|
||||
if (!mAllowNulls) for (int i = 0; i < size(); i++) if (get(i) == null) remove(i--);
|
||||
if (!mAllowNulls) {size_sS=size(); for (int i = 0; i < size_sS; i++) if (get(i) == null) {remove(i--);size_sS=size();}}
|
||||
}
|
||||
|
||||
public GT_ArrayList(boolean aAllowNulls, Collection<? extends E> aList) {
|
||||
super(aList);
|
||||
mAllowNulls = aAllowNulls;
|
||||
if (!mAllowNulls) for (int i = 0; i < size(); i++) if (get(i) == null) remove(i--);
|
||||
if (!mAllowNulls) {size_sS=size(); for (int i = 0; i < size_sS; i++) if (get(i) == null) {remove(i--);size_sS=size();}}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -46,14 +47,14 @@ public class GT_ArrayList<E> extends ArrayList<E> {
|
|||
@Override
|
||||
public boolean addAll(Collection<? extends E> aList) {
|
||||
boolean rReturn = super.addAll(aList);
|
||||
if (!mAllowNulls) for (int i = 0; i < size(); i++) if (get(i) == null) remove(i--);
|
||||
if (!mAllowNulls) {size_sS=size(); for (int i = 0; i < size_sS; i++) if (get(i) == null) {remove(i--);size_sS=size();}}
|
||||
return rReturn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(int aIndex, Collection<? extends E> aList) {
|
||||
boolean rReturn = super.addAll(aIndex, aList);
|
||||
if (!mAllowNulls) for (int i = 0; i < size(); i++) if (get(i) == null) remove(i--);
|
||||
if (!mAllowNulls) {size_sS=size(); for (int i = 0; i < size_sS; i++) if (get(i) == null) {remove(i--);size_sS=size();}}
|
||||
return rReturn;
|
||||
}
|
||||
}
|
|
@ -951,11 +951,12 @@ public class GT_ModHandler {
|
|||
|
||||
if (aOnlyAddIfThereIsAnyRecipeOutputtingThis && !tThereWasARecipe) {
|
||||
ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
|
||||
for (int i = 0; i < tList.size() && !tThereWasARecipe; i++) {
|
||||
int tList_sS=tList.size();
|
||||
for (int i = 0; i < tList_sS && !tThereWasARecipe; i++) {
|
||||
IRecipe tRecipe = tList.get(i);
|
||||
if (sSpecialRecipeClasses.contains(tRecipe.getClass().getName())) continue;
|
||||
if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tRecipe.getRecipeOutput()), aResult, true)) {
|
||||
tList.remove(i--);
|
||||
tList.remove(i--); tList_sS=tList.size();
|
||||
tThereWasARecipe = true;
|
||||
}
|
||||
}
|
||||
|
@ -1091,18 +1092,16 @@ public class GT_ModHandler {
|
|||
}, 3, 3);
|
||||
for (int i = 0; i < aRecipe.length && i < 9; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
|
||||
ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
|
||||
for (int i = 0; i < tList.size(); i++) {
|
||||
try {
|
||||
for (; i < tList.size(); i++) {
|
||||
int tList_sS=tList.size();
|
||||
try {
|
||||
for (int i = 0; i < tList_sS; i++) {
|
||||
for (; i < tList_sS; i++) {
|
||||
if ((!(tList.get(i) instanceof IGT_CraftingRecipe) || ((IGT_CraftingRecipe) tList.get(i)).isRemovable()) && tList.get(i).matches(aCrafting, DW)) {
|
||||
rReturn = tList.get(i).getCraftingResult(aCrafting);
|
||||
if (rReturn != null) tList.remove(i--);
|
||||
if (rReturn != null) tList.remove(i--); tList_sS=tList.size();
|
||||
}
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
}
|
||||
}} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
return rReturn;
|
||||
}
|
||||
|
||||
|
@ -1121,7 +1120,8 @@ public class GT_ModHandler {
|
|||
boolean rReturn = false;
|
||||
ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
|
||||
aOutput = GT_OreDictUnificator.get(aOutput);
|
||||
for (int i = 0; i < tList.size(); i++) {
|
||||
int tList_sS=tList.size();
|
||||
for (int i = 0; i < tList_sS; i++) {
|
||||
IRecipe tRecipe = tList.get(i);
|
||||
if (aNotRemoveShapelessRecipes && (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe))
|
||||
continue;
|
||||
|
@ -1132,7 +1132,7 @@ public class GT_ModHandler {
|
|||
}
|
||||
ItemStack tStack = tRecipe.getRecipeOutput();
|
||||
if ((!(tRecipe instanceof IGT_CraftingRecipe) || ((IGT_CraftingRecipe) tRecipe).isRemovable()) && GT_Utility.areStacksEqual(GT_OreDictUnificator.get(tStack), aOutput, aIgnoreNBT)) {
|
||||
tList.remove(i--);
|
||||
tList.remove(i--); tList_sS=tList.size();
|
||||
rReturn = true;
|
||||
}
|
||||
}
|
||||
|
@ -1169,11 +1169,12 @@ public class GT_ModHandler {
|
|||
sAllRecipeList.clear();
|
||||
sAllRecipeList.addAll(tList);
|
||||
}
|
||||
for (int i = 0, j = sAllRecipeList.size(); i < j; i++) {
|
||||
int sAllRecipeList_sS=sAllRecipeList.size();
|
||||
for (int i = 0, j = sAllRecipeList_sS; i < j; i++) {
|
||||
IRecipe tRecipe = sAllRecipeList.get(i);
|
||||
if (tRecipe.matches(aCrafting, aWorld)) {
|
||||
if (i > 10) {
|
||||
sAllRecipeList.remove(i);
|
||||
sAllRecipeList.remove(i); sAllRecipeList_sS=sAllRecipeList.size();
|
||||
sAllRecipeList.add(i - 10, tRecipe);
|
||||
}
|
||||
return tRecipe.getCraftingResult(aCrafting);
|
||||
|
@ -1233,13 +1234,11 @@ public class GT_ModHandler {
|
|||
}, 3, 3);
|
||||
for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
|
||||
ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList();
|
||||
for (int i = 0; i < tList.size(); i++) {
|
||||
int tList_sS=tList.size();
|
||||
try {
|
||||
for (int i = 0; i < tList_sS; i++) {
|
||||
temp = false;
|
||||
try {
|
||||
temp = tList.get(i).matches(aCrafting, DW);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
temp = tList.get(i).matches(aCrafting, DW);
|
||||
if (temp) {
|
||||
ItemStack tOutput = aUncopiedStack ? tList.get(i).getRecipeOutput() : tList.get(i).getCraftingResult(aCrafting);
|
||||
if (tOutput == null || tOutput.stackSize <= 0) {
|
||||
|
@ -1251,7 +1250,7 @@ public class GT_ModHandler {
|
|||
return GT_Utility.copy(tOutput);
|
||||
}
|
||||
}
|
||||
}
|
||||
}} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1335,13 +1334,11 @@ public class GT_ModHandler {
|
|||
}
|
||||
}, 3, 3);
|
||||
for (int i = 0; i < 9 && i < aRecipe.length; i++) aCrafting.setInventorySlotContents(i, aRecipe[i]);
|
||||
for (int i = 0; i < aList.size(); i++) {
|
||||
int aList_sS=aList.size();
|
||||
try {
|
||||
for (int i = 0; i < aList_sS; i++) {
|
||||
temp = false;
|
||||
try {
|
||||
temp = aList.get(i).matches(aCrafting, DW);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(GT_Log.err);
|
||||
}
|
||||
temp = aList.get(i).matches(aCrafting, DW);
|
||||
if (temp) {
|
||||
ItemStack tOutput = aList.get(i).getCraftingResult(aCrafting);
|
||||
if (tOutput == null || tOutput.stackSize <= 0) {
|
||||
|
@ -1350,10 +1347,10 @@ public class GT_ModHandler {
|
|||
throw new GT_ItsNotMyFaultException("Seems another Mod added a Crafting Recipe with null Output. Tell the Developer of said Mod to fix that.");
|
||||
} else {
|
||||
rList.add(GT_Utility.copy(tOutput));
|
||||
if (aDeleteFromList) aList.remove(i--);
|
||||
if (aDeleteFromList) aList.remove(i--); aList_sS=aList.size();
|
||||
}
|
||||
}
|
||||
}
|
||||
}} catch (Throwable e) {e.printStackTrace(GT_Log.err);}
|
||||
return rList;
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
package gregtech.loaders.misc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
|
@ -33,6 +29,10 @@ import net.minecraftforge.event.entity.player.EntityItemPickupEvent;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class GT_Achievements {
|
||||
|
||||
public static List<Materials> oreList = new ArrayList<Materials>();
|
||||
|
@ -46,7 +46,8 @@ public class GT_Achievements {
|
|||
public GT_Achievements() {
|
||||
this.achievementList = new HashMap();
|
||||
this.issuedAchievements = new HashMap();
|
||||
for (int i = 0; i < oreList.size(); i++) {
|
||||
int oreList_sS=oreList.size();
|
||||
for (int i = 0; i < oreList_sS; i++) {
|
||||
if (GT_Values.D1 && this.achievementList.get(oreList.get(i).name()) == null) {
|
||||
GT_Log.out.println("achievement." + oreList.get(i).name() + "=Find " + oreList.get(i).name() + " Ore");
|
||||
|
||||
|
@ -497,7 +498,8 @@ public class GT_Achievements {
|
|||
}
|
||||
} else if (data.mPrefix == OrePrefixes.ore || data.mPrefix == OrePrefixes.oreBlackgranite || data.mPrefix == OrePrefixes.oreEndstone
|
||||
|| data.mPrefix == OrePrefixes.oreNetherrack || data.mPrefix == OrePrefixes.oreRedgranite) {
|
||||
for (int i = 0; i < data.getAllMaterialStacks().size(); i++) {
|
||||
int data_getAllMaterialStacks_sS=data.getAllMaterialStacks().size();
|
||||
for (int i = 0; i < data_getAllMaterialStacks_sS; i++) {
|
||||
issueAchievement(player, data.getAllMaterialStacks().get(i).mMaterial.name());
|
||||
if (data.getAllMaterialStacks().get(i).mMaterial == Materials.AnyIron) {
|
||||
issueAchievement(player, "iron");
|
||||
|
|
|
@ -88,7 +88,8 @@ public class ProcessingDust implements gregtech.api.interfaces.IOreRecipeRegistr
|
|||
tItemAmount = (tItemAmount * tDensityMultiplier % aMaterial.getDensity() > 0L ? 1 : 0) + tItemAmount * tDensityMultiplier / aMaterial.getDensity();
|
||||
if (tList.size() > 0) {
|
||||
FluidStack tFluid = null;
|
||||
for (int i = 0; i < tList.size(); i++) {
|
||||
int tList_sS=tList.size();
|
||||
for (int i = 0; i < tList_sS; i++) {
|
||||
if ((!ItemList.Cell_Air.isStackEqual(tList.get(i))) && ((tFluid = GT_Utility.getFluidForFilledItem((ItemStack) tList.get(i), true)) != null)) {
|
||||
tFluid.amount *= ((ItemStack) tList.get(i)).stackSize;
|
||||
tCapsuleCount -= GT_ModHandler.getCapsuleCellContainerCountMultipliedWithStackSize(new ItemStack[]{(ItemStack) tList.get(i)});
|
||||
|
|
Loading…
Reference in a new issue