diff options
Diffstat (limited to 'src/main/java')
82 files changed, 873 insertions, 1368 deletions
diff --git a/src/main/java/gregtech/api/enums/TAE.java b/src/main/java/gregtech/api/enums/TAE.java index 79d3037a5a..48a39da036 100644 --- a/src/main/java/gregtech/api/enums/TAE.java +++ b/src/main/java/gregtech/api/enums/TAE.java @@ -6,7 +6,6 @@ import java.util.HashSet; import gregtech.api.interfaces.ITexture; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -53,22 +52,22 @@ public class TAE { } public static void finalizeTAE() { - String aFreeSpaces = ""; - String aPageAndSlotFree = ""; - AutoMap<Integer> aTemp = new AutoMap<>(mFreeSlots); + StringBuilder aFreeSpaces = new StringBuilder(); + StringBuilder aPageAndSlotFree = new StringBuilder(); + Integer[] aTemp = mFreeSlots.toArray(new Integer[] {}); for (int i = 0; i < mFreeSlots.size(); i++) { - int j = aTemp.get(i); - aFreeSpaces += j; - aPageAndSlotFree += getPageFromIndex(j); + int j = aTemp[i]; + aFreeSpaces.append(j); + aPageAndSlotFree.append(getPageFromIndex(j)); if (i != (mFreeSlots.size() - 1)) { - aFreeSpaces += ", "; - aPageAndSlotFree += ", "; + aFreeSpaces.append(", "); + aPageAndSlotFree.append(", "); } } Logger.INFO("Free Indexes within TAE: " + aFreeSpaces); Logger.INFO("Free Page slots within TAE: " + aPageAndSlotFree); Logger.INFO("Filling them with ERROR textures."); - for (int aFreeSlot : aTemp.values()) { + for (int aFreeSlot : aTemp) { registerTexture(aFreeSlot, new GTPPCopiedBlockTexture(ModBlocks.blockCasingsTieredGTPP, 1, 15)); } Logger.INFO("Finalising TAE."); diff --git a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java index 8f36600e2a..2deb38dccf 100644 --- a/src/main/java/gregtech/api/util/FishPondFakeRecipe.java +++ b/src/main/java/gregtech/api/util/FishPondFakeRecipe.java @@ -11,7 +11,6 @@ import net.minecraftforge.common.FishingHooks; import gregtech.api.enums.GTValues; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; @@ -36,13 +35,13 @@ public class FishPondFakeRecipe { e.printStackTrace(); } - AutoMap<ArrayList<WeightedRandomFishable>> mega = new AutoMap<>(); - mega.put(fish); - mega.put(junk); - mega.put(treasure); + ArrayList<ArrayList<WeightedRandomFishable>> mega = new ArrayList<>(); + mega.add(fish); + mega.add(junk); + mega.add(treasure); int mType = 14; - for (ArrayList<WeightedRandomFishable> f : mega.values()) { + for (ArrayList<WeightedRandomFishable> f : mega) { for (WeightedRandomFishable weightedRandomFishable : f) { if (weightedRandomFishable != null) { WeightedRandomFishable u = weightedRandomFishable; diff --git a/src/main/java/gregtech/api/util/GasSpargingRecipe.java b/src/main/java/gregtech/api/util/GasSpargingRecipe.java index 527359e0e8..0e8deb285b 100644 --- a/src/main/java/gregtech/api/util/GasSpargingRecipe.java +++ b/src/main/java/gregtech/api/util/GasSpargingRecipe.java @@ -1,9 +1,10 @@ package gregtech.api.util; +import java.util.ArrayList; + import net.minecraftforge.fluids.FluidStack; import gregtech.api.enums.TierEU; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.data.ArrayUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -92,12 +93,11 @@ public class GasSpargingRecipe implements Comparable<GasSpargingRecipe> { } public String[] getRecipeInfo() { - AutoMap<String> result = new AutoMap<>(); - result.put("Input " + ItemUtils.getArrayStackNames(mFluidInputs)); - result.put("Output " + ItemUtils.getArrayStackNames(mFluidOutputs)); - result.put("Duration: " + mDuration); - result.put("EU/t: " + mEUt); - String s[] = result.toArray(); - return s; + ArrayList<String> result = new ArrayList<>(); + result.add("Input " + ItemUtils.getArrayStackNames(mFluidInputs)); + result.add("Output " + ItemUtils.getArrayStackNames(mFluidOutputs)); + result.add("Duration: " + mDuration); + result.add("EU/t: " + mEUt); + return result.toArray(new String[] {}); } } diff --git a/src/main/java/gregtech/api/util/GasSpargingRecipeMap.java b/src/main/java/gregtech/api/util/GasSpargingRecipeMap.java index 6dcc7721e0..ece9c024e4 100644 --- a/src/main/java/gregtech/api/util/GasSpargingRecipeMap.java +++ b/src/main/java/gregtech/api/util/GasSpargingRecipeMap.java @@ -2,15 +2,14 @@ package gregtech.api.util; import static gregtech.api.enums.Mods.GregTech; -import net.minecraftforge.fluids.FluidStack; +import java.util.HashSet; -import gtPlusPlus.api.objects.data.AutoMap; +import net.minecraftforge.fluids.FluidStack; -public class GasSpargingRecipeMap extends AutoMap<GasSpargingRecipe> { +public class GasSpargingRecipeMap { - public static final AutoMap<GasSpargingRecipe> mRecipes = new AutoMap<>(); + public static final HashSet<GasSpargingRecipe> mRecipes = new HashSet<>(); public static final String mUnlocalizedName = "gtpp.recipe.lftr.sparging"; - public static final String mNEIName = mUnlocalizedName; public static final String mNEIDisplayName = "LFTR Gas Sparging"; public static final String mNEIGUIPath = GregTech.getResourcePath("textures", "gui/basicmachines/FissionFuel.png"); @@ -30,7 +29,7 @@ public class GasSpargingRecipeMap extends AutoMap<GasSpargingRecipe> { } int aMapSize = mRecipes.size(); GasSpargingRecipe aRecipe = new GasSpargingRecipe(aSpargeGas, aSpentFuel, aSpargedFuel, aOutputs, aMaxOutputs); - mRecipes.put(aRecipe); + mRecipes.add(aRecipe); return mRecipes.size() > aMapSize; } diff --git a/src/main/java/gtPlusPlus/GTplusplus.java b/src/main/java/gtPlusPlus/GTplusplus.java index ef6b1759e9..8823304e89 100644 --- a/src/main/java/gtPlusPlus/GTplusplus.java +++ b/src/main/java/gtPlusPlus/GTplusplus.java @@ -280,25 +280,25 @@ public class GTplusplus implements ActionListener { } private static void setupMaterialBlacklist() { - Material.invalidMaterials.put(Materials._NULL); - Material.invalidMaterials.put(Materials.Clay); - Material.invalidMaterials.put(Materials.Phosphorus); - Material.invalidMaterials.put(Materials.Steel); - Material.invalidMaterials.put(Materials.Bronze); - Material.invalidMaterials.put(Materials.Hydrogen); + Material.invalidMaterials.add(Materials._NULL); + Material.invalidMaterials.add(Materials.Clay); + Material.invalidMaterials.add(Materials.Phosphorus); + Material.invalidMaterials.add(Materials.Steel); + Material.invalidMaterials.add(Materials.Bronze); + Material.invalidMaterials.add(Materials.Hydrogen); // Infused TC stuff - Material.invalidMaterials.put(Materials.InfusedAir); - Material.invalidMaterials.put(Materials.InfusedEarth); - Material.invalidMaterials.put(Materials.InfusedFire); - Material.invalidMaterials.put(Materials.InfusedWater); + Material.invalidMaterials.add(Materials.InfusedAir); + Material.invalidMaterials.add(Materials.InfusedEarth); + Material.invalidMaterials.add(Materials.InfusedFire); + Material.invalidMaterials.add(Materials.InfusedWater); // EIO Materials - Material.invalidMaterials.put(Materials.SoulSand); - Material.invalidMaterials.put(Materials.EnderPearl); - Material.invalidMaterials.put(Materials.EnderEye); - Material.invalidMaterials.put(Materials.Redstone); - Material.invalidMaterials.put(Materials.Glowstone); - Material.invalidMaterials.put(Materials.Soularium); - Material.invalidMaterials.put(Materials.PhasedIron); + Material.invalidMaterials.add(Materials.SoulSand); + Material.invalidMaterials.add(Materials.EnderPearl); + Material.invalidMaterials.add(Materials.EnderEye); + Material.invalidMaterials.add(Materials.Redstone); + Material.invalidMaterials.add(Materials.Glowstone); + Material.invalidMaterials.add(Materials.Soularium); + Material.invalidMaterials.add(Materials.PhasedIron); } diff --git a/src/main/java/gtPlusPlus/api/objects/data/AutoMap.java b/src/main/java/gtPlusPlus/api/objects/data/AutoMap.java deleted file mode 100644 index 4de2e9ab78..0000000000 --- a/src/main/java/gtPlusPlus/api/objects/data/AutoMap.java +++ /dev/null @@ -1,356 +0,0 @@ -package gtPlusPlus.api.objects.data; - -import java.io.Serializable; -import java.util.Collection; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.ListIterator; -import java.util.Map; -import java.util.Queue; -import java.util.Set; - -public class AutoMap<V> implements Iterable<V>, Cloneable, Serializable, Collection<V>, Queue<V>, List<V> { - - /** - * The Internal Map - */ - protected final Map<Integer, V> mInternalMap; - - protected final Map<String, Integer> mInternalNameMap; - - /** - * The Internal ID - */ - private int mInternalID = 0; - - private static final long serialVersionUID = 3771412318075131790L; - - public AutoMap() { - this(new LinkedHashMap<>()); - } - - public Map<Integer, V> getMap() { - return mInternalMap; - } - - public AutoMap(Map<Integer, V> defaultMapType) { - mInternalMap = defaultMapType; - mInternalNameMap = new LinkedHashMap<>(); - } - - /** - * Generates an AutoMap from the List. - * - * @param aList - Data to be inserted into the AutoMap. - */ - public AutoMap(List<V> aList) { - mInternalMap = new LinkedHashMap<>(); - mInternalNameMap = new LinkedHashMap<>(); - if (aList != null && !aList.isEmpty()) { - for (V obj : aList) { - add(obj); - } - } - } - - /** - * Generates an AutoMap from a Set. - * - * @param aList - Data to be inserted into the AutoMap. - */ - public AutoMap(Set<V> aList) { - mInternalMap = new LinkedHashMap<>(); - mInternalNameMap = new LinkedHashMap<>(); - if (aList != null && !aList.isEmpty()) { - for (V obj : aList) { - add(obj); - } - } - } - - /** - * Generates an AutoMap from a Collection. - * - * @param aList - Data to be inserted into the AutoMap. - */ - public AutoMap(Collection<V> aList) { - mInternalMap = new LinkedHashMap<>(); - mInternalNameMap = new LinkedHashMap<>(); - if (aList != null && !aList.isEmpty()) { - for (V obj : aList) { - add(obj); - } - } - } - - /** - * Generates an AutoMap from a Array. - * - * @param aArray - Data to be inserted into the AutoMap. - */ - public AutoMap(V[] aArray) { - mInternalMap = new LinkedHashMap<>(); - mInternalNameMap = new LinkedHashMap<>(); - if (aArray != null) { - for (V obj : aArray) { - add(obj); - } - } - } - - @Override - public Iterator<V> iterator() { - return values().iterator(); - } - - public synchronized boolean setValue(V object) { - int mOriginalID = this.mInternalID; - put(object); - return this.mInternalMap.get(mOriginalID) - .equals(object) || mOriginalID > this.mInternalID; - } - - public synchronized V put(V object) { - return set(object); - } - - @Override - public synchronized boolean add(V object) { - return set(object) != null; - } - - public synchronized V set(V object) { - if (object == null) { - return null; - } - mInternalNameMap.put("" + object.hashCode(), (mInternalID + 1)); - return mInternalMap.put(mInternalID++, object); - } - - @Override - public synchronized V get(int id) { - return mInternalMap.get(id); - } - - public synchronized Collection<V> values() { - return mInternalMap.values(); - } - - @Override - public synchronized int size() { - return mInternalMap.size(); - } - - public synchronized int hashCode() { - return mInternalMap.hashCode(); - } - - public synchronized boolean containsKey(int key) { - return mInternalMap.containsKey(key); - } - - public synchronized boolean containsValue(V value) { - return mInternalMap.containsValue(value); - } - - @Override - public synchronized boolean isEmpty() { - return mInternalMap.isEmpty(); - } - - @Override - public synchronized void clear() { - this.mInternalID = 0; - this.mInternalMap.clear(); - this.mInternalNameMap.clear(); - } - - @Override - @SuppressWarnings("unchecked") - public V[] toArray() { - V[] toR = (V[]) java.lang.reflect.Array.newInstance( - mInternalMap.get(0) - .getClass(), - mInternalMap.size()); - for (int i = 0; i < mInternalMap.size(); i++) { - toR[i] = mInternalMap.get(i); - } - return toR; - } - - public final synchronized int getInternalID() { - return mInternalID; - } - - @Override - public final synchronized boolean remove(Object value) { - value.getClass(); - if (this.mInternalMap.containsValue(value)) { - return this.mInternalMap.remove(mInternalNameMap.get("" + value.hashCode()), value); - } - return false; - } - - @Override - public boolean contains(Object o) { - for (V g : this.mInternalMap.values()) { - if (g.equals(o)) { - return true; - } - } - return false; - } - - @SuppressWarnings("unchecked") - @Override - public <V> V[] toArray(V[] a) { - return (V[]) toArray(); - } - - @Override - public boolean containsAll(Collection<?> c) { - boolean aTrue = true; - for (Object g : c) { - if (!this.contains(g)) { - aTrue = false; - } - } - return aTrue; - } - - @Override - public boolean addAll(Collection<? extends V> c) { - boolean aTrue = true; - for (V g : c) { - if (!this.add(g)) { - aTrue = false; - } - } - return aTrue; - } - - @Override - public boolean removeAll(Collection<?> c) { - boolean aTrue = true; - for (Object g : c) { - if (!this.remove(g)) { - aTrue = false; - } - } - return aTrue; - } - - @Override - public boolean retainAll(Collection<?> c) { - AutoMap<?> aTempAllocation = new AutoMap<>(); - boolean aTrue = false; - aTempAllocation = this; - aTempAllocation.removeAll(c); - aTempAllocation.clear(); - aTrue = aTempAllocation.isEmpty(); - aTempAllocation.clear(); - return aTrue; - } - - @Override - public boolean offer(V e) { - return add(e); - } - - @Override - public V remove() { - V y = this.get(0); - if (remove(y)) return y; - else return null; - } - - @Override - public V poll() { - if (this.mInternalMap.isEmpty()) { - return null; - } - return remove(); - } - - @Override - public V element() { - if (this.mInternalMap.isEmpty()) { - return null; - } - return this.get(0); - } - - @Override - public V peek() { - return element(); - } - - @Override - public boolean addAll(int index, Collection<? extends V> c) { - for (V y : c) { - add(y); - } - return true; - } - - @Override - public V set(int index, V element) { - return mInternalMap.put(index, element); - } - - @Override - public void add(int index, V element) { - add(element); - } - - @Override - public V remove(int index) { - V h = mInternalMap.get(index); - set(index, null); - return h; - } - - @Override - public int indexOf(Object o) { - int aCount = 0; - for (V of : mInternalMap.values()) { - if (of != o) { - aCount++; - } else { - return aCount; - } - } - return -1; - } - - @Override - public int lastIndexOf(Object o) { - // TODO - return indexOf(o); - } - - @Override - public ListIterator<V> listIterator() { - // TODO Auto-generated method stub - return null; - } - - @Override - public ListIterator<V> listIterator(int index) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List<V> subList(int fromIndex, int toIndex) { - AutoMap<V> aNewSubList = new AutoMap<>(); - for (int slot = fromIndex; slot <= toIndex; slot++) { - V obj = mInternalMap.get(slot); - if (obj != null) { - aNewSubList.put(obj); - } - } - return aNewSubList; - } -} diff --git a/src/main/java/gtPlusPlus/api/objects/data/weakref/WeakAutoMap.java b/src/main/java/gtPlusPlus/api/objects/data/weakref/WeakAutoMap.java deleted file mode 100644 index 199d20e06a..0000000000 --- a/src/main/java/gtPlusPlus/api/objects/data/weakref/WeakAutoMap.java +++ /dev/null @@ -1,14 +0,0 @@ -package gtPlusPlus.api.objects.data.weakref; - -import java.util.WeakHashMap; - -import gtPlusPlus.api.objects.data.AutoMap; - -public class WeakAutoMap<T> extends AutoMap<T> { - - private static final long serialVersionUID = 8328345351801363386L; - - public WeakAutoMap() { - super(new WeakHashMap<>()); - } -} diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java b/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java index 3853f61793..047b5dbeaf 100644 --- a/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java +++ b/src/main/java/gtPlusPlus/api/objects/minecraft/BlockPos.java @@ -1,6 +1,7 @@ package gtPlusPlus.api.objects.minecraft; import java.io.Serializable; +import java.util.ArrayList; import java.util.HashSet; import java.util.Set; @@ -10,7 +11,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gtPlusPlus.api.objects.data.AutoMap; public class BlockPos implements Serializable { @@ -151,14 +151,14 @@ public class BlockPos implements Serializable { return new BlockPos(this.xPos, this.yPos, this.zPos - 1, this.dim); } - public AutoMap<BlockPos> getSurroundingBlocks() { - AutoMap<BlockPos> sides = new AutoMap<>(); - sides.put(getUp()); - sides.put(getDown()); - sides.put(getXPos()); - sides.put(getXNeg()); - sides.put(getZPos()); - sides.put(getZNeg()); + public ArrayList<BlockPos> getSurroundingBlocks() { + ArrayList<BlockPos> sides = new ArrayList<>(); + sides.add(getUp()); + sides.add(getDown()); + sides.add(getXPos()); + sides.add(getXNeg()); + sides.add(getZPos()); + sides.add(getZNeg()); return sides; } @@ -195,7 +195,7 @@ public class BlockPos implements Serializable { * @return - Does this block have a neighbour that is the same? */ public boolean hasSimilarNeighbour(boolean strict) { - for (BlockPos g : getSurroundingBlocks().values()) { + for (BlockPos g : getSurroundingBlocks()) { if (getBlockAtPos(g) == getBlockAtPos()) { if (!strict) { return true; @@ -209,7 +209,7 @@ public class BlockPos implements Serializable { return false; } - public AutoMap<BlockPos> getSimilarNeighbour() { + public ArrayList<BlockPos> getSimilarNeighbour() { return getSimilarNeighbour(false); } @@ -217,15 +217,15 @@ public class BlockPos implements Serializable { * @param strict - Does this check Meta Data? * @return - Does this block have a neighbour that is the same? */ - public AutoMap<BlockPos> getSimilarNeighbour(boolean strict) { - AutoMap<BlockPos> sides = new AutoMap<>(); - for (BlockPos g : getSurroundingBlocks().values()) { + public ArrayList<BlockPos> getSimilarNeighbour(boolean strict) { + ArrayList<BlockPos> sides = new ArrayList<>(); + for (BlockPos g : getSurroundingBlocks()) { if (getBlockAtPos(g) == getBlockAtPos()) { if (!strict) { - sides.put(g); + sides.add(g); } else { if (getMetaAtPos() == getMetaAtPos(g)) { - sides.put(g); + sides.add(g); } } } @@ -234,12 +234,8 @@ public class BlockPos implements Serializable { } public Set<BlockPos> getValidNeighboursAndSelf() { - AutoMap<BlockPos> h = getSimilarNeighbour(true); - h.put(this); - Set<BlockPos> result = new HashSet<>(); - for (BlockPos f : h.values()) { - result.add(f); - } - return result; + ArrayList<BlockPos> h = getSimilarNeighbour(true); + h.add(this); + return new HashSet<>(h); } } diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java b/src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java index 5620b76895..fe3c6da840 100644 --- a/src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java +++ b/src/main/java/gtPlusPlus/api/objects/minecraft/CubicObject.java @@ -1,8 +1,8 @@ package gtPlusPlus.api.objects.minecraft; -import net.minecraftforge.common.util.ForgeDirection; +import java.util.ArrayList; -import gtPlusPlus.api.objects.data.AutoMap; +import net.minecraftforge.common.util.ForgeDirection; public class CubicObject<T> { @@ -15,7 +15,7 @@ public class CubicObject<T> { public final T UP; public final T DOWN; - public CubicObject(AutoMap<T> aDataSet) { + public CubicObject(ArrayList<T> aDataSet) { this(aDataSet.get(0), aDataSet.get(1), aDataSet.get(2), aDataSet.get(3), aDataSet.get(4), aDataSet.get(5)); } diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java index e03fbc3c12..a858f5a295 100644 --- a/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java +++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ItemPackage.java @@ -12,9 +12,9 @@ public abstract class ItemPackage implements RunnableWithInfo<String> { public ItemPackage(boolean hasExtraLateRun) { // Register for late run - CompatHandler.mObjectsToRunInPostInit.put(this); + CompatHandler.mObjectsToRunInPostInit.add(this); if (hasExtraLateRun) { - CompatHandler.mObjectsToRunInOnLoadComplete.put(this); + CompatHandler.mObjectsToRunInOnLoadComplete.add(this); } init(); } diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java index 4da6ef3a1f..6852c93f05 100644 --- a/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java +++ b/src/main/java/gtPlusPlus/api/objects/minecraft/ShapedRecipe.java @@ -1,12 +1,13 @@ package gtPlusPlus.api.objects.minecraft; +import java.util.ArrayList; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.ShapedOreRecipe; import gregtech.api.interfaces.IRecipeMutableAccess; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -76,7 +77,7 @@ public class ShapedRecipe implements IRecipeMutableAccess { } // Build a Pair for each slot - AutoMap<Pair<Character, Object>> aRecipePairs = new AutoMap<>(); + ArrayList<Pair<Character, Object>> aRecipePairs = new ArrayList<>(); int aCharSlot = 0; int aMemSlot = 0; int aInfoSlot = 0; @@ -91,7 +92,7 @@ public class ShapedRecipe implements IRecipeMutableAccess { } mInfo = ((ItemStack) stack).getDisplayName(); } - aRecipePairs.put(new Pair<>(CHARS.charAt(aCharSlot), stack)); + aRecipePairs.add(new Pair<>(CHARS.charAt(aCharSlot), stack)); Logger.RECIPE( "Storing '" + CHARS.charAt(aCharSlot) + "' with an object of type " @@ -103,7 +104,7 @@ public class ShapedRecipe implements IRecipeMutableAccess { aCharSlot++; aLoggingInfo[aInfoSlot++] = mInfo; } else { - aRecipePairs.put(new Pair<>(' ', (ItemStack) null)); + aRecipePairs.add(new Pair<>(' ', (ItemStack) null)); Logger.RECIPE("Storing ' ' with an object of type null"); aChar[aMemSlot++] = ' '; aLoggingInfo[aInfoSlot++] = "Empty"; @@ -155,7 +156,7 @@ public class ShapedRecipe implements IRecipeMutableAccess { } mInfo = ((ItemStack) stack).getDisplayName(); } - aRecipePairs.put(new Pair<>(CHARS.charAt(aCharSlot), stack)); + aRecipePairs.add(new Pair<>(CHARS.charAt(aCharSlot), stack)); Logger.RECIPE( "Registering Pair of '" + CHARS.charAt(aCharSlot) + "' and a " @@ -211,7 +212,7 @@ public class ShapedRecipe implements IRecipeMutableAccess { Logger.RECIPE("+ = + = + = +"); for (int r = 0; r < 9; r++) { if (aChar[r] != ' ') { - Logger.RECIPE("" + aChar[r] + " : " + aLoggingInfo[r]); + Logger.RECIPE(aChar[r] + " : " + aLoggingInfo[r]); } } diff --git a/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java index bace2937fd..c546d2114e 100644 --- a/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java +++ b/src/main/java/gtPlusPlus/core/block/base/BasicTileBlockWithTooltip.java @@ -27,7 +27,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.api.interfaces.ITileTooltip; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.CubicObject; import gtPlusPlus.api.objects.minecraft.SafeTexture; import gtPlusPlus.core.lib.GTPPCore; @@ -41,13 +40,7 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement * Each mapped object holds the data for the six sides. */ @SideOnly(Side.CLIENT) - private AutoMap<CubicObject<SafeTexture>> mSidedTextureArray; - - /** - * Holds the data for the six sides, each side holds an array of data for each respective meta. - */ - @SideOnly(Side.CLIENT) - private AutoMap<CubicObject<String>> mSidedTexturePathArray; + private ArrayList<CubicObject<SafeTexture>> mSidedTextureArray; /** * Does this block have any meta at all? @@ -163,8 +156,11 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement Logger.INFO("[TeTexture] Building Texture Maps for " + getTileEntityName() + "."); // Init on the Client side only, to prevent Field initialisers existing in the Server side bytecode. - mSidedTextureArray = new AutoMap<>(); - mSidedTexturePathArray = new AutoMap<>(); + mSidedTextureArray = new ArrayList<>(); + /** + * Holds the data for the six sides, each side holds an array of data for each respective meta. + */ + ArrayList<CubicObject<String>> sidedTexturePathArray = new ArrayList<>(); // Store them in forge order // DOWN, UP, NORTH, SOUTH, WEST, EAST @@ -191,7 +187,7 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement Logger.INFO("[TeTexture] Found custom texture data, using this instead. Size: " + aDataMap.length); // Map each meta string data to the main map. for (int i = 0; i < aDataMap.length; i++) { - mSidedTexturePathArray.put(aDataMap[i]); + sidedTexturePathArray.add(aDataMap[i]); Logger.INFO("Mapped value for meta " + i + "."); } } else { @@ -231,17 +227,17 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement aStringFront, aStringLeft, aStringRight); - mSidedTexturePathArray.put(aMetaBlob); + sidedTexturePathArray.add(aMetaBlob); Logger.INFO("[TeTexture] Added Texture Path data to map for meta " + i); } } - Logger.INFO("[TeTexture] Map size for pathing: " + mSidedTexturePathArray.size()); + Logger.INFO("[TeTexture] Map size for pathing: " + sidedTexturePathArray.size()); // Iteration Index int aIndex = 0; // Iterate each CubicObject, holding the six texture paths for each meta. - for (CubicObject<String> aMetaBlob : mSidedTexturePathArray) { + for (CubicObject<String> aMetaBlob : sidedTexturePathArray) { // Make a Safe Texture for each side SafeTexture aBottom = SafeTexture.register(aMetaBlob.DOWN); SafeTexture aTop = SafeTexture.register(aMetaBlob.UP); @@ -254,7 +250,7 @@ public abstract class BasicTileBlockWithTooltip extends BlockContainer implement // Convenience Blob CubicObject<SafeTexture> aMetaBlob2 = new CubicObject<>(aInjectBlob); // Store this Blob into - mSidedTextureArray.put(aMetaBlob2); + mSidedTextureArray.add(aMetaBlob2); Logger.INFO("[TeTexture] Added SafeTexture data to map for meta " + (aIndex++)); } Logger.INFO("[TeTexture] Map size for registration: " + mSidedTextureArray.size()); diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java index 4110c02fe3..e12e829260 100644 --- a/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java +++ b/src/main/java/gtPlusPlus/core/block/general/BlockSuperLight.java @@ -2,6 +2,8 @@ package gtPlusPlus.core.block.general; import static gregtech.api.enums.Mods.GTPlusPlus; +import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.BlockAir; import net.minecraft.block.BlockContainer; @@ -18,7 +20,6 @@ import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.block.ModBlocks; @@ -143,7 +144,7 @@ public class BlockSuperLight extends BlockContainer { aLitBlocks = new int[50][10][50][1]; int aLitCounter = 0; - AutoMap<BlockPos> aBlocksToUpdate = new AutoMap<>(); + ArrayList<BlockPos> aBlocksToUpdate = new ArrayList<>(); Logger.INFO("Trying to relight area."); BlockPos aStartIterationPoint = new BlockPos( @@ -169,14 +170,14 @@ public class BlockSuperLight extends BlockContainer { } // Turning Lights on else if (enable && aLight == 0) { - aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj)); + aBlocksToUpdate.add(new BlockPos(xOff, yOff, zOff, this.worldObj)); this.worldObj .setBlock(xOff, yOff, zOff, ModBlocks.MatterFabricatorEffectBlock, 0, 3); aLitCounter++; } // Turning Lights off else if (!enable && aLight > 0) { - aBlocksToUpdate.put(new BlockPos(xOff, yOff, zOff, this.worldObj)); + aBlocksToUpdate.add(new BlockPos(xOff, yOff, zOff, this.worldObj)); if (aBlockGet instanceof BlockLightGlass) { Logger.INFO("Dimmed air."); this.worldObj.setBlock(xOff, yOff, zOff, Blocks.air, 0, 3); diff --git a/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java b/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java index 4440d2920a..be55db80a0 100644 --- a/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java +++ b/src/main/java/gtPlusPlus/core/block/machine/BlockSuperJukebox.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.block.machine; +import java.util.ArrayList; import java.util.List; import net.minecraft.block.Block; @@ -25,7 +26,6 @@ import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.util.GTUtility; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.handler.GuiHandler; import gtPlusPlus.core.inventories.InventorySuperJukebox; import gtPlusPlus.core.util.math.MathUtils; @@ -315,12 +315,12 @@ public class BlockSuperJukebox extends BlockJukebox { // Determine which record to play public boolean selectRecordToPlayFromInventoryAndSetViaVanillaHandler() { - AutoMap<ItemStack> mValidRecords = new AutoMap<>(); + ArrayList<ItemStack> mValidRecords = new ArrayList<>(); for (ItemStack g : this.getInventory() .getInventory()) { if (g != null) { if (g.getItem() instanceof ItemRecord) { - mValidRecords.put(g); + mValidRecords.add(g); } } } diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java index aa6bfa9288..78d4f367eb 100644 --- a/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java +++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java @@ -36,47 +36,24 @@ public class RenderDecayChest extends TileEntitySpecialRenderer { public void renderTileEntityAt(TileEntityDecayablesChest p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_, float p_147500_8_) { - - int i = 0; - - if (true) { - this.bindTexture(mChestTexture); - GL11.glPushMatrix(); - GL11.glEnable(GL12.GL_RESCALE_NORMAL); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glTranslatef((float) p_147500_2_, (float) p_147500_4_ + 1.0F, (float) p_147500_6_ + 1.0F); - GL11.glScalef(1.0F, -1.0F, -1.0F); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - short short1 = 0; - - if (i == 2) { - short1 = 180; - } - - if (i == 3) { - short1 = 0; - } - - if (i == 4) { - short1 = 90; - } - - if (i == 5) { - short1 = -90; - } - - GL11.glRotatef((float) short1, 0.0F, 1.0F, 0.0F); - GL11.glTranslatef(-0.5F, -0.5F, -0.5F); - float f1 = p_147500_1_.prevLidAngle + (p_147500_1_.lidAngle - p_147500_1_.prevLidAngle) * p_147500_8_; - - f1 = 1.0F - f1; - f1 = 1.0F - f1 * f1 * f1; - mChestModel.chestLid.rotateAngleX = -(f1 * GTPPCore.PI / 2.0F); - mChestModel.renderAll(); - GL11.glDisable(GL12.GL_RESCALE_NORMAL); - GL11.glPopMatrix(); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } + this.bindTexture(mChestTexture); + GL11.glPushMatrix(); + GL11.glEnable(GL12.GL_RESCALE_NORMAL); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glTranslatef((float) p_147500_2_, (float) p_147500_4_ + 1.0F, (float) p_147500_6_ + 1.0F); + GL11.glScalef(1.0F, -1.0F, -1.0F); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + GL11.glRotatef(0.0f, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + float f1 = p_147500_1_.prevLidAngle + (p_147500_1_.lidAngle - p_147500_1_.prevLidAngle) * p_147500_8_; + + f1 = 1.0F - f1; + f1 = 1.0F - f1 * f1 * f1; + mChestModel.chestLid.rotateAngleX = -(f1 * GTPPCore.PI / 2.0F); + mChestModel.renderAll(); + GL11.glDisable(GL12.GL_RESCALE_NORMAL); + GL11.glPopMatrix(); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); } @Override diff --git a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java index 56ba05f21f..0001f825d8 100644 --- a/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java +++ b/src/main/java/gtPlusPlus/core/commands/CommandEnableDebugWhileRunning.java @@ -17,7 +17,6 @@ import net.minecraftforge.oredict.OreDictionary; import cpw.mods.fml.common.registry.GameRegistry; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.NBTUtils; @@ -66,8 +65,7 @@ public class CommandEnableDebugWhileRunning implements ICommand { int aMaxArgumentsAllowed = 2; if ((argString == null || argString.length == 0 || argString.length > aMaxArgumentsAllowed) - || argString[0].toLowerCase() - .equals("?")) { + || argString[0].equalsIgnoreCase("?")) { Logger.INFO("Listing commands and their uses."); final EntityPlayer P = CommandUtils.getPlayer(S); AsmConfig.disableAllLogging = !AsmConfig.disableAllLogging; @@ -79,143 +77,132 @@ public class CommandEnableDebugWhileRunning implements ICommand { PlayerUtils.messagePlayer( P, "debug - Toggles GT++ Debug Mode. Only use when advised, may break everything. (OP)"); - } else if (argString[0].toLowerCase() - .equals("debug")) { - Logger.INFO("Toggling Debug Mode."); - final EntityPlayer P = CommandUtils.getPlayer(S); - if (PlayerUtils.isPlayerOP(P)) { - PreloaderCore.DEBUG_MODE = !PreloaderCore.DEBUG_MODE; - PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: " + PreloaderCore.DEBUG_MODE); - } - } else if (argString[0].toLowerCase() - .equals("logging")) { - Logger.INFO("Toggling Logging."); - final EntityPlayer P = CommandUtils.getPlayer(S); - AsmConfig.disableAllLogging = !AsmConfig.disableAllLogging; - PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: " + (!AsmConfig.disableAllLogging)); - } + } else if (argString[0].equalsIgnoreCase("debug")) { + Logger.INFO("Toggling Debug Mode."); + final EntityPlayer P = CommandUtils.getPlayer(S); + if (PlayerUtils.isPlayerOP(P)) { + PreloaderCore.DEBUG_MODE = !PreloaderCore.DEBUG_MODE; + PlayerUtils.messagePlayer(P, "Toggled GT++ Debug Mode - Enabled: " + PreloaderCore.DEBUG_MODE); + } + } else if (argString[0].equalsIgnoreCase("logging")) { + Logger.INFO("Toggling Logging."); + final EntityPlayer P = CommandUtils.getPlayer(S); + AsmConfig.disableAllLogging = !AsmConfig.disableAllLogging; + PlayerUtils.messagePlayer(P, "Toggled GT++ Logging - Enabled: " + (!AsmConfig.disableAllLogging)); + } /* * else if (argString[0].toLowerCase().equals("test")) { ItemStack mSemiFluidgen = * ItemUtils.simpleMetaStack("IC2:blockGenerator", 7, 1); final EntityPlayer P = CommandUtils.getPlayer(S); * if(mSemiFluidgen != null) { PlayerUtils.messagePlayer(P, ItemUtils.getItemName(mSemiFluidgen)); } } */ - else if (argString[0].toLowerCase() - .equals("inv")) { - final EntityPlayer P = CommandUtils.getPlayer(S); - if (P != null && !P.worldObj.isRemote) { - ItemStack[] aInv = P.inventory.mainInventory; - for (ItemStack aItem : aInv) { - if (aItem != null) { - String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId; - String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name; - Logger.INFO( - aModID + ":" - + aRegistryName - + ":" - + aItem.getItemDamage() - + " | " - + aItem.getDisplayName()); - } + else if (argString[0].equalsIgnoreCase("inv")) { + final EntityPlayer P = CommandUtils.getPlayer(S); + if (P != null && !P.worldObj.isRemote) { + ItemStack[] aInv = P.inventory.mainInventory; + for (ItemStack aItem : aInv) { + if (aItem != null) { + String aModID = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).modId; + String aRegistryName = GameRegistry.findUniqueIdentifierFor(aItem.getItem()).name; + Logger.INFO( + aModID + ":" + + aRegistryName + + ":" + + aItem.getItemDamage() + + " | " + + aItem.getDisplayName()); } - PlayerUtils.messagePlayer(P, "Dumped Inventory."); } - } else if (argString[0].toLowerCase() - .equals("hand")) { - final EntityPlayer P = CommandUtils.getPlayer(S); - if (P != null) { - ItemStack aHeldItem = PlayerUtils.getItemStackInPlayersHand(P); - if (aHeldItem != null) { - String aItemDisplayName = ItemUtils.getItemName(aHeldItem); - String aItemUnlocalName = ItemUtils.getUnlocalizedItemName(aHeldItem); - String aNbtString = tryIterateNBTData(aHeldItem); - AutoMap<String> aOreDictNames = new AutoMap<>(); + PlayerUtils.messagePlayer(P, "Dumped Inventory."); + } + } else if (argString[0].equalsIgnoreCase("hand")) { + final EntityPlayer P = CommandUtils.getPlayer(S); + if (P != null) { + ItemStack aHeldItem = PlayerUtils.getItemStackInPlayersHand(P); + if (aHeldItem != null) { + String aItemDisplayName = ItemUtils.getItemName(aHeldItem); + String aItemUnlocalName = ItemUtils.getUnlocalizedItemName(aHeldItem); + String aNbtString = tryIterateNBTData(aHeldItem); + ArrayList<String> aOreDictNames = new ArrayList<>(); - int[] aOreIDs = OreDictionary.getOreIDs(aHeldItem); - for (int id : aOreIDs) { - String aOreNameFromID = OreDictionary.getOreName(id); - if (aOreNameFromID != null && aOreNameFromID.length() > 0 - && !aOreNameFromID.equals("Unknown")) { - aOreDictNames.add(aOreNameFromID); - } - } + int[] aOreIDs = OreDictionary.getOreIDs(aHeldItem); + for (int id : aOreIDs) { + String aOreNameFromID = OreDictionary.getOreName(id); + if (aOreNameFromID != null && aOreNameFromID.length() > 0 + && !aOreNameFromID.equals("Unknown")) { + aOreDictNames.add(aOreNameFromID); + } + } - String aOreDictData = ""; - if (!aOreDictNames.isEmpty()) { - for (String tag : aOreDictNames) { - aOreDictData += (tag + ", "); - } - if (aOreDictData.endsWith(", ")) { - aOreDictData = aOreDictData.substring(0, aOreDictData.length() - 2); - } - } + String aOreDictData = ""; + if (!aOreDictNames.isEmpty()) { + for (String tag : aOreDictNames) { + aOreDictData += (tag + ", "); + } + if (aOreDictData.endsWith(", ")) { + aOreDictData = aOreDictData.substring(0, aOreDictData.length() - 2); + } + } - AutoMap<String> aFluidContainerData = new AutoMap<>(); - FluidStack aHeldItemFluid = FluidContainerRegistry.getFluidForFilledItem(aHeldItem); - if (aHeldItemFluid != null) { - aFluidContainerData - .put("FluidStack Unlocal Name: " + aHeldItemFluid.getUnlocalizedName()); - aFluidContainerData.put("FluidStack Local Name: " + aHeldItemFluid.getLocalizedName()); - aFluidContainerData.put( - "Fluid Unlocal Name: " + aHeldItemFluid.getFluid() - .getUnlocalizedName()); - aFluidContainerData.put("Fluid Local Name: " + aHeldItemFluid.getLocalizedName()); - aFluidContainerData.put( - "Fluid Name: " + aHeldItemFluid.getFluid() - .getName()); - } + ArrayList<String> aFluidContainerData = new ArrayList<>(); + FluidStack aHeldItemFluid = FluidContainerRegistry.getFluidForFilledItem(aHeldItem); + if (aHeldItemFluid != null) { + aFluidContainerData.add("FluidStack Unlocal Name: " + aHeldItemFluid.getUnlocalizedName()); + aFluidContainerData.add("FluidStack Local Name: " + aHeldItemFluid.getLocalizedName()); + aFluidContainerData.add( + "Fluid Unlocal Name: " + aHeldItemFluid.getFluid() + .getUnlocalizedName()); + aFluidContainerData.add("Fluid Local Name: " + aHeldItemFluid.getLocalizedName()); + aFluidContainerData.add( + "Fluid Name: " + aHeldItemFluid.getFluid() + .getName()); + } - PlayerUtils.messagePlayer(P, "[" + aItemUnlocalName + "]" + "[" + aItemDisplayName + "] "); - if (aFluidContainerData.size() > 0) { - for (String s : aFluidContainerData) { - PlayerUtils.messagePlayer(P, "" + s); - } - } - if (!aOreDictNames.isEmpty()) { - PlayerUtils.messagePlayer(P, "" + aOreDictData); - } - if (aNbtString.length() > 0) { - PlayerUtils.messagePlayer(P, "" + aNbtString); - } - } else { - PlayerUtils.messagePlayer(P, "No item held."); + PlayerUtils.messagePlayer(P, "[" + aItemUnlocalName + "]" + "[" + aItemDisplayName + "] "); + if (!aFluidContainerData.isEmpty()) { + for (String s : aFluidContainerData) { + PlayerUtils.messagePlayer(P, s); } } - } else if (argString[0].toLowerCase() - .equals("fluid")) { - if (argString.length > 1 && argString[1] != null && argString[1].length() > 0) { - final EntityPlayer P = CommandUtils.getPlayer(S); - FluidStack aFluid = FluidUtils.getWildcardFluidStack(argString[1], 1); - if (P != null && aFluid != null) { - PlayerUtils - .messagePlayer(P, "Found fluid stack: " + FluidRegistry.getFluidName(aFluid)); - } else if (P != null && aFluid == null) { - PlayerUtils.messagePlayer(P, "Could not find any fluids."); - } - } - } else if (argString[0].toLowerCase() - .equals("item")) { - if (argString.length > 1 && argString[1] != null && argString[1].length() > 0) { - final EntityPlayer P = CommandUtils.getPlayer(S); - ItemStack aTest = ItemUtils.getItemStackFromFQRN(argString[1], 1); - if (P != null && aTest != null) { - PlayerUtils.messagePlayer(P, "Found fluid stack: " + ItemUtils.getItemName(aTest)); - } else if (P != null && aTest == null) { - PlayerUtils.messagePlayer(P, "Could not find valid item."); - } - } - } else { - final EntityPlayer P = CommandUtils.getPlayer(S); - PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'"); - } + if (!aOreDictNames.isEmpty()) { + PlayerUtils.messagePlayer(P, aOreDictData); + } + if (!aNbtString.isEmpty()) { + PlayerUtils.messagePlayer(P, aNbtString); + } + } else { + PlayerUtils.messagePlayer(P, "No item held."); + } + } + } else if (argString[0].equalsIgnoreCase("fluid")) { + if (argString.length > 1 && argString[1] != null && !argString[1].isEmpty()) { + final EntityPlayer P = CommandUtils.getPlayer(S); + FluidStack aFluid = FluidUtils.getWildcardFluidStack(argString[1], 1); + if (P != null && aFluid != null) { + PlayerUtils.messagePlayer(P, "Found fluid stack: " + FluidRegistry.getFluidName(aFluid)); + } else if (P != null) { + PlayerUtils.messagePlayer(P, "Could not find any fluids."); + } + } + } else if (argString[0].equalsIgnoreCase("item")) { + if (argString.length > 1 && argString[1] != null && !argString[1].isEmpty()) { + final EntityPlayer P = CommandUtils.getPlayer(S); + ItemStack aTest = ItemUtils.getItemStackFromFQRN(argString[1], 1); + if (P != null && aTest != null) { + PlayerUtils.messagePlayer(P, "Found fluid stack: " + ItemUtils.getItemName(aTest)); + } else if (P != null) { + PlayerUtils.messagePlayer(P, "Could not find valid item."); + } + } + } else { + final EntityPlayer P = CommandUtils.getPlayer(S); + PlayerUtils.messagePlayer(P, "Invalid command, use '?' as an argument for help.'"); + } } @Override public boolean canCommandSenderUseCommand(final ICommandSender var1) { - if (var1 == null || CommandUtils.getPlayer(var1) == null) { - return false; - } - return true; + return var1 != null && CommandUtils.getPlayer(var1) != null; } @Override @@ -241,34 +228,34 @@ public class CommandEnableDebugWhileRunning implements ICommand { public static String tryIterateNBTData(ItemStack aStack) { try { - AutoMap<String> aItemDataTags = new AutoMap<>(); + ArrayList<String> aItemDataTags = new ArrayList<>(); NBTTagCompound aNBT = NBTUtils.getNBT(aStack); - if (aNBT != null) { - if (!aNBT.hasNoTags()) { - Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap"); - if (mInternalMap != null) { - for (Map.Entry<?, ?> e : mInternalMap.entrySet()) { - aItemDataTags.add( - e.getKey() - .toString() + ":" - + e.getValue()); - } - int a = 0; - String data = ""; - for (String tag : aItemDataTags) { - data += (tag + ", "); - } - if (data.endsWith(", ")) { - data = data.substring(0, data.length() - 2); - } - return data; - } else { - Logger.INFO("Data map reflected from NBTTagCompound was not valid."); - return "Bad NBT"; + if (!aNBT.hasNoTags()) { + Map<?, ?> mInternalMap = ReflectionUtils.getField(aNBT, "tagMap"); + if (mInternalMap != null) { + for (Map.Entry<?, ?> e : mInternalMap.entrySet()) { + aItemDataTags.add( + e.getKey() + .toString() + ":" + + e.getValue()); + } + int a = 0; + StringBuilder data = new StringBuilder(); + for (String tag : aItemDataTags) { + data.append(tag) + .append(", "); + } + if (data.toString() + .endsWith(", ")) { + data = new StringBuilder(data.substring(0, data.length() - 2)); } + return data.toString(); + } else { + Logger.INFO("Data map reflected from NBTTagCompound was not valid."); + return "Bad NBT"; } } - } catch (Throwable t) {} + } catch (Throwable ignored) {} return ""; } } diff --git a/src/main/java/gtPlusPlus/core/common/CommonProxy.java b/src/main/java/gtPlusPlus/core/common/CommonProxy.java index 066dacdd9c..162b8ac1ab 100644 --- a/src/main/java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/main/java/gtPlusPlus/core/common/CommonProxy.java @@ -2,10 +2,8 @@ package gtPlusPlus.core.common; import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.event.entity.living.LivingAttackEvent; import baubles.common.container.InventoryBaubles; @@ -21,8 +19,6 @@ import cpw.mods.fml.common.registry.GameRegistry; import galaxyspace.core.entity.mob.EntityEvolvedColdBlaze; import gregtech.api.enums.Mods; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.entity.InternalEntityRegistry; @@ -197,8 +193,6 @@ public class CommonProxy { } } - protected final AutoMap<Pair<Item, IItemRenderer>> mItemRenderMappings = new AutoMap<>(); - public World getClientWorld() { return null; } diff --git a/src/main/java/gtPlusPlus/core/handler/CompatHandler.java b/src/main/java/gtPlusPlus/core/handler/CompatHandler.java index 83426c18c4..1c44216344 100644 --- a/src/main/java/gtPlusPlus/core/handler/CompatHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/CompatHandler.java @@ -5,6 +5,7 @@ import static gregtech.api.enums.Mods.PamsHarvestCraft; import static gregtech.api.enums.Mods.Thaumcraft; import static gregtech.api.enums.Mods.Witchery; +import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.Set; @@ -16,7 +17,6 @@ import gregtech.api.enums.GTValues; import gregtech.api.util.GTOreDictUnificator; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.common.compat.CompatExtraUtils; import gtPlusPlus.core.common.compat.CompatHarvestCraft; @@ -258,11 +258,11 @@ public class CompatHandler { runQueuedOnLoadComplete(event); } - public static final AutoMap<RunnableWithInfo<String>> mRecipesToGenerate = new AutoMap<>(); - public static final AutoMap<RunnableWithInfo<String>> mGtRecipesToGenerate = new AutoMap<>(); + public static final ArrayList<RunnableWithInfo<String>> mRecipesToGenerate = new ArrayList<>(); + public static final ArrayList<RunnableWithInfo<String>> mGtRecipesToGenerate = new ArrayList<>(); - public static final AutoMap<RunnableWithInfo<String>> mObjectsToRunInPostInit = new AutoMap<>(); - public static final AutoMap<ItemPackage> mObjectsToRunInOnLoadComplete = new AutoMap<>(); + public static final ArrayList<RunnableWithInfo<String>> mObjectsToRunInPostInit = new ArrayList<>(); + public static final ArrayList<ItemPackage> mObjectsToRunInOnLoadComplete = new ArrayList<>(); public static void runQueuedRecipes() { // Add autogenerated Recipes from Item Components diff --git a/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java b/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java index 769973f617..36e3b6edd8 100644 --- a/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java +++ b/src/main/java/gtPlusPlus/core/handler/Recipes/DecayableRecipe.java @@ -1,14 +1,15 @@ package gtPlusPlus.core.handler.Recipes; +import java.util.ArrayList; + import net.minecraft.item.ItemStack; import gregtech.api.util.GTUtility; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.minecraft.ItemUtils; public class DecayableRecipe { - public static final AutoMap<DecayableRecipe> mRecipes = new AutoMap<>(); + public static final ArrayList<DecayableRecipe> mRecipes = new ArrayList<>(); public final int mTime; public final ItemStack mInput; @@ -18,7 +19,7 @@ public class DecayableRecipe { mTime = time; mInput = input; mOutput = output; - mRecipes.put(this); + mRecipes.add(this); } @Override diff --git a/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java b/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java index 4baa7a80dd..35970d9165 100644 --- a/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/events/EntityDeathHandler.java @@ -18,7 +18,6 @@ import com.kuba6000.mobsinfo.api.MobRecipe; import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Triplet; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.util.math.MathUtils; @@ -28,7 +27,7 @@ import gtPlusPlus.core.util.minecraft.PlayerUtils; @Optional.Interface(iface = "com.kuba6000.mobsinfo.api.IMobExtraInfoProvider", modid = "mobsinfo") public class EntityDeathHandler implements IMobExtraInfoProvider { - private static final HashMap<Class, AutoMap<Triplet<ItemStack, Integer, Integer>>> mMobDropMap = new HashMap<>(); + private static final HashMap<Class, ArrayList<Triplet<ItemStack, Integer, Integer>>> mMobDropMap = new HashMap<>(); private static final HashSet<Class> mInternalClassKeyCache = new HashSet<>(); /** @@ -41,11 +40,11 @@ public class EntityDeathHandler implements IMobExtraInfoProvider { */ public static void registerDropsForMob(Class aMobClass, ItemStack aStack, int aMaxAmount, int aChance) { Triplet<ItemStack, Integer, Integer> aData = new Triplet<>(aStack, aMaxAmount, aChance); - AutoMap<Triplet<ItemStack, Integer, Integer>> aDataMap = mMobDropMap.get(aMobClass); + ArrayList<Triplet<ItemStack, Integer, Integer>> aDataMap = mMobDropMap.get(aMobClass); if (aDataMap == null) { - aDataMap = new AutoMap<>(); + aDataMap = new ArrayList<>(); } - aDataMap.put(aData); + aDataMap.add(aData); mMobDropMap.put(aMobClass, aDataMap); Logger.INFO( @@ -69,7 +68,7 @@ public class EntityDeathHandler implements IMobExtraInfoProvider { } private static boolean processDropsForMob(EntityLivingBase entityLiving) { - AutoMap<Triplet<ItemStack, Integer, Integer>> aMobData = mMobDropMap.get(entityLiving.getClass()); + ArrayList<Triplet<ItemStack, Integer, Integer>> aMobData = mMobDropMap.get(entityLiving.getClass()); boolean aDidDrop = false; if (aMobData != null) { if (!aMobData.isEmpty()) { @@ -137,7 +136,7 @@ public class EntityDeathHandler implements IMobExtraInfoProvider { @Override public void provideExtraDropsInformation(@NotNull String entityString, @NotNull ArrayList<MobDrop> drops, @NotNull MobRecipe recipe) { - AutoMap<Triplet<ItemStack, Integer, Integer>> dropEntry = mMobDropMap.get(recipe.entity.getClass()); + ArrayList<Triplet<ItemStack, Integer, Integer>> dropEntry = mMobDropMap.get(recipe.entity.getClass()); if (dropEntry != null && !dropEntry.isEmpty()) { for (Triplet<ItemStack, Integer, Integer> data : dropEntry) { diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index cdb61a5e46..12e127c3b7 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -958,23 +958,21 @@ public final class ModItems { MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.GEAR, MaterialsElements.STANDALONE.RHUGNOR); // Special Sillyness - if (true) { - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateSodium", 1) == null) { - new BaseItemPlate(MaterialsElements.getInstance().SODIUM); - } + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateSodium", 1) == null) { + new BaseItemPlate(MaterialsElements.getInstance().SODIUM); + } - Material meatRaw = MaterialsOther.MEAT; - // A plate of Meat. - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateMeatRaw", 1) == null) { - itemPlateRawMeat = new BaseItemPlate(meatRaw); - ItemUtils.registerFuel(ItemUtils.getSimpleStack(itemPlateRawMeat), 100); - } - // A Block of Meat. - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("blockMeatRaw", 1) == null) { - blockRawMeat = new BlockBaseModular(meatRaw, BlockTypes.STANDARD); - ItemUtils.registerFuel(ItemUtils.getSimpleStack(blockRawMeat), 900); - } + Material meatRaw = MaterialsOther.MEAT; + // A plate of Meat. + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateMeatRaw", 1) == null) { + itemPlateRawMeat = new BaseItemPlate(meatRaw); + ItemUtils.registerFuel(ItemUtils.getSimpleStack(itemPlateRawMeat), 100); + } + // A Block of Meat. + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("blockMeatRaw", 1) == null) { + blockRawMeat = new BlockBaseModular(meatRaw, BlockTypes.STANDARD); + ItemUtils.registerFuel(ItemUtils.getSimpleStack(blockRawMeat), 900); } // A plate of Vanadium. diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java index 54cfefbac2..240c0851e1 100644 --- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java +++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockMeta.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.item.base.itemblock; +import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -13,12 +14,11 @@ import net.minecraft.util.IIcon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.api.interfaces.ITileTooltip; -import gtPlusPlus.api.objects.data.AutoMap; public class ItemBlockMeta extends ItemBlockWithMetadata { private final Block mBlock; - private HashMap<Integer, AutoMap<String>> aTooltips = new LinkedHashMap<>(); + private HashMap<Integer, ArrayList<String>> aTooltips = new LinkedHashMap<>(); public ItemBlockMeta(final Block aBlock) { super(aBlock, aBlock); @@ -36,11 +36,9 @@ public class ItemBlockMeta extends ItemBlockWithMetadata { Block aThis = Block.getBlockFromItem(stack.getItem()); if (aThis != null) { if (!aTooltips.isEmpty()) { - AutoMap<String> h = aTooltips.get(stack.getItemDamage()); + ArrayList<String> h = aTooltips.get(stack.getItemDamage()); if (h != null && !h.isEmpty()) { - for (String s : h) { - list.add(s); - } + list.addAll(h); } } } diff --git a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java index 45d0e4f60e..538436d610 100644 --- a/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java +++ b/src/main/java/gtPlusPlus/core/item/base/itemblock/ItemBlockOre.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.item.base.itemblock; +import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -12,7 +13,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.block.base.BlockBaseOre; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.material.Material; @@ -40,27 +40,26 @@ public class ItemBlockOre extends ItemBlock { } } - private static Map<String, AutoMap<String>> mMapOreBlockItemToDimName = new LinkedHashMap<>(); + private static final Map<String, HashSet<String>> mMapOreBlockItemToDimName = new LinkedHashMap<>(); private static boolean mInitOres_Everglades = false; - private AutoMap<String> mDimsForThisOre = new AutoMap<>(); + private HashSet<String> mDimsForThisOre = new HashSet<>(); @Override - public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List list, final boolean bool) { + public void addInformation(final ItemStack stack, final EntityPlayer aPlayer, final List<String> list, + final boolean bool) { if (!mInitOres_Everglades) { for (WorldGen_GT_Ore_Layer f : gtPlusPlus.everglades.gen.gt.WorldGen_Ores.validOreveins.values()) { Material[] m2 = new Material[] { f.mPrimary, f.mSecondary, f.mBetween, f.mSporadic }; for (Material m1 : m2) { - AutoMap<String> aMap = mMapOreBlockItemToDimName.get( + HashSet<String> aMap = mMapOreBlockItemToDimName.get( m1.getUnlocalizedName() .toLowerCase()); if (aMap == null) { - aMap = new AutoMap<>(); + aMap = new HashSet<>(); } String aDimName = "Everglades"; - if (!aMap.containsValue(aDimName)) { - aMap.put(aDimName); - } + aMap.add(aDimName); mMapOreBlockItemToDimName.put( m1.getUnlocalizedName() .toLowerCase(), @@ -104,7 +103,7 @@ public class ItemBlockOre extends ItemBlock { } if (mDimsForThisOre.isEmpty()) { - AutoMap<String> A = mMapOreBlockItemToDimName.get( + HashSet<String> A = mMapOreBlockItemToDimName.get( this.mThisMaterial.getUnlocalizedName() .toLowerCase()); if (A != null) { diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java b/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java index 1e05e123cb..c1a4ae845a 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/AgriculturalChem.java @@ -33,7 +33,6 @@ import gregtech.api.enums.TierEU; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.circuit.GTPPIntegratedCircuitItem; import gtPlusPlus.core.recipe.common.CI; @@ -50,7 +49,7 @@ public class AgriculturalChem extends ItemPackage { private static boolean aBOP; private static boolean aTiCon; - private static AutoMap<FluidStack> mBloodFluids = new AutoMap<>(); + private static ArrayList<FluidStack> mBloodFluids = new ArrayList<>(); /** * Fluids @@ -306,7 +305,7 @@ public class AgriculturalChem extends ItemPackage { if (aBlood != null) { Logger.INFO("Found Biome's o Plenty, enabled Blood support."); CustomBlood = aBlood.getFluid(); - mBloodFluids.put(aBlood); + mBloodFluids.add(aBlood); } } @@ -315,7 +314,7 @@ public class AgriculturalChem extends ItemPackage { if (aBlood != null) { Logger.INFO("Found Tinker's Construct, enabled Blood support."); CustomBlood = aBlood.getFluid(); - mBloodFluids.put(FluidUtils.getFluidStack("blood", 100)); + mBloodFluids.add(FluidUtils.getFluidStack("blood", 100)); } } @@ -336,24 +335,24 @@ public class AgriculturalChem extends ItemPackage { } } Logger.INFO("Using " + CustomBlood.getName()); - mBloodFluids.put(FluidUtils.getFluidStack(CustomBlood, 100)); + mBloodFluids.add(FluidUtils.getFluidStack(CustomBlood, 100)); } } - private static final AutoMap<ItemStack> mMeats = new AutoMap<>(); - private static final AutoMap<ItemStack> mFish = new AutoMap<>(); - private static final AutoMap<ItemStack> mFruits = new AutoMap<>(); - private static final AutoMap<ItemStack> mVege = new AutoMap<>(); - private static final AutoMap<ItemStack> mNuts = new AutoMap<>(); - private static final AutoMap<ItemStack> mSeeds = new AutoMap<>(); - private static final AutoMap<ItemStack> mPeat = new AutoMap<>(); - private static final AutoMap<ItemStack> mBones = new AutoMap<>(); - private static final AutoMap<ItemStack> mBoneMeal = new AutoMap<>(); - - private static final AutoMap<ItemStack> mList_Master_Meats = new AutoMap<>(); - private static final AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<>(); - private static final AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<>(); - private static final AutoMap<ItemStack> mList_Master_Bones = new AutoMap<>(); + private static final ArrayList<ItemStack> mMeats = new ArrayList<>(); + private static final ArrayList<ItemStack> mFish = new ArrayList<>(); + private static final ArrayList<ItemStack> mFruits = new ArrayList<>(); + private static final ArrayList<ItemStack> mVege = new ArrayList<>(); + private static final ArrayList<ItemStack> mNuts = new ArrayList<>(); + private static final ArrayList<ItemStack> mSeeds = new ArrayList<>(); + private static final ArrayList<ItemStack> mPeat = new ArrayList<>(); + private static final ArrayList<ItemStack> mBones = new ArrayList<>(); + private static final ArrayList<ItemStack> mBoneMeal = new ArrayList<>(); + + private static final ArrayList<ItemStack> mList_Master_Meats = new ArrayList<>(); + private static final ArrayList<ItemStack> mList_Master_FruitVege = new ArrayList<>(); + private static final ArrayList<ItemStack> mList_Master_Seeds = new ArrayList<>(); + private static final ArrayList<ItemStack> mList_Master_Bones = new ArrayList<>(); private static void processAllOreDict() { processOreDict("listAllmeatraw", mMeats); @@ -367,9 +366,7 @@ public class AgriculturalChem extends ItemPackage { processOreDict("dustBone", mBoneMeal); // Just make a mega list, makes life easier. if (!mMeats.isEmpty()) { - for (ItemStack g : mMeats) { - mList_Master_Meats.put(g); - } + mList_Master_Meats.addAll(mMeats); } if (!mFish.isEmpty()) { for (ItemStack g : mFish) { @@ -381,33 +378,23 @@ public class AgriculturalChem extends ItemPackage { } } if (foundDupe) continue; - mList_Master_Meats.put(g); + mList_Master_Meats.add(g); } } if (!mFruits.isEmpty()) { - for (ItemStack g : mFruits) { - mList_Master_FruitVege.put(g); - } + mList_Master_FruitVege.addAll(mFruits); } if (!mVege.isEmpty()) { - for (ItemStack g : mVege) { - mList_Master_FruitVege.put(g); - } + mList_Master_FruitVege.addAll(mVege); } if (!mNuts.isEmpty()) { - for (ItemStack g : mNuts) { - mList_Master_FruitVege.put(g); - } + mList_Master_FruitVege.addAll(mNuts); } if (!mSeeds.isEmpty()) { - for (ItemStack g : mSeeds) { - mList_Master_Seeds.put(g); - } + mList_Master_Seeds.addAll(mSeeds); } if (!mBoneMeal.isEmpty()) { - for (ItemStack g : mBoneMeal) { - mList_Master_Bones.put(g); - } + mList_Master_Bones.addAll(mBoneMeal); } if (!mBones.isEmpty()) { for (ItemStack g : mBones) { @@ -419,17 +406,15 @@ public class AgriculturalChem extends ItemPackage { } } if (foundDupe) continue; - mList_Master_Bones.put(g); + mList_Master_Bones.add(g); } } } - private static void processOreDict(String aOreName, AutoMap<ItemStack> aMap) { + private static void processOreDict(String aOreName, ArrayList<ItemStack> aMap) { ArrayList<ItemStack> aTemp = OreDictionary.getOres(aOreName); if (!aTemp.isEmpty()) { - for (ItemStack stack : aTemp) { - aMap.put(stack); - } + aMap.addAll(aTemp); } } diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java b/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java index 4909d269cc..e945729cf8 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/MilledOreProcessing.java @@ -8,6 +8,7 @@ import static gregtech.api.util.GTRecipeConstants.CHEMPLANT_CASING_TIER; import static gregtech.api.util.GTRecipeConstants.COIL_HEAT; import static gtPlusPlus.api.recipe.GTPPRecipeMaps.*; +import java.util.ArrayList; import java.util.HashMap; import net.minecraft.item.Item; @@ -22,7 +23,6 @@ import gregtech.api.enums.TierEU; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.api.objects.data.Quad; import gtPlusPlus.api.objects.minecraft.ItemPackage; @@ -642,10 +642,10 @@ public class MilledOreProcessing extends ItemPackage { } private void addPineOilExtraction() { - AutoMap<ItemStack> aLogs = new AutoMap<>(); - AutoMap<ItemStack> aLeaves = new AutoMap<>(); - AutoMap<ItemStack> aSaplings = new AutoMap<>(); - AutoMap<ItemStack> aPinecones = new AutoMap<>(); + ArrayList<ItemStack> aLogs = new ArrayList<>(); + ArrayList<ItemStack> aLeaves = new ArrayList<>(); + ArrayList<ItemStack> aSaplings = new ArrayList<>(); + ArrayList<ItemStack> aPinecones = new ArrayList<>(); ItemStack aCrushedPine = ItemUtils.getSimpleStack(AgriculturalChem.mCrushedPine, 1); @@ -745,10 +745,10 @@ public class MilledOreProcessing extends ItemPackage { public static ItemStack[] cleanArray(ItemStack[] input) { int aArraySize = input.length; - AutoMap<ItemStack> aCleanedItems = new AutoMap<>(); + ArrayList<ItemStack> aCleanedItems = new ArrayList<>(); for (ItemStack checkStack : input) { if (ItemUtils.checkForInvalidItems(checkStack)) { - aCleanedItems.put(checkStack); + aCleanedItems.add(checkStack); } } ItemStack[] aOutput = new ItemStack[aCleanedItems.size()]; @@ -799,10 +799,9 @@ public class MilledOreProcessing extends ItemPackage { private static ItemStack[] getArrayFromQuad( Quad<Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>, Pair<Material, Integer>> aData) { - AutoMap<ItemStack> aOutputs = new AutoMap<>(); + ArrayList<ItemStack> aOutputs = new ArrayList<>(); for (Object aPair : aData.values()) { - if (aPair != null && Pair.class.isInstance(aPair)) { - Pair aObj = (Pair) aPair; + if (aPair instanceof Pair aObj) { Material aMat = (Material) aObj.getKey(); int aCount = (int) aObj.getValue(); aOutputs.addAll(getItemStackFromPair(aMat, aCount)); @@ -816,23 +815,23 @@ public class MilledOreProcessing extends ItemPackage { return aRealOutputArray; } - private static AutoMap<ItemStack> getItemStackFromPair(Material aMat, Integer aCount) { - AutoMap<ItemStack> aOutputs = new AutoMap<>(); + private static ArrayList<ItemStack> getItemStackFromPair(Material aMat, Integer aCount) { + ArrayList<ItemStack> aOutputs = new ArrayList<>(); if (aCount > 64) { - AutoMap<Integer> sizes = getStackSizes(aCount); + ArrayList<Integer> sizes = getStackSizes(aCount); for (int aSplitSize : sizes) { ItemStack aDustStack = aMat.getDust(aSplitSize); - aOutputs.put(aDustStack); + aOutputs.add(aDustStack); } } else { ItemStack aDustStack = aMat.getDust(aCount); - aOutputs.put(aDustStack); + aOutputs.add(aDustStack); } return aOutputs; } - private static AutoMap<Integer> getStackSizes(int aBigSize) { - AutoMap<Integer> aSizes = new AutoMap<>(); + private static ArrayList<Integer> getStackSizes(int aBigSize) { + ArrayList<Integer> aSizes = new ArrayList<>(); if (aBigSize <= 64) { aSizes.add(aBigSize); } else { diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java b/src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java index 1604bcb571..0c3d481fd7 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/StandardBaseParticles.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.item.chemistry; import static gregtech.api.enums.Mods.GTPlusPlus; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -12,7 +13,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.base.misc.BaseItemParticle; import gtPlusPlus.core.material.Particle; import gtPlusPlus.core.material.Particle.ElementaryGroup; @@ -87,7 +87,7 @@ public class StandardBaseParticles extends BaseItemParticle { } public static Particle getParticle(ItemStack aStack) { - AutoMap<Particle> g = Particle.aMap; + ArrayList<Particle> g = Particle.aMap; for (Particle p : g) { String aPartName = Utils.sanitizeString(p.mParticleName.toLowerCase()); String expectedPart = Utils.sanitizeString(aTypes[aStack.getItemDamage()].toLowerCase()); diff --git a/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java b/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java index 01f2b1b263..5c38dde63b 100644 --- a/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java +++ b/src/main/java/gtPlusPlus/core/item/food/BaseItemMetaFood.java @@ -3,6 +3,7 @@ package gtPlusPlus.core.item.food; import static gregtech.api.enums.Mods.GTPlusPlus; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -24,7 +25,6 @@ import gregtech.api.enums.Materials; import gregtech.api.objects.ItemData; import gregtech.api.objects.MaterialStack; import gregtech.api.util.GTOreDictUnificator; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.util.math.MathUtils; @@ -95,7 +95,7 @@ public class BaseItemMetaFood extends ItemFood { 4, 1, 64, - new AutoMap<>(), + new ArrayList<>(), new setOnFire(), getOreDictNamesAsArrayList("listAllmeatcooked")); } @@ -105,7 +105,7 @@ public class BaseItemMetaFood extends ItemFood { private static final HashMap<Integer, EnumRarity> mRarityMap = new HashMap<>(); private static final HashMap<Integer, Integer> mHealAmountMap = new HashMap<>(); private static final HashMap<Integer, Float> mSaturationAmountMap = new HashMap<>(); - private static final HashMap<Integer, AutoMap<PotionEffectPackage>> mPotionEffectsMap = new HashMap<>(); + private static final HashMap<Integer, ArrayList<PotionEffectPackage>> mPotionEffectsMap = new HashMap<>(); private static final HashMap<Integer, Boolean> mHasSpecialBehaviourMap = new HashMap<>(); private static final HashMap<Integer, SpecialFoodBehaviour> mSpecialBehaviourMap = new HashMap<>(); private static final HashMap<Integer, ArrayList<String>> mOreDictNames = new HashMap<>(); @@ -119,7 +119,7 @@ public class BaseItemMetaFood extends ItemFood { aHealAmount, aSaturationModifier, aMaxStacksize, - new AutoMap<>(), + new ArrayList<>(), null, new ArrayList<>()); } @@ -133,27 +133,13 @@ public class BaseItemMetaFood extends ItemFood { aHealAmount, aSaturationModifier, aMaxStacksize, - new AutoMap<>(), + new ArrayList<>(), null, aOreDictNames); } public static void registerNewMetaFood(final int aMetaID, String aTooltip, final int aHealAmount, - final float aSaturationModifier, final int aMaxStacksize, final AutoMap<PotionEffectPackage> aPotionEffects) { - registerNewMetaFood( - aMetaID, - aTooltip, - EnumRarity.common, - aHealAmount, - aSaturationModifier, - aMaxStacksize, - new AutoMap<>(), - null, - new ArrayList<>()); - } - - public static void registerNewMetaFood(final int aMetaID, String aTooltip, final int aHealAmount, - final float aSaturationModifier, final int aMaxStacksize, final AutoMap<PotionEffectPackage> aPotionEffects, + final float aSaturationModifier, final int aMaxStacksize, final ArrayList<PotionEffectPackage> aPotionEffects, final ArrayList<String> aOreDictNames) { registerNewMetaFood( aMetaID, @@ -169,7 +155,7 @@ public class BaseItemMetaFood extends ItemFood { public static void registerNewMetaFood(final int aMetaID, String aTooltip, EnumRarity aRarity, final int aHealAmount, final float aSaturationModifier, final int aMaxStacksize, - final AutoMap<PotionEffectPackage> aPotionEffects, final SpecialFoodBehaviour aSpecialBehaviour) { + final ArrayList<PotionEffectPackage> aPotionEffects, final SpecialFoodBehaviour aSpecialBehaviour) { registerNewMetaFood( aMetaID, aTooltip, @@ -184,7 +170,7 @@ public class BaseItemMetaFood extends ItemFood { public static void registerNewMetaFood(final int aMetaID, String aTooltip, EnumRarity aRarity, final int aHealAmount, final float aSaturationModifier, final int aMaxStacksize, - final AutoMap<PotionEffectPackage> aPotionEffects, final SpecialFoodBehaviour aSpecialBehaviour, + final ArrayList<PotionEffectPackage> aPotionEffects, final SpecialFoodBehaviour aSpecialBehaviour, final ArrayList<String> aOreDictNames) { mTotalMetaItems++; mMaxStackSizeMap.put(aMetaID, aMaxStacksize); @@ -257,8 +243,8 @@ public class BaseItemMetaFood extends ItemFood { @Override protected void onFoodEaten(final ItemStack aStack, final World aWorld, final EntityPlayer aPlayer) { // super.onFoodEaten(stack, world, player); - AutoMap<PotionEffectPackage> aPotionEffects = mPotionEffectsMap.get(getMetaKey(aStack)); - if (!aWorld.isRemote && aPotionEffects != null && aPotionEffects.size() > 0) { + ArrayList<PotionEffectPackage> aPotionEffects = mPotionEffectsMap.get(getMetaKey(aStack)); + if (!aWorld.isRemote && aPotionEffects != null && !aPotionEffects.isEmpty()) { for (PotionEffectPackage aFoodEffect : aPotionEffects) { if (MathUtils.randInt(0, 100) <= aFoodEffect.getChance() || aFoodEffect.getChance() == 100) { PotionEffect aEffect = aFoodEffect.getEffect(); @@ -426,12 +412,10 @@ public class BaseItemMetaFood extends ItemFood { } } - private static AutoMap<PotionEffectPackage> getPotionEffectPackage(PotionEffectPackage... aEffects) { - AutoMap<PotionEffectPackage> aPackage = new AutoMap<>(); + private static ArrayList<PotionEffectPackage> getPotionEffectPackage(PotionEffectPackage... aEffects) { + ArrayList<PotionEffectPackage> aPackage = new ArrayList<>(); if (aEffects != null && aEffects.length > 0) { - for (PotionEffectPackage aEffect : aEffects) { - aPackage.put(aEffect); - } + Collections.addAll(aPackage, aEffects); } return aPackage; } diff --git a/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java b/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java index 1c896e8497..a8173571dc 100644 --- a/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java +++ b/src/main/java/gtPlusPlus/core/item/tool/misc/ItemGregtechPump.java @@ -51,7 +51,6 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.util.minecraft.FluidUtils; @@ -1140,9 +1139,9 @@ public class ItemGregtechPump extends Item implements ISpecialElectricItem, IEle return getStoredFluidOfVanillaTank((IFluidTank) aTileEntity); } FluidStack f; - AutoMap<FluidTankInfo[]> m = new AutoMap<>(); + ArrayList<FluidTankInfo[]> m = new ArrayList<>(); for (int i = 0; i < 6; i++) { - m.put(aTileEntity.getTankInfo(ForgeDirection.getOrientation(i))); + m.add(aTileEntity.getTankInfo(ForgeDirection.getOrientation(i))); } if (m.get(0) != null && m.get(0)[0] != null && m.get(0)[0].fluid != null) { return m.get(0)[0].fluid; diff --git a/src/main/java/gtPlusPlus/core/material/Material.java b/src/main/java/gtPlusPlus/core/material/Material.java index 836ccfa504..3dab9bde39 100644 --- a/src/main/java/gtPlusPlus/core/material/Material.java +++ b/src/main/java/gtPlusPlus/core/material/Material.java @@ -22,7 +22,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.util.GTLanguageManager; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes; import gtPlusPlus.core.item.base.cell.BaseItemCell; import gtPlusPlus.core.material.state.MaterialState; @@ -88,7 +87,7 @@ public class Material { public short werkstoffID; - public static AutoMap<Materials> invalidMaterials = new AutoMap<>(); + public static ArrayList<Materials> invalidMaterials = new ArrayList<>(); public Material(final String materialName, final MaterialState defaultState, final MaterialStack... inputs) { this(materialName, defaultState, null, inputs); @@ -408,26 +407,21 @@ public class Material { // set RGB if (rgba == null) { - if (vMaterialInput.size() > 0) { + if (!vMaterialInput.isEmpty()) { try { Short[] mMixedRGB = new Short[3]; - AutoMap<Material> mMaterialSet = MaterialUtils.getCompoundMaterialsRecursively(this); + ArrayList<Material> mMaterialSet = MaterialUtils.getCompoundMaterialsRecursively(this); for (int mnh = 0; mnh < 3; mnh++) { - AutoMap<Short> aDataSet = new AutoMap<>(); - Set<Material> set4 = new HashSet<>(); - for (Material u : mMaterialSet) { - // if (u.getState() == MaterialState.ORE || u.getState() == MaterialState.SOLID) - set4.add(u); - } + ArrayList<Short> aDataSet = new ArrayList<>(); + // if (u.getState() == MaterialState.ORE || u.getState() == MaterialState.SOLID) + Set<Material> set4 = new HashSet<>(mMaterialSet); for (Material e : set4) { - aDataSet.put(e.getRGB()[mnh]); + aDataSet.add(e.getRGB()[mnh]); } - Short aAverage = MathUtils.getShortAverage(aDataSet); - if (aAverage > Short.MAX_VALUE || aAverage < Short.MIN_VALUE - || aAverage < 0 - || aAverage > 255) { + short aAverage = MathUtils.getShortAverage(aDataSet); + if (aAverage < 0 || aAverage > 255) { if (aAverage > 255) { while (aAverage > 255) { aAverage = (short) (aAverage / 2); @@ -438,7 +432,7 @@ public class Material { mMixedRGB[mnh] = aAverage; } - if (mMixedRGB != null && mMixedRGB[0] != null && mMixedRGB[1] != null && mMixedRGB[2] != null) { + if (mMixedRGB[0] != null && mMixedRGB[1] != null && mMixedRGB[2] != null) { this.RGBA = new short[] { mMixedRGB[0], mMixedRGB[1], mMixedRGB[2], 0 }; } else { this.RGBA = Materials.Steel.mRGBa; @@ -577,9 +571,9 @@ public class Material { this.vRadiationLevel = (byte) radiationLevel; } else { if (vMaterialInput.size() > 0) { - AutoMap<Byte> aDataSet = new AutoMap<>(); + ArrayList<Byte> aDataSet = new ArrayList<>(); for (MaterialStack m : this.vMaterialInput) { - aDataSet.put(m.getStackMaterial().vRadiationLevel); + aDataSet.add(m.getStackMaterial().vRadiationLevel); } byte aAverage = MathUtils.getByteAverage(aDataSet); if (aAverage > 0) { @@ -612,14 +606,10 @@ public class Material { this.vSmallestRatio = this.getSmallestRatio(this.vMaterialInput); int tempSmallestSize = 0; - if (this.vSmallestRatio != null) { - for (long l : this.vSmallestRatio) { - tempSmallestSize = (int) (tempSmallestSize + l); - } - this.smallestStackSizeWhenProcessing = tempSmallestSize; // Valid stacksizes - } else { - this.smallestStackSizeWhenProcessing = 1; // Valid stacksizes + for (long l : this.vSmallestRatio) { + tempSmallestSize = (int) (tempSmallestSize + l); } + this.smallestStackSizeWhenProcessing = tempSmallestSize; // Valid stacksizes // Makes a Fancy Chemical Tooltip @@ -630,7 +620,7 @@ public class Material { this.vChemicalSymbol = chemicalSymbol; if (this.vMaterialInput != null) { this.vChemicalFormula = this.getToolTip(chemicalSymbol, OrePrefixes.dust.mMaterialAmount / M, true); - } else if (!this.vChemicalSymbol.equals("")) { + } else if (!this.vChemicalSymbol.isEmpty()) { Logger.MATERIALS("materialInput is null, using a valid chemical symbol."); this.vChemicalFormula = this.vChemicalSymbol; } else { @@ -665,13 +655,15 @@ public class Material { this.mFluid = null; this.mPlasma = null; } - String ratio = ""; + StringBuilder ratio = new StringBuilder(); if (this.vSmallestRatio != null) { for (long l : this.vSmallestRatio) { - if (ratio.equals("")) { - ratio = String.valueOf(l); + if (ratio.toString() + .isEmpty()) { + ratio = new StringBuilder(String.valueOf(l)); } else { - ratio = ratio + ":" + l; + ratio.append(":") + .append(l); } } } @@ -794,55 +786,49 @@ public class Material { } } - if (aSet == null) { - if (aGem >= this.getComposites() - .size() / 2) { - if (MathUtils.isNumberEven(aGem)) { - Logger.MATERIALS( - "Set textureset for " + this.localizedName - + " to be " - + TextureSet.SET_GEM_HORIZONTAL.mSetName - + "."); - return TextureSet.SET_GEM_HORIZONTAL; - } else { - Logger.MATERIALS( - "Set textureset for " + this.localizedName - + " to be " - + TextureSet.SET_GEM_VERTICAL.mSetName - + "."); - return TextureSet.SET_GEM_VERTICAL; - } + if (aGem >= this.getComposites() + .size() / 2) { + if (MathUtils.isNumberEven(aGem)) { + Logger.MATERIALS( + "Set textureset for " + this.localizedName + + " to be " + + TextureSet.SET_GEM_HORIZONTAL.mSetName + + "."); + return TextureSet.SET_GEM_HORIZONTAL; + } else { + Logger.MATERIALS( + "Set textureset for " + this.localizedName + + " to be " + + TextureSet.SET_GEM_VERTICAL.mSetName + + "."); + return TextureSet.SET_GEM_VERTICAL; } } - if (aSet == null) { - if (aShiny >= this.getComposites() - .size() / 3) { - Logger.MATERIALS( - "Set textureset for " + this.localizedName + " to be " + TextureSet.SET_SHINY.mSetName + "."); - return TextureSet.SET_SHINY; - } + if (aShiny >= this.getComposites() + .size() / 3) { + Logger.MATERIALS( + "Set textureset for " + this.localizedName + " to be " + TextureSet.SET_SHINY.mSetName + "."); + return TextureSet.SET_SHINY; } // build hash table with count - AutoMap<Material> sets = new AutoMap<>(); - if (this.vMaterialInput != null) { - for (MaterialStack r : this.vMaterialInput) { - if (r.getStackMaterial() - .getTextureSet().mSetName.toLowerCase() - .contains("fluid")) { - sets.put(MaterialsElements.getInstance().GOLD); - } else { - sets.put(r.getStackMaterial()); - } - } - TextureSet mostUsedTypeTextureSet = MaterialUtils.getMostCommonTextureSet(new ArrayList<>(sets.values())); - if (mostUsedTypeTextureSet != null && mostUsedTypeTextureSet instanceof TextureSet) { - Logger.MATERIALS( - "Set textureset for " + this.localizedName + " to be " + mostUsedTypeTextureSet.mSetName + "."); - return mostUsedTypeTextureSet; + ArrayList<Material> sets = new ArrayList<>(); + for (MaterialStack r : this.vMaterialInput) { + if (r.getStackMaterial() + .getTextureSet().mSetName.toLowerCase() + .contains("fluid")) { + sets.add(MaterialsElements.getInstance().GOLD); + } else { + sets.add(r.getStackMaterial()); } } + TextureSet mostUsedTypeTextureSet = MaterialUtils.getMostCommonTextureSet(sets); + if (mostUsedTypeTextureSet instanceof TextureSet) { + Logger.MATERIALS( + "Set textureset for " + this.localizedName + " to be " + mostUsedTypeTextureSet.mSetName + "."); + return mostUsedTypeTextureSet; + } Logger.MATERIALS( "Set textureset for " + this.localizedName + " to be " + Materials.Iron.mIconSet.mSetName + ". [Fallback]"); return Materials.Gold.mIconSet; @@ -1508,7 +1494,7 @@ public class Material { return null; } if (isValid != null) { - for (Materials m : invalidMaterials.values()) { + for (Materials m : invalidMaterials) { if (isValid == m) { return null; } @@ -1548,9 +1534,9 @@ public class Material { public final int calculateMeltingPoint() { try { - AutoMap<Integer> aDataSet = new AutoMap<>(); + ArrayList<Integer> aDataSet = new ArrayList<>(); for (MaterialStack m : this.vMaterialInput) { - aDataSet.put( + aDataSet.add( m.getStackMaterial() .getMeltingPointC()); } @@ -1565,9 +1551,9 @@ public class Material { public final int calculateBoilingPoint() { try { - AutoMap<Integer> aDataSet = new AutoMap<>(); + ArrayList<Integer> aDataSet = new ArrayList<>(); for (MaterialStack m : this.vMaterialInput) { - aDataSet.put( + aDataSet.add( m.getStackMaterial() .getBoilingPointC()); } @@ -1582,9 +1568,9 @@ public class Material { public final long calculateProtons() { try { - AutoMap<Long> aDataSet = new AutoMap<>(); + ArrayList<Long> aDataSet = new ArrayList<>(); for (MaterialStack m : this.vMaterialInput) { - aDataSet.put( + aDataSet.add( m.getStackMaterial() .getProtons()); } @@ -1599,9 +1585,9 @@ public class Material { public final long calculateNeutrons() { try { - AutoMap<Long> aDataSet = new AutoMap<>(); + ArrayList<Long> aDataSet = new ArrayList<>(); for (MaterialStack m : this.vMaterialInput) { - aDataSet.put( + aDataSet.add( m.getStackMaterial() .getNeutrons()); } @@ -1618,14 +1604,11 @@ public class Material { if (obj == null) { return false; } - if (!Material.class.isInstance(obj)) { + if (!(obj instanceof Material aObj)) { return false; } - Material aObj = (Material) obj; if (aObj.unlocalizedName.equals(this.unlocalizedName)) { - if (aObj.localizedName.equals(this.localizedName)) { - return true; - } + return aObj.localizedName.equals(this.localizedName); } return false; } diff --git a/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java b/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java index 6a68dd5d7a..48f52a9f7a 100644 --- a/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java @@ -2,6 +2,7 @@ package gtPlusPlus.core.material; import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalDehydratorRecipes; +import java.util.ArrayList; import java.util.Set; import net.minecraft.block.Block; @@ -13,7 +14,6 @@ import gregtech.api.enums.GTValues; import gregtech.api.util.GTUtility; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.block.base.BasicBlock.BlockTypes; import gtPlusPlus.core.block.base.BlockBaseModular; import gtPlusPlus.core.block.base.BlockBaseOre; @@ -63,7 +63,7 @@ import gtPlusPlus.xmod.gregtech.loaders.RecipeGenShapedCrafting; public class MaterialGenerator { - public static final AutoMap<Set<RunnableWithInfo<Material>>> mRecipeMapsToGenerate = new AutoMap<>(); + public static final ArrayList<Set<RunnableWithInfo<Material>>> mRecipeMapsToGenerate = new ArrayList<>(); @SuppressWarnings("unused") private static volatile Item temp; diff --git a/src/main/java/gtPlusPlus/core/material/Particle.java b/src/main/java/gtPlusPlus/core/material/Particle.java index b5cd30184e..fefb3f4497 100644 --- a/src/main/java/gtPlusPlus/core/material/Particle.java +++ b/src/main/java/gtPlusPlus/core/material/Particle.java @@ -1,8 +1,9 @@ package gtPlusPlus.core.material; +import java.util.ArrayList; + import net.minecraft.item.ItemStack; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.chemistry.IonParticles; import gtPlusPlus.core.util.Utils; @@ -42,7 +43,7 @@ public class Particle { public static final Particle UNKNOWN; - public static final AutoMap<Particle> aMap = new AutoMap<>(); + public static final ArrayList<Particle> aMap = new ArrayList<>(); static { @@ -115,7 +116,7 @@ public class Particle { mParticleType = aParticleType; mParticleName = aParticleName; mComposition = aComposition == null ? new Particle[] { this } : aComposition; - aMap.put(this); + aMap.add(this); } public static ItemStack getIon(String aElementName, int aCharge) { diff --git a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java index 04ad0c05c0..e45bd76544 100644 --- a/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java +++ b/src/main/java/gtPlusPlus/core/proxy/ClientProxy.java @@ -5,11 +5,8 @@ import java.util.ArrayList; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderFireball; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; @@ -29,7 +26,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.client.renderer.CustomItemBlockRenderer; import gtPlusPlus.core.client.renderer.CustomOreBlockRenderer; import gtPlusPlus.core.client.renderer.RenderDecayChest; @@ -128,14 +124,6 @@ public class ClientProxy extends CommonProxy implements Runnable { */ Logger.INFO("Registering Custom Renderer for the Lead Lined Chest."); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDecayablesChest.class, new RenderDecayChest()); - Logger.INFO("Registering Custom Renderer for the Egg Box."); - - /** - * Items - */ - for (Pair<Item, IItemRenderer> sItemRenderMappings : mItemRenderMappings) { - MinecraftForgeClient.registerItemRenderer(sItemRenderMappings.getKey(), sItemRenderMappings.getValue()); - } } @Override diff --git a/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java b/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java index 55bafd963f..75feeb6f6b 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RecipesMachines.java @@ -2709,197 +2709,195 @@ public class RecipesMachines { GregtechItemList.Industrial_FishingPond.get(1)); } - if (true) { - // Advanced Vacuum Freezer - ItemStack plate = MaterialsAlloy.LEAGRISIUM.getPlateDouble(1); - ItemStack gear = MaterialsAlloy.INCOLOY_MA956.getGear(1); - ItemStack frame = MaterialsAlloy.NITINOL_60.getFrameBox(1); - ItemStack cell1 = ItemList.Reactor_Coolant_He_6.get(1); - ItemStack cell2 = ItemList.Reactor_Coolant_NaK_6.get(1); + // Advanced Vacuum Freezer + ItemStack plate = MaterialsAlloy.LEAGRISIUM.getPlateDouble(1); + ItemStack gear = MaterialsAlloy.INCOLOY_MA956.getGear(1); + ItemStack frame = MaterialsAlloy.NITINOL_60.getFrameBox(1); + ItemStack cell1 = ItemList.Reactor_Coolant_He_6.get(1); + ItemStack cell2 = ItemList.Reactor_Coolant_NaK_6.get(1); - RecipeUtils.addShapedRecipe( - plate, - gear, - plate, - cell1, - frame, - cell2, - plate, - gear, - plate, - GregtechItemList.Casing_AdvancedVacuum.get(1)); - RecipeUtils.addShapedRecipe( - gear, - CI.getTieredCircuit(6), - gear, - CI.electricPiston_IV, - GregtechItemList.Casing_AdvancedVacuum.get(1), - CI.electricPiston_IV, - plate, - GregtechItemList.Gregtech_Computer_Cube.get(1), - plate, - GregtechItemList.Industrial_Cryogenic_Freezer.get(1)); - - // Advanced Blast Furnace - plate = MaterialsAlloy.HASTELLOY_N.getPlateDouble(1); - gear = MaterialsAlloy.HASTELLOY_W.getGear(1); - frame = MaterialsAlloy.HASTELLOY_X.getFrameBox(1); - cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); - cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); - ItemStack cell3 = ItemUtils.simpleMetaStack("IC2:reactorVentDiamond:1:1", 1, 1); + RecipeUtils.addShapedRecipe( + plate, + gear, + plate, + cell1, + frame, + cell2, + plate, + gear, + plate, + GregtechItemList.Casing_AdvancedVacuum.get(1)); + RecipeUtils.addShapedRecipe( + gear, + CI.getTieredCircuit(6), + gear, + CI.electricPiston_IV, + GregtechItemList.Casing_AdvancedVacuum.get(1), + CI.electricPiston_IV, + plate, + GregtechItemList.Gregtech_Computer_Cube.get(1), + plate, + GregtechItemList.Industrial_Cryogenic_Freezer.get(1)); + + // Advanced Blast Furnace + plate = MaterialsAlloy.HASTELLOY_N.getPlateDouble(1); + gear = MaterialsAlloy.HASTELLOY_W.getGear(1); + frame = MaterialsAlloy.HASTELLOY_X.getFrameBox(1); + cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); + cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); + ItemStack cell3 = ItemUtils.simpleMetaStack("IC2:reactorVentDiamond:1:1", 1, 1); - RecipeUtils.addShapedRecipe( - plate, - cell1, - plate, - cell3, - frame, - cell2, - plate, - gear, - plate, - GregtechItemList.Casing_Adv_BlastFurnace.get(1)); - RecipeUtils.addShapedRecipe( - gear, - CI.getTieredCircuit(6), - gear, - CI.robotArm_IV, + RecipeUtils.addShapedRecipe( + plate, + cell1, + plate, + cell3, + frame, + cell2, + plate, + gear, + plate, + GregtechItemList.Casing_Adv_BlastFurnace.get(1)); + RecipeUtils.addShapedRecipe( + gear, + CI.getTieredCircuit(6), + gear, + CI.robotArm_IV, + GregtechItemList.Casing_Adv_BlastFurnace.get(1), + CI.robotArm_IV, + plate, + GregtechItemList.Gregtech_Computer_Cube.get(1), + plate, + GregtechItemList.Machine_Adv_BlastFurnace.get(1)); + // Hatch_Input_Pyrotheum + GTValues.RA.stdBuilder() + .itemInputs( + ItemList.Hatch_Input_IV.get(1), GregtechItemList.Casing_Adv_BlastFurnace.get(1), - CI.robotArm_IV, - plate, - GregtechItemList.Gregtech_Computer_Cube.get(1), - plate, - GregtechItemList.Machine_Adv_BlastFurnace.get(1)); - // Hatch_Input_Pyrotheum - GTValues.RA.stdBuilder() - .itemInputs( - ItemList.Hatch_Input_IV.get(1), - GregtechItemList.Casing_Adv_BlastFurnace.get(1), - MaterialsAlloy.MARAGING250.getPlate(4), - MaterialsAlloy.MARAGING300.getGear(1), - GTOreDictUnificator.get(OrePrefixes.circuit, Materials.IV, 2), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(GregtechItemList.Hatch_Input_Pyrotheum.get(1L)) - .duration(2 * SECONDS + 10 * TICKS) - .eut(16) - .addTo(assemblerRecipes); - // Casing_Adv_BlastFurnace - GTValues.RA.stdBuilder() - .itemInputs( - MaterialsAlloy.HASTELLOY_X.getFrameBox(1), - MaterialsAlloy.HASTELLOY_N.getPlateDouble(4), - MaterialsAlloy.HASTELLOY_W.getGear(1), - ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1), - ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1), - ItemUtils.simpleMetaStack("IC2:reactorVentDiamond:1:1", 1, 1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(GregtechItemList.Casing_Adv_BlastFurnace.get(1L)) - .duration(2 * SECONDS + 10 * TICKS) - .eut(16) - .addTo(assemblerRecipes); - - // Advanced Implosion Compressor - plate = ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 1); - gear = MaterialsAlloy.LEAGRISIUM.getGear(1); - frame = MaterialsAlloy.CINOBITE.getFrameBox(1); - cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); - cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); + MaterialsAlloy.MARAGING250.getPlate(4), + MaterialsAlloy.MARAGING300.getGear(1), + GTOreDictUnificator.get(OrePrefixes.circuit, Materials.IV, 2), + GTUtility.getIntegratedCircuit(1)) + .itemOutputs(GregtechItemList.Hatch_Input_Pyrotheum.get(1L)) + .duration(2 * SECONDS + 10 * TICKS) + .eut(16) + .addTo(assemblerRecipes); + // Casing_Adv_BlastFurnace + GTValues.RA.stdBuilder() + .itemInputs( + MaterialsAlloy.HASTELLOY_X.getFrameBox(1), + MaterialsAlloy.HASTELLOY_N.getPlateDouble(4), + MaterialsAlloy.HASTELLOY_W.getGear(1), + ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1), + ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1), + ItemUtils.simpleMetaStack("IC2:reactorVentDiamond:1:1", 1, 1), + GTUtility.getIntegratedCircuit(1)) + .itemOutputs(GregtechItemList.Casing_Adv_BlastFurnace.get(1L)) + .duration(2 * SECONDS + 10 * TICKS) + .eut(16) + .addTo(assemblerRecipes); - RecipeUtils.addShapedRecipe( - gear, - CI.getTieredCircuit(6), - gear, - CI.fieldGenerator_IV, - CI.machineHull_ZPM, - CI.robotArm_IV, - plate, - GregtechItemList.Gregtech_Computer_Cube.get(1), - plate, - GregtechItemList.Machine_Adv_ImplosionCompressor.get(1)); + // Advanced Implosion Compressor + plate = ItemUtils.getItemStackOfAmountFromOreDict("plateAlloyIridium", 1); + gear = MaterialsAlloy.LEAGRISIUM.getGear(1); + frame = MaterialsAlloy.CINOBITE.getFrameBox(1); + cell1 = ItemUtils.simpleMetaStack("IC2:reactorHeatSwitchDiamond:1", 1, 1); + cell2 = ItemUtils.simpleMetaStack("IC2:reactorVentGold:1", 1, 1); - // Supply Depot - plate = MaterialsAlloy.TUNGSTEN_CARBIDE.getPlateDouble(1); - gear = MaterialsAlloy.TRINIUM_TITANIUM.getRing(1); - frame = MaterialsAlloy.TUNGSTEN_CARBIDE.getFrameBox(1); - cell1 = CI.conveyorModule_LuV; - cell2 = CI.electricMotor_LuV; - ItemStack casingAmazon = GregtechItemList.Casing_AmazonWarehouse.get(1); + RecipeUtils.addShapedRecipe( + gear, + CI.getTieredCircuit(6), + gear, + CI.fieldGenerator_IV, + CI.machineHull_ZPM, + CI.robotArm_IV, + plate, + GregtechItemList.Gregtech_Computer_Cube.get(1), + plate, + GregtechItemList.Machine_Adv_ImplosionCompressor.get(1)); + + // Supply Depot + plate = MaterialsAlloy.TUNGSTEN_CARBIDE.getPlateDouble(1); + gear = MaterialsAlloy.TRINIUM_TITANIUM.getRing(1); + frame = MaterialsAlloy.TUNGSTEN_CARBIDE.getFrameBox(1); + cell1 = CI.conveyorModule_LuV; + cell2 = CI.electricMotor_LuV; + ItemStack casingAmazon = GregtechItemList.Casing_AmazonWarehouse.get(1); - RecipeUtils.addShapedRecipe( - plate, + RecipeUtils.addShapedRecipe( + plate, + ItemUtils.getItemStackOfAmountFromOreDict("cableGt12VanadiumGallium", 1), + plate, + cell1, + frame, + cell2, + plate, + gear, + plate, + GregtechItemList.Casing_AmazonWarehouse.get(1)); + GTValues.RA.stdBuilder() + .itemInputs( + MaterialsAlloy.TUNGSTEN_CARBIDE.getFrameBox(1), + MaterialsAlloy.TUNGSTEN_CARBIDE.getPlateDouble(4), + MaterialsAlloy.TRINIUM_TITANIUM.getRing(1), + ItemList.Electric_Motor_LuV.get(1), + ItemList.Conveyor_Module_LuV.get(1), ItemUtils.getItemStackOfAmountFromOreDict("cableGt12VanadiumGallium", 1), - plate, - cell1, - frame, - cell2, - plate, - gear, - plate, - GregtechItemList.Casing_AmazonWarehouse.get(1)); - GTValues.RA.stdBuilder() - .itemInputs( - MaterialsAlloy.TUNGSTEN_CARBIDE.getFrameBox(1), - MaterialsAlloy.TUNGSTEN_CARBIDE.getPlateDouble(4), - MaterialsAlloy.TRINIUM_TITANIUM.getRing(1), - ItemList.Electric_Motor_LuV.get(1), - ItemList.Conveyor_Module_LuV.get(1), - ItemUtils.getItemStackOfAmountFromOreDict("cableGt12VanadiumGallium", 1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(GregtechItemList.Casing_AmazonWarehouse.get(1L)) - .duration(2 * SECONDS + 10 * TICKS) - .eut(16) - .addTo(assemblerRecipes); - - RecipeUtils.addShapedRecipe( - casingAmazon, - CI.getTieredCircuit(7), - casingAmazon, - CI.robotArm_LuV, - ItemList.Machine_LuV_Unboxinator.get(1), - CI.robotArm_LuV, - CI.conveyorModule_LuV, - GregtechItemList.Gregtech_Computer_Cube.get(1), - CI.conveyorModule_LuV, - GregtechItemList.Amazon_Warehouse_Controller.get(1)); - - // Industrial Mixing Machine - RecipeUtils.addShapedRecipe( - "plateStaballoy", - CI.getTieredCircuit(5), - "plateStaballoy", - "plateZirconiumCarbide", - IV_MACHINE_Mixer, - "plateZirconiumCarbide", - "plateStaballoy", - CI.getTieredCircuit(5), - "plateStaballoy", - GregtechItemList.Industrial_Mixer.get(1)); + GTUtility.getIntegratedCircuit(1)) + .itemOutputs(GregtechItemList.Casing_AmazonWarehouse.get(1L)) + .duration(2 * SECONDS + 10 * TICKS) + .eut(16) + .addTo(assemblerRecipes); - final ItemStack staballoyPlate = MaterialsAlloy.STABALLOY.getPlate(1); + RecipeUtils.addShapedRecipe( + casingAmazon, + CI.getTieredCircuit(7), + casingAmazon, + CI.robotArm_LuV, + ItemList.Machine_LuV_Unboxinator.get(1), + CI.robotArm_LuV, + CI.conveyorModule_LuV, + GregtechItemList.Gregtech_Computer_Cube.get(1), + CI.conveyorModule_LuV, + GregtechItemList.Amazon_Warehouse_Controller.get(1)); + + // Industrial Mixing Machine + RecipeUtils.addShapedRecipe( + "plateStaballoy", + CI.getTieredCircuit(5), + "plateStaballoy", + "plateZirconiumCarbide", + IV_MACHINE_Mixer, + "plateZirconiumCarbide", + "plateStaballoy", + CI.getTieredCircuit(5), + "plateStaballoy", + GregtechItemList.Industrial_Mixer.get(1)); - RecipeUtils.addShapedRecipe( - staballoyPlate, - CI.craftingToolHammer_Hard, - staballoyPlate, - "plateStainlessSteel", - "frameGtZirconiumCarbide", - "plateStainlessSteel", - staballoyPlate, - CI.craftingToolWrench, - staballoyPlate, - GregtechItemList.Casing_Multi_Use.get(1)); + final ItemStack staballoyPlate = MaterialsAlloy.STABALLOY.getPlate(1); - GTValues.RA.stdBuilder() - .itemInputs( - MaterialsAlloy.STABALLOY.getPlate(4), - GTOreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 2), - MaterialsAlloy.ZIRCONIUM_CARBIDE.getFrameBox(1), - GTUtility.getIntegratedCircuit(1)) - .itemOutputs(GregtechItemList.Casing_Multi_Use.get(1L)) - .duration(2 * SECONDS + 10 * TICKS) - .eut(16) - .addTo(assemblerRecipes); - } + RecipeUtils.addShapedRecipe( + staballoyPlate, + CI.craftingToolHammer_Hard, + staballoyPlate, + "plateStainlessSteel", + "frameGtZirconiumCarbide", + "plateStainlessSteel", + staballoyPlate, + CI.craftingToolWrench, + staballoyPlate, + GregtechItemList.Casing_Multi_Use.get(1)); + + GTValues.RA.stdBuilder() + .itemInputs( + MaterialsAlloy.STABALLOY.getPlate(4), + GTOreDictUnificator.get(OrePrefixes.plate, Materials.StainlessSteel, 2), + MaterialsAlloy.ZIRCONIUM_CARBIDE.getFrameBox(1), + GTUtility.getIntegratedCircuit(1)) + .itemOutputs(GregtechItemList.Casing_Multi_Use.get(1L)) + .duration(2 * SECONDS + 10 * TICKS) + .eut(16) + .addTo(assemblerRecipes); // Drilling Platform Casings GTValues.RA.stdBuilder() diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java index 113440e8b5..4b687f63af 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java +++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityCircuitProgrammer.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.tileentities.general; +import java.util.ArrayList; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -10,7 +12,6 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity; import net.minecraft.tileentity.TileEntity; import gregtech.api.util.GTUtility; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.inventories.InventoryCircuitProgrammer; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.slots.SlotIntegratedCircuit; @@ -69,11 +70,11 @@ public class TileEntityCircuitProgrammer extends TileEntity implements ISidedInv if (aInputs[25] != null) { hasOutput = true; } - AutoMap<Integer> aValidSlots = new AutoMap<>(); + ArrayList<Integer> aValidSlots = new ArrayList<>(); int aSlotCount = 0; for (ItemStack i : aInputs) { if (i != null) { - aValidSlots.put(aSlotCount); + aValidSlots.add(aSlotCount); } aSlotCount++; } diff --git a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java index 7f1cde2476..14c337c088 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java +++ b/src/main/java/gtPlusPlus/core/tileentities/general/TileEntityVolumetricFlaskSetter.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.tileentities.general; +import java.util.ArrayList; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -11,7 +13,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.FluidStack; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.container.ContainerVolumetricFlaskSetter; import gtPlusPlus.core.inventories.InventoryVolumetricFlaskSetter; import gtPlusPlus.core.util.math.MathUtils; @@ -130,11 +131,11 @@ public class TileEntityVolumetricFlaskSetter extends TileEntity implements ISide return false; } } - AutoMap<Integer> aValidSlots = new AutoMap<>(); + ArrayList<Integer> aValidSlots = new ArrayList<>(); int aSlotCount = 0; for (ItemStack i : aInputs) { if (i != null) { - aValidSlots.put(aSlotCount); + aValidSlots.add(aSlotCount); } aSlotCount++; } diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java index 5e0aaf8370..6f0d5fcea2 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java +++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityAdvPooCollector.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.tileentities.machines; +import java.util.ArrayList; + import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityChicken; @@ -14,7 +16,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -63,10 +64,10 @@ public class TileEntityAdvPooCollector extends TileEntityBaseFluidCollector { return false; } - private static AutoMap<Class> aEntityToDrain = new AutoMap<>(); + private static final ArrayList<Class> aEntityToDrain = new ArrayList<>(); @Override - public AutoMap<Class> aThingsToLookFor() { + public ArrayList<Class> aThingsToLookFor() { if (aEntityToDrain.isEmpty()) { aEntityToDrain.add(EntityAnimal.class); aEntityToDrain.add(IAnimals.class); diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java index 6340415e82..988268f6e9 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java +++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityBaseFluidCollector.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.tileentities.machines; +import java.util.ArrayList; import java.util.List; import net.minecraft.entity.item.EntityItem; @@ -19,7 +20,6 @@ import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BTF_FluidTank; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.tileentities.base.TileEntityBase; @@ -150,7 +150,7 @@ public abstract class TileEntityBaseFluidCollector extends TileEntityBase implem return MathUtils.randInt(200, 300); } - public abstract AutoMap<Class> aThingsToLookFor(); + public abstract ArrayList<Class> aThingsToLookFor(); public abstract void onPreLogicTick(); @@ -227,7 +227,7 @@ public abstract class TileEntityBaseFluidCollector extends TileEntityBase implem /** * Return the amount of fluid for this entity type - * + * * @param aEntity * @return */ diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java index c91476f556..08ceed597d 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java +++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPestKiller.java @@ -28,7 +28,6 @@ import net.minecraftforge.oredict.OreDictionary; import forestry.lepidopterology.entities.EntityButterfly; import gregtech.api.enums.Mods; import gregtech.api.util.GTUtility; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BTF_FluidTank; import gtPlusPlus.core.inventories.InventoryPestKiller; import gtPlusPlus.core.material.MaterialMisc; @@ -51,12 +50,12 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory, private boolean mNeedsUpdate = false; private String mCustomName; - private static final AutoMap<Class<?>> mEntityMap = new AutoMap<>(); + private static final ArrayList<Class<?>> mEntityMap = new ArrayList<>(); static { - mEntityMap.put(EntityBat.class); + mEntityMap.add(EntityBat.class); if (Mods.Forestry.isModLoaded()) { - mEntityMap.put(EntityButterfly.class); + mEntityMap.add(EntityButterfly.class); } } @@ -102,7 +101,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory, // code block } int aChunkCount = 0; - AutoMap<Entity> entities = new AutoMap<>(); + ArrayList<Entity> entities = new ArrayList<>(); if (min != 0 && max != 0) { for (int x = min; x < max; x++) { for (int z = min; z < max; z++) { @@ -117,7 +116,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory, for (Class<?> C : mEntityMap) { if (e.getClass() .equals(C) || C.isAssignableFrom(e.getClass())) { - entities.put((Entity) e); + entities.add((Entity) e); } } } @@ -138,7 +137,7 @@ public class TileEntityPestKiller extends TileEntity implements ISidedInventory, for (Class<?> C : mEntityMap) { if (e.getClass() .equals(C) || C.isAssignableFrom(e.getClass())) { - entities.put((Entity) e); + entities.add((Entity) e); } } } diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java index d0d4ee3661..90864d1878 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java +++ b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityPooCollector.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.tileentities.machines; +import java.util.ArrayList; + import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityChicken; @@ -12,7 +14,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -67,10 +68,10 @@ public class TileEntityPooCollector extends TileEntityBaseFluidCollector { return false; } - private static AutoMap<Class> aEntityToDrain = new AutoMap<>(); + private static final ArrayList<Class> aEntityToDrain = new ArrayList<>(); @Override - public AutoMap<Class> aThingsToLookFor() { + public ArrayList<Class> aThingsToLookFor() { if (aEntityToDrain.isEmpty()) { aEntityToDrain.add(EntityAnimal.class); aEntityToDrain.add(IAnimals.class); diff --git a/src/main/java/gtPlusPlus/core/util/data/StringUtils.java b/src/main/java/gtPlusPlus/core/util/data/StringUtils.java index 77efadbc9a..c2a923bb75 100644 --- a/src/main/java/gtPlusPlus/core/util/data/StringUtils.java +++ b/src/main/java/gtPlusPlus/core/util/data/StringUtils.java @@ -1,7 +1,8 @@ package gtPlusPlus.core.util.data; +import java.util.ArrayList; + import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.Utils; public class StringUtils { @@ -105,7 +106,7 @@ public class StringUtils { /** * Is this a special regex character for delimination? (.$|()[]{}^?*+\\) - * + * * @param aChar - The char to test * @return - Is this a special character? */ @@ -146,18 +147,18 @@ public class StringUtils { Logger.INFO("Splitting " + aInput); String[] aSplit = aInput.split(aDelim); - Logger.INFO("Split into " + aSplit == null ? "" + 0 : aSplit.length + " parts."); - if (aSplit == null || aSplit.length == 0) { + Logger.INFO(aSplit.length + " parts."); + if (aSplit.length == 0) { return aInput; } else { - AutoMap<String> aTemp = new AutoMap<>(); + ArrayList<String> aTemp = new ArrayList<>(); for (String s : aSplit) { Logger.INFO("Found: " + s); s = s.replace(".", ""); s = Utils.sanitizeString(s); s = firstLetterCaps(s); Logger.INFO("Formatted & Captilized: " + s); - aTemp.put(s); + aTemp.add(s); } Logger.INFO("Rebuilding"); StringBuilder aReturn = new StringBuilder(); diff --git a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java index 4fb34bd158..05e238b098 100644 --- a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java @@ -1,12 +1,12 @@ package gtPlusPlus.core.util.math; import java.text.NumberFormat; +import java.util.ArrayList; import java.util.Map; import java.util.Random; import gregtech.api.enums.GTValues; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.Utils; @@ -291,7 +291,7 @@ public class MathUtils { * Averages */ - public static byte getByteAverage(AutoMap<Byte> aDataSet) { + public static byte getByteAverage(ArrayList<Byte> aDataSet) { byte[] aNewSet = new byte[aDataSet.size()]; for (int u = 0; u < aDataSet.size(); u++) { byte b = getSafeByte(aDataSet.get(u)); @@ -300,7 +300,7 @@ public class MathUtils { return getByteAverage(aNewSet); } - public static short getShortAverage(AutoMap<Short> aDataSet) { + public static short getShortAverage(ArrayList<Short> aDataSet) { short[] aNewSet = new short[aDataSet.size()]; for (int u = 0; u < aDataSet.size(); u++) { short b = getSafeShort(aDataSet.get(u)); @@ -309,7 +309,7 @@ public class MathUtils { return getShortAverage(aNewSet); } - public static int getIntAverage(AutoMap<Integer> aDataSet) { + public static int getIntAverage(ArrayList<Integer> aDataSet) { int[] aNewSet = new int[aDataSet.size()]; for (int u = 0; u < aDataSet.size(); u++) { int b = getSafeInt(aDataSet.get(u)); @@ -318,7 +318,7 @@ public class MathUtils { return getIntAverage(aNewSet); } - public static long getLongAverage(AutoMap<Long> aDataSet) { + public static long getLongAverage(ArrayList<Long> aDataSet) { long[] aNewSet = new long[aDataSet.size()]; for (int u = 0; u < aDataSet.size(); u++) { long b = getSafeLong(aDataSet.get(u)); diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java index 26d7783b78..930ab6c34a 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/ItemUtils.java @@ -35,7 +35,6 @@ import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; import gregtech.common.items.MetaGeneratedTool01; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.base.dusts.BaseItemDustUnique; @@ -855,10 +854,10 @@ public class ItemUtils { public static ItemStack[] cleanItemStackArray(ItemStack[] input) { int aArraySize = input.length; ItemStack[] aOutput = new ItemStack[aArraySize]; - AutoMap<ItemStack> aCleanedItems = new AutoMap<>(); + ArrayList<ItemStack> aCleanedItems = new ArrayList<>(); for (ItemStack checkStack : input) { if (ItemUtils.checkForInvalidItems(checkStack)) { - aCleanedItems.put(checkStack); + aCleanedItems.add(checkStack); } } for (int i = 0; i < aArraySize; i++) { diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java index 6675e19891..8b0d73cc8b 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java @@ -1,5 +1,6 @@ package gtPlusPlus.core.util.minecraft; +import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.List; @@ -15,7 +16,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.TypeCounter; import gtPlusPlus.core.client.CustomTextureSet.TextureSets; import gtPlusPlus.core.item.base.BaseItemComponent; @@ -292,15 +292,15 @@ public class MaterialUtils { return m; } - public static AutoMap<Material> getCompoundMaterialsRecursively(Material aMat) { + public static ArrayList<Material> getCompoundMaterialsRecursively(Material aMat) { return getCompoundMaterialsRecursively_Speiger(aMat); } - public static AutoMap<Material> getCompoundMaterialsRecursively_Speiger(Material toSearch) { - AutoMap<Material> resultList = new AutoMap<>(); + public static ArrayList<Material> getCompoundMaterialsRecursively_Speiger(Material toSearch) { + ArrayList<Material> resultList = new ArrayList<>(); if (toSearch.getComposites() .isEmpty()) { - resultList.put(toSearch); + resultList.add(toSearch); return resultList; } final int HARD_LIMIT = 1000; @@ -315,7 +315,7 @@ public class MaterialUtils { Material current = toCheck.remove(); if (current.getComposites() .isEmpty()) { - resultList.put(current); + resultList.add(current); } else { for (MaterialStack entry : current.getComposites()) { toCheck.add(entry.getStackMaterial()); diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java index 8845409da9..34945a5d8a 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/MiningUtils.java @@ -1,11 +1,11 @@ package gtPlusPlus.core.util.minecraft; +import java.util.ArrayList; import java.util.HashMap; import gregtech.api.enums.Mods; import gregtech.common.WorldgenGTOreLayer; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.reflect.ReflectionUtils; import micdoodle8.mods.galacticraft.core.util.ConfigManagerCore; import micdoodle8.mods.galacticraft.planets.asteroids.ConfigManagerAsteroids; @@ -22,7 +22,7 @@ public class MiningUtils { String aTextWorldGen; if (MiningUtils.findAndMapOreTypesFromGT()) { int mapKey = 0; - for (AutoMap<WorldgenGTOreLayer> g : MiningUtils.mOreMaps) { + for (ArrayList<WorldgenGTOreLayer> g : MiningUtils.mOreMaps) { for (WorldgenGTOreLayer h : g) { try { @@ -40,14 +40,14 @@ public class MiningUtils { } } - public static AutoMap<WorldgenGTOreLayer>[] mOreMaps = new AutoMap[7]; - private static final AutoMap<WorldgenGTOreLayer> Ores_Overworld = new AutoMap<>(); - private static final AutoMap<WorldgenGTOreLayer> Ores_Nether = new AutoMap<>(); - private static final AutoMap<WorldgenGTOreLayer> Ores_End = new AutoMap<>(); - private static final AutoMap<WorldgenGTOreLayer> Ores_Moon = new AutoMap<>(); - private static final AutoMap<WorldgenGTOreLayer> Ores_Mars = new AutoMap<>(); - private static final AutoMap<WorldgenGTOreLayer> Ores_Comets = new AutoMap<>(); - private static final AutoMap<WorldgenGTOreLayer> Ores_Misc = new AutoMap<>(); + public static ArrayList<WorldgenGTOreLayer>[] mOreMaps = new ArrayList[7]; + private static final ArrayList<WorldgenGTOreLayer> Ores_Overworld = new ArrayList<>(); + private static final ArrayList<WorldgenGTOreLayer> Ores_Nether = new ArrayList<>(); + private static final ArrayList<WorldgenGTOreLayer> Ores_End = new ArrayList<>(); + private static final ArrayList<WorldgenGTOreLayer> Ores_Moon = new ArrayList<>(); + private static final ArrayList<WorldgenGTOreLayer> Ores_Mars = new ArrayList<>(); + private static final ArrayList<WorldgenGTOreLayer> Ores_Comets = new ArrayList<>(); + private static final ArrayList<WorldgenGTOreLayer> Ores_Misc = new ArrayList<>(); public static boolean findAndMapOreTypesFromGT() { // Gets Moon ID @@ -73,20 +73,20 @@ public class MiningUtils { for (WorldgenGTOreLayer gtOreLayer : WorldgenGTOreLayer.sList) { if (gtOreLayer.mEnabled) { if (gtOreLayer.mOverworld) { - Ores_Overworld.put(gtOreLayer); + Ores_Overworld.add(gtOreLayer); } if (gtOreLayer.mNether) { - Ores_Nether.put(gtOreLayer); + Ores_Nether.add(gtOreLayer); } if (gtOreLayer.mEnd || gtOreLayer.mEndAsteroid) { - Ores_End.put(gtOreLayer); + Ores_End.add(gtOreLayer); } if (gtOreLayer.mOverworld || gtOreLayer.mNether || (gtOreLayer.mEnd || gtOreLayer.mEndAsteroid)) { continue; } - Ores_Misc.put(gtOreLayer); + Ores_Misc.add(gtOreLayer); } else { - Ores_Comets.put(gtOreLayer); + Ores_Comets.add(gtOreLayer); } } diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java index 6df6974030..792119d1bc 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java @@ -65,7 +65,7 @@ public class RecipeUtils { try { int size = CompatHandler.mRecipesToGenerate.size(); - CompatHandler.mRecipesToGenerate.put(new InternalRecipeObject(o, resultItem, false)); + CompatHandler.mRecipesToGenerate.add(new InternalRecipeObject(o, resultItem, false)); // Utils.LOG_WARNING("Success! Added a recipe for "+resultItem.getDisplayName()); if (CompatHandler.mRecipesToGenerate.size() > size) { if (!CompatHandler.areInitItemsLoaded) { @@ -171,7 +171,7 @@ public class RecipeUtils { } int size = CompatHandler.mGtRecipesToGenerate.size(); - CompatHandler.mGtRecipesToGenerate.put(new InternalRecipeObject(o, OutputItem, true)); + CompatHandler.mGtRecipesToGenerate.add(new InternalRecipeObject(o, OutputItem, true)); if (CompatHandler.mGtRecipesToGenerate.size() > size) { if (!CompatHandler.areInitItemsLoaded) { @@ -415,7 +415,7 @@ public class RecipeUtils { ShapedOreRecipe aRecipe = new ShapedOreRecipe(aOutputStack, aDataObject); int size = CompatHandler.mRecipesToGenerate.size(); - CompatHandler.mRecipesToGenerate.put(new InternalRecipeObject2(aRecipe)); + CompatHandler.mRecipesToGenerate.add(new InternalRecipeObject2(aRecipe)); if (CompatHandler.mRecipesToGenerate.size() > size) { if (!CompatHandler.areInitItemsLoaded) { RegistrationHandler.recipesSuccess++; diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java index d9cf2e3769..f753561d71 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/gregtech/PollutionUtils.java @@ -1,5 +1,7 @@ package gtPlusPlus.core.util.minecraft.gregtech; +import java.util.ArrayList; + import net.minecraft.item.ItemStack; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.fluids.FluidStack; @@ -12,7 +14,6 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.common.Pollution; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.base.cell.BaseItemCell; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.material.MaterialMisc; @@ -21,7 +22,7 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; public class PollutionUtils { - public static AutoMap<FluidStack> mPollutionFluidStacks = new AutoMap<>(); + public static ArrayList<FluidStack> mPollutionFluidStacks = new ArrayList<>(); public static boolean isPollutionEnabled() { return GTMod.gregtechproxy.mPollution; @@ -99,10 +100,10 @@ public class PollutionUtils { CD = FluidUtils.getFluidStack("carbondioxide", 1000); CM = FluidUtils.getFluidStack("carbonmonoxide", 1000); SD = FluidUtils.getFluidStack("sulfurdioxide", 1000); - if (PollutionUtils.mPollutionFluidStacks.size() == 0) { + if (PollutionUtils.mPollutionFluidStacks.isEmpty()) { if (CD != null) { Logger.INFO("[PollutionCompat] Found carbon dioxide fluid, registering it."); - PollutionUtils.mPollutionFluidStacks.put(CD); + PollutionUtils.mPollutionFluidStacks.add(CD); MaterialMisc.CARBON_DIOXIDE.registerComponentForMaterial(CD); ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonDioxide", 1); if (ItemUtils.checkForInvalidItems(cellCD)) { @@ -118,7 +119,7 @@ public class PollutionUtils { if (CM != null) { Logger.INFO("[PollutionCompat] Found carbon monoxide fluid, registering it."); - PollutionUtils.mPollutionFluidStacks.put(CM); + PollutionUtils.mPollutionFluidStacks.add(CM); MaterialMisc.CARBON_MONOXIDE.registerComponentForMaterial(CM); ItemStack cellCD = ItemUtils.getItemStackOfAmountFromOreDict("cellCarbonMonoxide", 1); if (ItemUtils.checkForInvalidItems(cellCD)) { @@ -134,7 +135,7 @@ public class PollutionUtils { if (SD != null) { Logger.INFO("[PollutionCompat] Found sulfur dioxide fluid, registering it."); - PollutionUtils.mPollutionFluidStacks.put(SD); + PollutionUtils.mPollutionFluidStacks.add(SD); } } } else { diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java b/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java index 263971cdc4..5164967a90 100644 --- a/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java +++ b/src/main/java/gtPlusPlus/plugin/agrichem/BioRecipes.java @@ -47,7 +47,6 @@ import gregtech.api.util.GTModHandler; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTRecipeConstants; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.ModItems; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.item.chemistry.AgriculturalChem; @@ -535,8 +534,8 @@ public class BioRecipes { public static final HashSet<GTItemStack> mNuts = new HashSet<>(); public static final HashSet<GTItemStack> mSeeds = new HashSet<>(); - public static final AutoMap<ItemStack> mList_Master_FruitVege = new AutoMap<>(); - public static final AutoMap<ItemStack> mList_Master_Seeds = new AutoMap<>(); + public static final ArrayList<ItemStack> mList_Master_FruitVege = new ArrayList<>(); + public static final ArrayList<ItemStack> mList_Master_Seeds = new ArrayList<>(); private static void processFermentationOreDict() { processOreDictEntry("listAllfruit", mFruits); @@ -550,22 +549,22 @@ public class BioRecipes { if (!mFruits.isEmpty()) { for (GTItemStack g : mFruits) { - mList_Master_FruitVege.put(g.toStack()); + mList_Master_FruitVege.add(g.toStack()); } } if (!mVege.isEmpty()) { for (GTItemStack g : mVege) { - mList_Master_FruitVege.put(g.toStack()); + mList_Master_FruitVege.add(g.toStack()); } } if (!mNuts.isEmpty()) { for (GTItemStack g : mNuts) { - mList_Master_FruitVege.put(g.toStack()); + mList_Master_FruitVege.add(g.toStack()); } } if (!mSeeds.isEmpty()) { for (GTItemStack g : mSeeds) { - mList_Master_Seeds.put(g.toStack()); + mList_Master_Seeds.add(g.toStack()); } } } @@ -582,8 +581,8 @@ public class BioRecipes { private static void recipeFermentationBase() { processFermentationOreDict(); - AutoMap<ItemStack> aFruitVege = mList_Master_FruitVege; - AutoMap<ItemStack> aSeeds = mList_Master_Seeds; + ArrayList<ItemStack> aFruitVege = mList_Master_FruitVege; + ArrayList<ItemStack> aSeeds = mList_Master_Seeds; ArrayList<ItemStack> aMap = OreDictionary.getOres("cropSugarbeet"); for (ItemStack a : aFruitVege) { if (aMap.contains(a)) { @@ -797,17 +796,17 @@ public class BioRecipes { private static void recipeAluminiumPellet() { // Ore Names, no prefix - AutoMap<String> aOreNames = new AutoMap<>(); - - aOreNames.put("Lazurite"); - aOreNames.put("Bauxite"); - aOreNames.put("Grossular"); - aOreNames.put("Pyrope"); - aOreNames.put("Sodalite"); - aOreNames.put("Spodumene"); - aOreNames.put("Ruby"); - aOreNames.put("Sapphire"); - aOreNames.put("GreenSapphire"); + ArrayList<String> aOreNames = new ArrayList<>(); + + aOreNames.add("Lazurite"); + aOreNames.add("Bauxite"); + aOreNames.add("Grossular"); + aOreNames.add("Pyrope"); + aOreNames.add("Sodalite"); + aOreNames.add("Spodumene"); + aOreNames.add("Ruby"); + aOreNames.add("Sapphire"); + aOreNames.add("GreenSapphire"); // Voltage HashMap<String, Integer> aOreData1 = new HashMap<>(); diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java index f34348a3af..ac38b78936 100644 --- a/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java +++ b/src/main/java/gtPlusPlus/plugin/agrichem/item/algae/ItemAlgaeBase.java @@ -2,6 +2,7 @@ package gtPlusPlus.plugin.agrichem.item.algae; import static gregtech.api.enums.Mods.GTPlusPlus; +import java.util.ArrayList; import java.util.List; import net.minecraft.client.renderer.texture.IIconRegister; @@ -17,7 +18,6 @@ import net.minecraft.util.IIcon; import net.minecraft.world.World; import cpw.mods.fml.common.registry.GameRegistry; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.plugin.agrichem.AlgaeDefinition; import gtPlusPlus.plugin.agrichem.IAlgalItem; @@ -213,7 +213,7 @@ public class ItemAlgaeBase extends Item implements IAlgalItem { aSpeed, aLifespan, 0, - new AutoMap<>()); + new ArrayList<>()); aTag = aGenes.writeToNBT(); } } else { diff --git a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java b/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java index 6b7b72aa71..ef36d73686 100644 --- a/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java +++ b/src/main/java/gtPlusPlus/plugin/agrichem/logic/AlgaeGeneticData.java @@ -1,8 +1,8 @@ package gtPlusPlus.plugin.agrichem.logic; -import net.minecraft.nbt.NBTTagCompound; +import java.util.ArrayList; -import gtPlusPlus.api.objects.data.AutoMap; +import net.minecraft.nbt.NBTTagCompound; public class AlgaeGeneticData { @@ -24,15 +24,15 @@ public class AlgaeGeneticData { private final float mProductionSpeed; - private final AutoMap<AlgaeGrowthRequirement> mSpecialRequirements; + private final ArrayList<AlgaeGrowthRequirement> mSpecialRequirements; public AlgaeGeneticData() { - this(true, true, true, true, (byte) 0, 1f, 1f, (byte) 30, 0, new AutoMap<>()); + this(true, true, true, true, (byte) 0, 1f, 1f, (byte) 30, 0, new ArrayList<>()); } public AlgaeGeneticData(boolean isDominant, boolean requiresLight, boolean isSalt, boolean isFresh, byte aTempTolerance, float aFertility, float aSpeed, byte aLifespan, int aGeneration, - AutoMap<AlgaeGrowthRequirement> aRequirements) { + ArrayList<AlgaeGrowthRequirement> aRequirements) { mIsDominant = isDominant; mRequiresLight = requiresLight; mSaltWater = isSalt; @@ -67,7 +67,7 @@ public class AlgaeGeneticData { mLifespan = aNBT.getByte("mLifespan"); mGeneration = aNBT.getInteger("mGeneration"); } - mSpecialRequirements = new AutoMap<>(); + mSpecialRequirements = new ArrayList<>(); } /** @@ -109,7 +109,7 @@ public class AlgaeGeneticData { return this.mGeneration; } - public final AutoMap<AlgaeGrowthRequirement> getSpecialRequirements() { + public final ArrayList<AlgaeGrowthRequirement> getSpecialRequirements() { return this.mSpecialRequirements; } diff --git a/src/main/java/gtPlusPlus/plugin/manager/CoreManager.java b/src/main/java/gtPlusPlus/plugin/manager/CoreManager.java index d547ace5cb..f618be2d9f 100644 --- a/src/main/java/gtPlusPlus/plugin/manager/CoreManager.java +++ b/src/main/java/gtPlusPlus/plugin/manager/CoreManager.java @@ -1,20 +1,21 @@ package gtPlusPlus.plugin.manager; +import java.util.ArrayList; + import gtPlusPlus.api.interfaces.IPlugin; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.reflect.ReflectionUtils; public class CoreManager { - public static AutoMap<IPlugin> mPlugins = new AutoMap<>(); + public static ArrayList<IPlugin> mPlugins = new ArrayList<>(); /** * @param plugin - Dynamically registers the plugin for loading. */ public static void registerPlugin(IPlugin plugin) { Logger.INFO("[Plugin] " + "Registered " + plugin.getPluginName() + "."); - mPlugins.put(plugin); + mPlugins.add(plugin); } /** diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchCatalysts.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchCatalysts.java index 13bb4b44f1..ca8624a7d2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchCatalysts.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchCatalysts.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers; +import java.util.ArrayList; + import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; @@ -9,7 +11,6 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GTRenderedTexture; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -55,8 +56,8 @@ public class MTEHatchCatalysts extends MTEHatchNbtConsumable { } @Override - public AutoMap<ItemStack> getItemsValidForUsageSlots() { - return new AutoMap<>(); + public ArrayList<ItemStack> getItemsValidForUsageSlots() { + return new ArrayList<>(); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchMillingBalls.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchMillingBalls.java index a40ea08ec1..9f50f9846e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchMillingBalls.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/MTEHatchMillingBalls.java @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers; +import java.util.ArrayList; + import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; @@ -9,7 +11,6 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GTRenderedTexture; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @@ -55,8 +56,8 @@ public class MTEHatchMillingBalls extends MTEHatchNbtConsumable { } @Override - public AutoMap<ItemStack> getItemsValidForUsageSlots() { - return new AutoMap<>(); + public ArrayList<ItemStack> getItemsValidForUsageSlots() { + return new ArrayList<>(); } @Override 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 dbcef2d9e7..b626bcc8ba 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 @@ -1,5 +1,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers; +import java.util.ArrayList; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; @@ -18,7 +20,6 @@ import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.implementations.MTEHatch; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.util.minecraft.ItemUtils; public abstract class MTEHatchNbtConsumable extends MTEHatch implements IAddGregtechLogo { @@ -165,8 +166,8 @@ public abstract class MTEHatchNbtConsumable extends MTEHatch implements IAddGreg return mTotalSlotCount - 1; } - public final AutoMap<ItemStack> getContentUsageSlots() { - AutoMap<ItemStack> aItems = new AutoMap<>(); + public final ArrayList<ItemStack> getContentUsageSlots() { + ArrayList<ItemStack> aItems = new ArrayList<>(); for (int i = mInputslotCount; i < mTotalSlotCount; i++) { if (mInventory[i] != null) { aItems.add(mInventory[i]); @@ -248,7 +249,7 @@ public abstract class MTEHatchNbtConsumable extends MTEHatch implements IAddGreg * * @return */ - public abstract AutoMap<ItemStack> getItemsValidForUsageSlots(); + public abstract ArrayList<ItemStack> getItemsValidForUsageSlots(); /** * Checks if the given item is valid for Usage Slots. Can be overridden for easier handling if you already have diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index 57d01bcc5f..f19263bb57 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -2,6 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.blocks.textures; import static gregtech.api.enums.Mods.GTPlusPlus; +import java.util.ArrayList; + import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; @@ -11,13 +13,12 @@ import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.objects.GTRenderedTexture; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.GTPPCore; public class TexturesGtBlock { private static final boolean mAnimated = GTPPCore.ConfigSwitches.enableAnimatedTextures; - private static final AutoMap<Runnable> mCustomiconMap = new AutoMap<>(); + private static final ArrayList<Runnable> mCustomiconMap = new ArrayList<>(); /* * Handles Custom Textures. @@ -36,7 +37,7 @@ public class TexturesGtBlock { public CustomIcon(final String aModID, final String aIconName) { this.mIconName = aIconName; this.mModID = aModID; - mCustomiconMap.put(this); + mCustomiconMap.add(this); Logger.WARNING("Constructing a Custom Texture. " + this.mIconName); GregTechAPI.sGTBlockIconload.add(this); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/CapeRenderer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/CapeRenderer.java index f9ec4b9433..bf7de52ff2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/render/CapeRenderer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/render/CapeRenderer.java @@ -5,6 +5,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.URL; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.concurrent.ForkJoinPool; @@ -23,7 +24,6 @@ import org.lwjgl.opengl.GL11; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.lib.GTPPCore; import gtPlusPlus.core.lib.GTPPCore.ConfigSwitches; @@ -252,11 +252,11 @@ public class CapeRenderer extends RenderPlayer { private static boolean mapsPopulated = false; // UUID - Username - private static final AutoMap<Pair<String, String>> mOrangeCapes = new AutoMap<>(); - private static final AutoMap<Pair<String, String>> mMiscCapes = new AutoMap<>(); - private static final AutoMap<Pair<String, String>> mBetaTestCapes = new AutoMap<>(); - private static final AutoMap<Pair<String, String>> mPatreonCapes = new AutoMap<>(); - private static final AutoMap<Pair<String, String>> mDevCapes = new AutoMap<>(); + private static final ArrayList<Pair<String, String>> mOrangeCapes = new ArrayList<>(); + private static final ArrayList<Pair<String, String>> mMiscCapes = new ArrayList<>(); + private static final ArrayList<Pair<String, String>> mBetaTestCapes = new ArrayList<>(); + private static final ArrayList<Pair<String, String>> mPatreonCapes = new ArrayList<>(); + private static final ArrayList<Pair<String, String>> mDevCapes = new ArrayList<>(); private static boolean init() { CapeUtils.handleOldCapeCache(); @@ -353,7 +353,7 @@ public class CapeRenderer extends RenderPlayer { if (aCache != null && !aCache.isEmpty()) { return aCache; } - return new AutoMap<>(); + return new ArrayList<>(); } private static File allocateTempFile() { @@ -377,16 +377,16 @@ public class CapeRenderer extends RenderPlayer { if (sAES == null) { sAES = new AES(); } - AutoMap<String> aDecodedData = new AutoMap<>(); + ArrayList<String> aDecodedData = new ArrayList<>(); for (String aToDecode : aCacheData) { - aDecodedData.put(sAES.decode(aToDecode)); + aDecodedData.add(sAES.decode(aToDecode)); } if (!aDecodedData.isEmpty()) { - AutoMap<Pair<String, String>> aCapeType1 = new AutoMap<>(); - AutoMap<Pair<String, String>> aCapeType2 = new AutoMap<>(); - AutoMap<Pair<String, String>> aCapeType3 = new AutoMap<>(); - AutoMap<Pair<String, String>> aCapeType4 = new AutoMap<>(); - AutoMap<Pair<String, String>> aCapeType5 = new AutoMap<>(); + ArrayList<Pair<String, String>> aCapeType1 = new ArrayList<>(); + ArrayList<Pair<String, String>> aCapeType2 = new ArrayList<>(); + ArrayList<Pair<String, String>> aCapeType3 = new ArrayList<>(); + ArrayList<Pair<String, String>> aCapeType4 = new ArrayList<>(); + ArrayList<Pair<String, String>> aCapeType5 = new ArrayList<>(); boolean didProcessStringData = false; Logger.INFO("Decoded String Count: " + aDecodedData.size()); for (String aToSplit : aDecodedData) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java index 3a85e0aae3..67a0c349e9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/MTEAtmosphericReconditioner.java @@ -2,6 +2,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; import static gregtech.api.enums.GTValues.V; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import net.minecraft.entity.player.EntityPlayer; @@ -35,7 +37,6 @@ import gregtech.api.util.GTUtility; import gregtech.common.items.IDMetaTool01; import gregtech.common.items.MetaGeneratedTool01; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.item.general.ItemAirFilter; import gtPlusPlus.core.item.general.ItemBasicScrubberTurbine; import gtPlusPlus.core.recipe.common.CI; @@ -360,7 +361,7 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine { if (this.mTier < 7) { mCurrentChunkPollution = PollutionUtils.getPollution(getBaseMetaTileEntity()); } else { - AutoMap<Chunk> aSurrounding = new AutoMap<>(); + ArrayList<Chunk> aSurrounding = new ArrayList<>(); World aWorld = this.getBaseMetaTileEntity() .getWorld(); int xPos = this.getBaseMetaTileEntity() @@ -376,15 +377,15 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine { Chunk c1 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos - 32); Chunk c2 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos); Chunk c3 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos + 32); - aSurrounding.put(a1); - aSurrounding.put(a2); - aSurrounding.put(a3); - aSurrounding.put(b1); - aSurrounding.put(b2); - aSurrounding.put(b3); - aSurrounding.put(c1); - aSurrounding.put(c2); - aSurrounding.put(c3); + aSurrounding.add(a1); + aSurrounding.add(a2); + aSurrounding.add(a3); + aSurrounding.add(b1); + aSurrounding.add(b2); + aSurrounding.add(b3); + aSurrounding.add(c1); + aSurrounding.add(c2); + aSurrounding.add(c3); for (Chunk r : aSurrounding) { mCurrentChunkPollution += getPollutionInChunk(r); } @@ -587,7 +588,7 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine { } else { int chunksWithRemoval = 0; int totalRemoved = 0; - AutoMap<Chunk> aSurrounding = new AutoMap<>(); + ArrayList<Chunk> aSurrounding = new ArrayList<>(); Chunk aThisChunk = this.getBaseMetaTileEntity() .getWorld() .getChunkFromBlockCoords( @@ -615,15 +616,15 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine { Chunk c2 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos); Chunk c3 = aWorld.getChunkFromBlockCoords(xPos + 32, zPos + 32); - aSurrounding.put(a1); - aSurrounding.put(a2); - aSurrounding.put(a3); - aSurrounding.put(b1); - aSurrounding.put(b2); - aSurrounding.put(b3); - aSurrounding.put(c1); - aSurrounding.put(c2); - aSurrounding.put(c3); + aSurrounding.add(a1); + aSurrounding.add(a2); + aSurrounding.add(a3); + aSurrounding.add(b1); + aSurrounding.add(b2); + aSurrounding.add(b3); + aSurrounding.add(c1); + aSurrounding.add(c2); + aSurrounding.add(c3); for (Chunk r : aSurrounding) { if (!r.isChunkLoaded) { @@ -763,10 +764,8 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine { @Override public String[] getInfoData() { - AutoMap<String> aTooltipSuper = new AutoMap<>(); - for (String s : super.getInfoData()) { - aTooltipSuper.put(s); - } + ArrayList<String> aTooltipSuper = new ArrayList<>(); + aTooltipSuper.addAll(Arrays.asList(super.getInfoData())); int mAirSides = getFreeSpaces(); int reduction = 0; @@ -778,11 +777,11 @@ public class MTEAtmosphericReconditioner extends MTEBasicMachine { * Math.max((tTier - 2), 1); reduction = MathUtils.safeInt(((long) reduction / 100) * this.mOptimalAirFlow); - aTooltipSuper.put("Maximum pollution removed per second: " + reduction); + aTooltipSuper.add("Maximum pollution removed per second: " + reduction); } catch (Throwable t) { - aTooltipSuper.put("Maximum pollution removed per second: " + mPollutionReduction); + aTooltipSuper.add("Maximum pollution removed per second: " + mPollutionReduction); } - aTooltipSuper.put("Air Sides: " + mAirSides); + aTooltipSuper.add("Air Sides: " + mAirSides); String[] mBuiltOutput = new String[aTooltipSuper.size()]; int aIndex = 0; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java index 98e1ce15ba..23e587ef2f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/MTEIsaMill.java @@ -48,7 +48,6 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; @@ -225,7 +224,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase<MTEIsaMill> implements ISurvi super.onPostTick(aBaseMetaTileEntity, aTick); } - private final AutoMap<BlockPos> mFrontBlockPosCache = new AutoMap<>(); + private final ArrayList<BlockPos> mFrontBlockPosCache = new ArrayList<>(); public void checkForEntities(IGregTechTileEntity aBaseMetaTileEntity, long aTime) { @@ -252,7 +251,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase<MTEIsaMill> implements ISurvi } } - AutoMap<EntityLivingBase> aEntities = getEntities(mFrontBlockPosCache, aBaseMetaTileEntity.getWorld()); + ArrayList<EntityLivingBase> aEntities = getEntities(mFrontBlockPosCache, aBaseMetaTileEntity.getWorld()); if (!aEntities.isEmpty()) { for (EntityLivingBase aFoundEntity : aEntities) { if (aFoundEntity instanceof EntityPlayer aPlayer) { @@ -286,8 +285,8 @@ public class MTEIsaMill extends GTPPMultiBlockBase<MTEIsaMill> implements ISurvi return Math.max(reducedDamage, 0); } - private static AutoMap<EntityLivingBase> getEntities(AutoMap<BlockPos> aPositionsToCheck, World aWorld) { - AutoMap<EntityLivingBase> aEntities = new AutoMap<>(); + private static ArrayList<EntityLivingBase> getEntities(ArrayList<BlockPos> aPositionsToCheck, World aWorld) { + ArrayList<EntityLivingBase> aEntities = new ArrayList<>(); HashSet<Chunk> aChunksToCheck = new HashSet<>(); if (!aPositionsToCheck.isEmpty()) { Chunk aLocalChunk; @@ -297,7 +296,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase<MTEIsaMill> implements ISurvi } } if (!aChunksToCheck.isEmpty()) { - AutoMap<EntityLivingBase> aEntitiesFound = new AutoMap<>(); + ArrayList<EntityLivingBase> aEntitiesFound = new ArrayList<>(); for (Chunk aChunk : aChunksToCheck) { if (aChunk.isChunkLoaded) { List[] aEntityLists = aChunk.entityLists; @@ -327,7 +326,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase<MTEIsaMill> implements ISurvi private static void generateParticles(EntityLivingBase aEntity) { BlockPos aPlayerPosBottom = EntityUtils.findBlockPosOfEntity(aEntity); BlockPos aPlayerPosTop = aPlayerPosBottom.getUp(); - AutoMap<BlockPos> aEntityPositions = new AutoMap<>(); + ArrayList<BlockPos> aEntityPositions = new ArrayList<>(); aEntityPositions.add(aPlayerPosBottom); aEntityPositions.add(aPlayerPosTop); for (int i = 0; i < 64; i++) { @@ -438,7 +437,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase<MTEIsaMill> implements ISurvi public ArrayList<ItemStack> getStoredInputs() { ArrayList<ItemStack> tItems = super.getStoredInputs(); for (MTEHatchMillingBalls tHatch : validMTEList(mMillingBallBuses)) { - AutoMap<ItemStack> aHatchContent = tHatch.getContentUsageSlots(); + ArrayList<ItemStack> aHatchContent = tHatch.getContentUsageSlots(); if (!aHatchContent.isEmpty()) { tItems.addAll(aHatchContent); } @@ -456,7 +455,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase<MTEIsaMill> implements ISurvi } else { MTEHatchMillingBalls aBus = mMillingBallBuses.get(0); if (aBus != null) { - AutoMap<ItemStack> aAvailableItems = aBus.getContentUsageSlots(); + ArrayList<ItemStack> aAvailableItems = aBus.getContentUsageSlots(); if (!aAvailableItems.isEmpty()) { for (final ItemStack aInput : aItemInputs) { if (ItemUtils.isMillingBall(aInput)) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java index 3a7370cf25..9751218aae 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/MTEIndustrialFishingPond.java @@ -12,6 +12,7 @@ import static gregtech.api.enums.HatchElement.OutputBus; import static gregtech.api.util.GTStructureUtility.buildHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -45,7 +46,6 @@ import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.api.util.OverclockCalculator; import gregtech.api.util.ParallelHelper; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.GTPPCore; @@ -364,10 +364,10 @@ public class MTEIndustrialFishingPond extends GTPPMultiBlockBase<MTEIndustrialFi || (cofhWater != null && cofhWater.isAssignableFrom(block.getClass()) && meta != 0); } - private static AutoMap<AutoMap<WeightedRandomFishable>> categories = new AutoMap<>(); - private static AutoMap<WeightedRandomFishable> categoryFish = new AutoMap<>(); - private static AutoMap<WeightedRandomFishable> categoryJunk = new AutoMap<>(); - private static AutoMap<WeightedRandomFishable> categoryLoot = new AutoMap<>(); + private static ArrayList<ArrayList<WeightedRandomFishable>> categories = new ArrayList<>(); + private static ArrayList<WeightedRandomFishable> categoryFish = new ArrayList<>(); + private static ArrayList<WeightedRandomFishable> categoryJunk = new ArrayList<>(); + private static ArrayList<WeightedRandomFishable> categoryLoot = new ArrayList<>(); private static boolean hasGenerateRecipes = false; private int mMode = 14; private int mMax = 8; @@ -375,18 +375,12 @@ public class MTEIndustrialFishingPond extends GTPPMultiBlockBase<MTEIndustrialFi private void generateRecipes() { if (hasGenerateRecipes) return; - categories.put(categoryFish); - categories.put(categoryJunk); - categories.put(categoryLoot); - for (WeightedRandomFishable h : FishPondFakeRecipe.fish) { - categoryFish.put(h); - } - for (WeightedRandomFishable h : FishPondFakeRecipe.junk) { - categoryJunk.put(h); - } - for (WeightedRandomFishable h : FishPondFakeRecipe.treasure) { - categoryLoot.put(h); - } + categories.add(categoryFish); + categories.add(categoryJunk); + categories.add(categoryLoot); + categoryFish.addAll(FishPondFakeRecipe.fish); + categoryJunk.addAll(FishPondFakeRecipe.junk); + categoryLoot.addAll(FishPondFakeRecipe.treasure); hasGenerateRecipes = true; } @@ -449,7 +443,7 @@ public class MTEIndustrialFishingPond extends GTPPMultiBlockBase<MTEIndustrialFi ItemStack[] mFishOutput = new ItemStack[this.mMax]; if (this.mMode == 14) { for (int k = 0; k < this.mMax; k++) { - if (mFishOutput[k] == null) for (WeightedRandomFishable g : categoryFish.values()) { + if (mFishOutput[k] == null) for (WeightedRandomFishable g : categoryFish) { if (MathUtils.randInt(0, (65 - getMaxParallelRecipes())) <= 2) { ItemStack t = reflectiveFish(g); if (t != null) { @@ -460,7 +454,7 @@ public class MTEIndustrialFishingPond extends GTPPMultiBlockBase<MTEIndustrialFi } } else if (this.mMode == 15) { for (int k = 0; k < this.mMax; k++) { - if (mFishOutput[k] == null) for (WeightedRandomFishable g : categoryJunk.values()) { + if (mFishOutput[k] == null) for (WeightedRandomFishable g : categoryJunk) { if (MathUtils.randInt(0, 100) <= 1) { ItemStack t = reflectiveFish(g); if (t != null) { @@ -471,7 +465,7 @@ public class MTEIndustrialFishingPond extends GTPPMultiBlockBase<MTEIndustrialFi } } else if (this.mMode == 16) { for (int k = 0; k < this.mMax; k++) { - if (mFishOutput[k] == null) for (WeightedRandomFishable g : categoryLoot.values()) { + if (mFishOutput[k] == null) for (WeightedRandomFishable g : categoryLoot) { if (MathUtils.randInt(0, 1000) <= 2) { ItemStack t = reflectiveFish(g); if (t != null) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java index 98a14726eb..a6794809ef 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/MTEChemicalPlant.java @@ -62,7 +62,6 @@ import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; import gregtech.api.util.MultiblockTooltipBuilder; import gregtech.common.tileentities.machines.IDualInputHatch; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Triplet; import gtPlusPlus.api.recipe.GTPPRecipeMaps; import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; @@ -660,7 +659,7 @@ public class MTEChemicalPlant extends GTPPMultiBlockBase<MTEChemicalPlant> imple public ArrayList<ItemStack> getCatalystInputs() { ArrayList<ItemStack> tItems = new ArrayList<>(); for (MTEHatchCatalysts tHatch : validMTEList(mCatalystBuses)) { - AutoMap<ItemStack> aHatchContent = tHatch.getContentUsageSlots(); + ArrayList<ItemStack> aHatchContent = tHatch.getContentUsageSlots(); if (!aHatchContent.isEmpty()) { tItems.addAll(aHatchContent); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java index 62d73b310f..2de926e31f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/MTELargerTurbineBase.java @@ -49,7 +49,6 @@ import gregtech.api.util.TurbineStatCalculator; import gregtech.api.util.shutdown.ShutDownReason; import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.GTPPCore; @@ -334,8 +333,8 @@ public abstract class MTELargerTurbineBase extends GTPPMultiBlockBase<MTELargerT log("Found " + aTurbineAssemblies.size() + ", expected 12."); return false; } - AutoMap<Materials> aTurbineMats = new AutoMap<>(); - AutoMap<Integer> aTurbineSizes = new AutoMap<>(); + ArrayList<Materials> aTurbineMats = new ArrayList<>(); + ArrayList<Integer> aTurbineSizes = new ArrayList<>(); for (MTEHatchTurbine aHatch : aTurbineAssemblies) { aTurbineMats.add(MetaGeneratedTool.getPrimaryMaterial(aHatch.getTurbine())); aTurbineSizes.add(getTurbineSize(aHatch.getTurbine())); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenAlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenAlloySmelter.java index 8ef73917b7..dfe8db8dc8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenAlloySmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenAlloySmelter.java @@ -17,7 +17,7 @@ public class RecipeGenAlloySmelter extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenAlloySmelter(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenAssembler.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenAssembler.java index 64ce9d1c42..3963390dbc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenAssembler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenAssembler.java @@ -21,7 +21,7 @@ public class RecipeGenAssembler extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenAssembler(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelter.java index a0104cd809..c64c846541 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenBlastSmelter.java @@ -36,7 +36,7 @@ public class RecipeGenBlastSmelter extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenBlastSmelter(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenDustGeneration.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenDustGeneration.java index 62fd4d39b1..4b7d94f1f4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenDustGeneration.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenDustGeneration.java @@ -36,7 +36,7 @@ public class RecipeGenDustGeneration extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenDustGeneration(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenExtruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenExtruder.java index 80b9a75a14..a3bf9e6c06 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenExtruder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenExtruder.java @@ -21,7 +21,7 @@ public class RecipeGenExtruder extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenExtruder(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluids.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluids.java index aa2f85f037..aae19c22bd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluids.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluids.java @@ -20,7 +20,7 @@ public class RecipeGenFluids extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenFluids(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluorite.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluorite.java index 0916febadc..9ed9d2d8a6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluorite.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenFluorite.java @@ -33,7 +33,7 @@ public class RecipeGenFluorite extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenFluorite(final Material material) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMaterialProcessing.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMaterialProcessing.java index 8ca1e6f447..352217ff95 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMaterialProcessing.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMaterialProcessing.java @@ -16,7 +16,6 @@ import net.minecraft.item.ItemStack; import gregtech.api.enums.GTValues; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; @@ -30,7 +29,7 @@ public class RecipeGenMaterialProcessing extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenMaterialProcessing(final Material M) { @@ -63,11 +62,11 @@ public class RecipeGenMaterialProcessing extends RecipeGenBase { partSizes[hu] = (int) material.vSmallestRatio[hu]; } } - AutoMap<Pair<Integer, Material>> componentMap = new AutoMap<>(); + ArrayList<Pair<Integer, Material>> componentMap = new ArrayList<>(); int alnsnfds = 0; for (MaterialStack r : material.getComposites()) { if (r != null) { - componentMap.put(new Pair<>(partSizes[alnsnfds], r.getStackMaterial())); + componentMap.add(new Pair<>(partSizes[alnsnfds], r.getStackMaterial())); } alnsnfds++; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMetalRecipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMetalRecipe.java index 975d903e87..634784952a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMetalRecipe.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMetalRecipe.java @@ -22,7 +22,7 @@ public class RecipeGenMetalRecipe extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenMetalRecipe(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMultisUsingFluidInsteadOfCells.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMultisUsingFluidInsteadOfCells.java index 20d4fcdb36..196cf30e86 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMultisUsingFluidInsteadOfCells.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenMultisUsingFluidInsteadOfCells.java @@ -11,7 +11,6 @@ import gregtech.api.recipe.RecipeMap; import gregtech.api.util.GTRecipe; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.recipe.GTRecipeUtils; @@ -19,7 +18,7 @@ import gtPlusPlus.core.util.recipe.GTRecipeUtils; public class RecipeGenMultisUsingFluidInsteadOfCells { private static ItemStack mEmptyCell; - private static final AutoMap<ItemStack> mItemsToIgnore = new AutoMap<>(); + private static final ArrayList<ItemStack> mItemsToIgnore = new ArrayList<>(); private static boolean mInit = false; private static void init() { @@ -82,10 +81,10 @@ public class RecipeGenMultisUsingFluidInsteadOfCells { FluidStack[] aInputFluids = x.mFluidInputs.clone(); FluidStack[] aOutputFluids = x.mFluidOutputs.clone(); - AutoMap<ItemStack> aInputItemsMap = new AutoMap<>(); - AutoMap<ItemStack> aOutputItemsMap = new AutoMap<>(); - AutoMap<FluidStack> aInputFluidsMap = new AutoMap<>(); - AutoMap<FluidStack> aOutputFluidsMap = new AutoMap<>(); + ArrayList<ItemStack> aInputItemsMap = new ArrayList<>(); + ArrayList<ItemStack> aOutputItemsMap = new ArrayList<>(); + ArrayList<FluidStack> aInputFluidsMap = new ArrayList<>(); + ArrayList<FluidStack> aOutputFluidsMap = new ArrayList<>(); // Iterate Inputs, Convert valid items into fluids for (ItemStack aInputStack : aInputItems) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenOre.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenOre.java index 14d5e86e7b..ed8f446bab 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenOre.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenOre.java @@ -25,7 +25,6 @@ import gregtech.api.enums.Materials; import gregtech.api.util.GTModHandler; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; @@ -41,7 +40,7 @@ public class RecipeGenOre extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenOre(final Material M) { @@ -100,12 +99,12 @@ public class RecipeGenOre extends RecipeGenBase { } } - AutoMap<Material> amJ = new AutoMap<>(); + ArrayList<Material> amJ = new ArrayList<>(); int aIndexCounter = 0; for (Material g : aMatComp) { if (g.hasSolidForm()) { if (getDust(g) != null && getTinyDust(g) != null) { - amJ.put(g); + amJ.add(g); } } } @@ -167,10 +166,10 @@ public class RecipeGenOre extends RecipeGenBase { bonusB = tVoltageMultiplier > 100 ? material : mStone; } - AutoMap<Pair<Integer, Material>> componentMap = new AutoMap<>(); + ArrayList<Pair<Integer, Material>> componentMap = new ArrayList<>(); for (MaterialStack r : material.getComposites()) { if (r != null) { - componentMap.put(new Pair<>(r.getPartsPerOneHundred(), r.getStackMaterial())); + componentMap.add(new Pair<>(r.getPartsPerOneHundred(), r.getStackMaterial())); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenPlasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenPlasma.java index d281c528dc..b2ec9167c2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenPlasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenPlasma.java @@ -24,7 +24,7 @@ public class RecipeGenPlasma extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenPlasma(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenPlates.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenPlates.java index eb48d6d8e7..defc71232b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenPlates.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenPlates.java @@ -26,7 +26,7 @@ public class RecipeGenPlates extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenPlates(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java index 305422ccea..89fdf23ec6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenRecycling.java @@ -22,7 +22,6 @@ import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GTOreDictUnificator; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.state.MaterialState; @@ -31,11 +30,11 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; public class RecipeGenRecycling implements Runnable { - public static AutoMap<Runnable> mQueuedRecyclingGenerators = new AutoMap<>(); + public static ArrayList<Runnable> mQueuedRecyclingGenerators = new ArrayList<>(); public static void executeGenerators() { if (mQueuedRecyclingGenerators.size() > 0) { - for (Runnable R : mQueuedRecyclingGenerators.values()) { + for (Runnable R : mQueuedRecyclingGenerators) { R.run(); } } @@ -49,7 +48,7 @@ public class RecipeGenRecycling implements Runnable { if (mNameMap == null) { mNameMap = this.getNameMap(); } - mQueuedRecyclingGenerators.put(this); + mQueuedRecyclingGenerators.add(this); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenShapedCrafting.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenShapedCrafting.java index 0c07b382ec..97445915f2 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenShapedCrafting.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGenShapedCrafting.java @@ -15,7 +15,7 @@ public class RecipeGenShapedCrafting extends RecipeGenBase { public static final Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<>(); static { - MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + MaterialGenerator.mRecipeMapsToGenerate.add(mRecipeGenMap); } public RecipeGenShapedCrafting(final Material M) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java index bfa8b6d1b1..d5fe301173 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderAlgaeFarm.java @@ -1,5 +1,6 @@ package gtPlusPlus.xmod.gregtech.loaders.recipe; +import java.util.ArrayList; import java.util.HashMap; import net.minecraft.item.ItemStack; @@ -8,7 +9,6 @@ import net.minecraftforge.fluids.FluidStack; import gregtech.api.enums.GTValues; import gregtech.api.util.GTRecipe; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.WeightedCollection; import gtPlusPlus.core.item.chemistry.AgriculturalChem; import gtPlusPlus.core.util.math.MathUtils; @@ -16,8 +16,8 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; public class RecipeLoaderAlgaeFarm { - private static final HashMap<Integer, AutoMap<GTRecipe>> mRecipeCache = new HashMap<>(); - private static final HashMap<Integer, AutoMap<GTRecipe>> mRecipeCompostCache = new HashMap<>(); + private static final HashMap<Integer, ArrayList<GTRecipe>> mRecipeCache = new HashMap<>(); + private static final HashMap<Integer, ArrayList<GTRecipe>> mRecipeCompostCache = new HashMap<>(); public static void generateRecipes() { for (int i = 0; i < 15; i++) { @@ -29,12 +29,12 @@ public class RecipeLoaderAlgaeFarm { } public static GTRecipe getTieredRecipeFromCache(int aTier, boolean aCompost) { - HashMap<Integer, AutoMap<GTRecipe>> aMap = aCompost ? mRecipeCompostCache : mRecipeCache; + HashMap<Integer, ArrayList<GTRecipe>> aMap = aCompost ? mRecipeCompostCache : mRecipeCache; String aComp = aCompost ? "(Compost)" : ""; - AutoMap<GTRecipe> aTemp = aMap.get(aTier); + ArrayList<GTRecipe> aTemp = aMap.get(aTier); if (aTemp == null || aTemp.isEmpty()) { - aTemp = new AutoMap<>(); + aTemp = new ArrayList<>(); aMap.put(aTier, aTemp); Logger.INFO("Tier " + aTier + aComp + " had no recipes, initialising new map."); } @@ -42,7 +42,7 @@ public class RecipeLoaderAlgaeFarm { Logger .INFO("Tier " + aTier + aComp + " has less than 500 recipes, generating " + (500 - aTemp.size()) + "."); for (int i = aTemp.size(); i < 500; i++) { - aTemp.put(generateBaseRecipe(aCompost, aTier)); + aTemp.add(generateBaseRecipe(aCompost, aTier)); } } int aIndex = MathUtils.randInt(0, aTemp.isEmpty() ? 1 : aTemp.size()); @@ -109,61 +109,59 @@ public class RecipeLoaderAlgaeFarm { } private static ItemStack[] getOutputsForTier(int aTier) { - - // Create an Automap to dump contents into - AutoMap<ItemStack> aOutputMap = new AutoMap<>(); + ArrayList<ItemStack> aOutputMap = new ArrayList<>(); // Add loot relevant to tier and also add any from lower tiers. if (aTier >= 0) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 2)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 2)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 4)); if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2)); } } if (aTier >= 1) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 4)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mAlgaeBiosmass, 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2)); if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4)); } } if (aTier >= 2) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 3)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 2)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 3)); if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 8)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 8)); } } if (aTier >= 3) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 1)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 1)); if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 4)); } } if (aTier >= 4) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 2)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 3)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 2)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 3)); if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 4)); } } if (aTier >= 5) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 4)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 2)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 2)); if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 4)); } } // Tier 6 is Highest for outputs if (aTier >= 6) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 4)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 2)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 2)); if (MathUtils.randInt(0, 10) > 9) { - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 8)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, 8)); } } @@ -171,10 +169,10 @@ public class RecipeLoaderAlgaeFarm { for (int i2 = 0; i2 < 20; i2++) { if (aTier >= (6 + i2)) { int aMulti = i2 + 1; - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, aMulti * 4)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, aMulti * 3)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, aMulti * 2)); - aOutputMap.put(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, aMulti)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGreenAlgaeBiosmass, aMulti * 4)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mBrownAlgaeBiosmass, aMulti * 3)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mGoldenBrownAlgaeBiosmass, aMulti * 2)); + aOutputMap.add(ItemUtils.getSimpleStack(AgriculturalChem.mRedAlgaeBiosmass, aMulti)); } else { i2 = 20; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderLFTR.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderLFTR.java index b5a3a55cd0..4c87da567b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderLFTR.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoaderLFTR.java @@ -5,26 +5,27 @@ import static gregtech.api.util.GTRecipeBuilder.SECONDS; import static gregtech.api.util.GTRecipeConstants.LFTR_OUTPUT_POWER; import static gtPlusPlus.api.recipe.GTPPRecipeMaps.liquidFluorineThoriumReactorRecipes; +import java.util.ArrayList; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import gregtech.api.enums.GTValues; import gregtech.api.enums.Materials; import gregtech.api.util.GasSpargingRecipeMap; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.material.MaterialsElements; import gtPlusPlus.core.material.nuclear.MaterialsFluorides; import gtPlusPlus.core.material.nuclear.MaterialsNuclides; public class RecipeLoaderLFTR { - private static AutoMap<Fluid> mNobleGases; - private static AutoMap<Fluid> mFluorideGases; - private static AutoMap<Fluid> mSpargeGases; + private static ArrayList<Fluid> mNobleGases; + private static ArrayList<Fluid> mFluorideGases; + private static ArrayList<Fluid> mSpargeGases; private static void configureSparging() { if (mSpargeGases == null) { - mSpargeGases = new AutoMap<>(); + mSpargeGases = new ArrayList<>(); mSpargeGases.add( Materials.Helium.getGas(1) .getFluid()); @@ -33,7 +34,7 @@ public class RecipeLoaderLFTR { .getFluid()); } if (mNobleGases == null) { - mNobleGases = new AutoMap<>(); + mNobleGases = new ArrayList<>(); mNobleGases.add(mSpargeGases.get(0)); mNobleGases.add(MaterialsElements.getInstance().XENON.getFluid()); mNobleGases.add(MaterialsElements.getInstance().NEON.getFluid()); @@ -42,7 +43,7 @@ public class RecipeLoaderLFTR { mNobleGases.add(MaterialsElements.getInstance().RADON.getFluid()); } if (mFluorideGases == null) { - mFluorideGases = new AutoMap<>(); + mFluorideGases = new ArrayList<>(); mFluorideGases.add(mSpargeGases.get(1)); mFluorideGases.add(MaterialsFluorides.LITHIUM_FLUORIDE.getFluid()); mFluorideGases.add(MaterialsFluorides.NEPTUNIUM_HEXAFLUORIDE.getFluid()); diff --git a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java index 1f053220ab..2d6a4ab3dd 100644 --- a/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java +++ b/src/main/java/gtPlusPlus/xmod/thaumcraft/objects/ThreadAspectScanner.java @@ -13,7 +13,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.data.FileUtils; @@ -23,7 +22,7 @@ import gtPlusPlus.xmod.thaumcraft.commands.CommandDumpAspects; public class ThreadAspectScanner extends Thread { public static boolean mDoWeScan = false; - private static final Map<String, AutoMap<ItemStack>> mAllGameContent = new HashMap<>(); + private static final Map<String, ArrayList<ItemStack>> mAllGameContent = new HashMap<>(); public final File mAspectCacheFile; public ThreadAspectScanner() { @@ -52,11 +51,11 @@ public class ThreadAspectScanner extends Thread { } } } - AutoMap<ItemStack> m = new AutoMap<>(); + ArrayList<ItemStack> m = new ArrayList<>(); if (mAllGameContent.containsKey(nameKey)) { m = mAllGameContent.get(nameKey); } - m.put(aStack); + m.add(aStack); mAllGameContent.put(nameKey, m); } @@ -118,7 +117,7 @@ public class ThreadAspectScanner extends Thread { for (String key : y) { // Logger.INFO("Looking for key: "+key); if (mAllGameContent.containsKey(key)) { - AutoMap<ItemStack> group = mAllGameContent.get(key); + ArrayList<ItemStack> group = mAllGameContent.get(key); if (group == null || group.size() <= 0) { continue; } @@ -128,10 +127,10 @@ public class ThreadAspectScanner extends Thread { if (a == null) { continue; } else { - AutoMap<Pair<String, Integer>> aspectPairs = new AutoMap<>(); + ArrayList<Pair<String, Integer>> aspectPairs = new ArrayList<>(); for (thaumcraft.api.aspects.Aspect c : a.getAspectsSortedAmount()) { if (c != null) { - aspectPairs.put(new Pair<>(c.getName(), a.getAmount(c))); + aspectPairs.add(new Pair<>(c.getName(), a.getAmount(c))); } } try { diff --git a/src/main/java/gtPlusPlus/xmod/tinkers/HandlerTinkers.java b/src/main/java/gtPlusPlus/xmod/tinkers/HandlerTinkers.java index faa94542b9..338fe86b2d 100644 --- a/src/main/java/gtPlusPlus/xmod/tinkers/HandlerTinkers.java +++ b/src/main/java/gtPlusPlus/xmod/tinkers/HandlerTinkers.java @@ -1,17 +1,18 @@ package gtPlusPlus.xmod.tinkers; +import java.util.ArrayList; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import gregtech.api.enums.Mods; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.xmod.tinkers.material.BaseTinkersMaterial; import gtPlusPlus.xmod.tinkers.util.TinkersDryingRecipe; import gtPlusPlus.xmod.tinkers.util.TinkersUtils; public class HandlerTinkers { - public static AutoMap<BaseTinkersMaterial> mTinkerMaterials = new AutoMap<>(); + public static ArrayList<BaseTinkersMaterial> mTinkerMaterials = new ArrayList<>(); public static void postInit() { if (Mods.TinkerConstruct.isModLoaded()) { diff --git a/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java b/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java index 68685b7b8b..103a44e665 100644 --- a/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java +++ b/src/main/java/gtPlusPlus/xmod/tinkers/material/BaseTinkersMaterial.java @@ -40,7 +40,7 @@ public class BaseTinkersMaterial { mID = aNextFreeID++; Logger.INFO("[TiCon] Assigning ID " + mID + " to " + mLocalName + "."); aInternalMaterialIdMap.put(mUnlocalName, mID); - HandlerTinkers.mTinkerMaterials.put(this); + HandlerTinkers.mTinkerMaterials.add(this); } public String getUnlocalName() { diff --git a/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java b/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java index 4136b54309..7c48f1bd74 100644 --- a/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java +++ b/src/main/java/gtPlusPlus/xmod/tinkers/util/TinkersDryingRecipe.java @@ -2,6 +2,7 @@ package gtPlusPlus.xmod.tinkers.util; import static gtPlusPlus.api.recipe.GTPPRecipeMaps.chemicalDehydratorRecipes; +import java.util.ArrayList; import java.util.List; import net.minecraft.item.ItemStack; @@ -11,12 +12,11 @@ import gregtech.api.enums.GTValues; import gregtech.api.enums.TierEU; import gregtech.api.util.GTUtility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import tconstruct.library.crafting.DryingRackRecipes; public class TinkersDryingRecipe { - public static AutoMap<TinkersDryingRecipe> recipes = new AutoMap<>(); + public static ArrayList<TinkersDryingRecipe> recipes = new ArrayList<>(); public final int time; public final ItemStack input; @@ -60,10 +60,10 @@ public class TinkersDryingRecipe { } private static List<DryingRackRecipes.DryingRecipe> getDryingRecipes() { - AutoMap<DryingRackRecipes.DryingRecipe> aData = new AutoMap<>(); + ArrayList<DryingRackRecipes.DryingRecipe> aData = new ArrayList<>(); int aCount = 0; for (DryingRackRecipes.DryingRecipe recipe : DryingRackRecipes.recipes) { - aData.put(recipe); + aData.add(recipe); aCount++; } Logger.INFO("Found " + aCount + " Tinkers drying rack recipes."); diff --git a/src/main/java/gtnhlanth/common/hatch/MTEBusInputFocus.java b/src/main/java/gtnhlanth/common/hatch/MTEBusInputFocus.java index 1d8840295b..3334166992 100644 --- a/src/main/java/gtnhlanth/common/hatch/MTEBusInputFocus.java +++ b/src/main/java/gtnhlanth/common/hatch/MTEBusInputFocus.java @@ -1,5 +1,7 @@ package gtnhlanth.common.hatch; +import java.util.ArrayList; + import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; @@ -7,7 +9,6 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.objects.GTRenderedTexture; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.nbthandlers.MTEHatchNbtConsumable; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtnhlanth.common.item.ICanFocus; @@ -36,15 +37,15 @@ public class MTEBusInputFocus extends MTEHatchNbtConsumable { } @Override - public AutoMap<ItemStack> getItemsValidForUsageSlots() { - return new AutoMap<>(); + public ArrayList<ItemStack> getItemsValidForUsageSlots() { + return new ArrayList<>(); } @Override public boolean isItemValidForUsageSlot(ItemStack aStack) { if (this.getContentUsageSlots() - .size() == 0) { + .isEmpty()) { return aStack.getItem() instanceof ICanFocus; } else { return false; @@ -60,7 +61,7 @@ public class MTEBusInputFocus extends MTEHatchNbtConsumable { public void depleteFocusDurability(int damage) { ItemStack stack = this.getContentUsageSlots() - .toArray()[0]; + .get(0); Util.depleteDurabilityOfStack(stack, damage); |