diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities')
5 files changed, 52 insertions, 62 deletions
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())); |