From b530fdac89f5d764613a6a69339e4324083c9895 Mon Sep 17 00:00:00 2001 From: NotAPenguin Date: Mon, 16 Sep 2024 00:53:18 +0200 Subject: Remove GT++ AutoMap (#3199) --- .../basic/MTEAtmosphericReconditioner.java | 55 +++++++++++----------- .../machines/multi/processing/MTEIsaMill.java | 17 ++++--- .../multi/production/MTEIndustrialFishingPond.java | 34 ++++++------- .../production/chemplant/MTEChemicalPlant.java | 3 +- .../production/turbines/MTELargerTurbineBase.java | 5 +- 5 files changed, 52 insertions(+), 62 deletions(-) (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities') 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 aSurrounding = new AutoMap<>(); + ArrayList 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 aSurrounding = new AutoMap<>(); + ArrayList 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 aTooltipSuper = new AutoMap<>(); - for (String s : super.getInfoData()) { - aTooltipSuper.put(s); - } + ArrayList 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 implements ISurvi super.onPostTick(aBaseMetaTileEntity, aTick); } - private final AutoMap mFrontBlockPosCache = new AutoMap<>(); + private final ArrayList mFrontBlockPosCache = new ArrayList<>(); public void checkForEntities(IGregTechTileEntity aBaseMetaTileEntity, long aTime) { @@ -252,7 +251,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase implements ISurvi } } - AutoMap aEntities = getEntities(mFrontBlockPosCache, aBaseMetaTileEntity.getWorld()); + ArrayList 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 implements ISurvi return Math.max(reducedDamage, 0); } - private static AutoMap getEntities(AutoMap aPositionsToCheck, World aWorld) { - AutoMap aEntities = new AutoMap<>(); + private static ArrayList getEntities(ArrayList aPositionsToCheck, World aWorld) { + ArrayList aEntities = new ArrayList<>(); HashSet aChunksToCheck = new HashSet<>(); if (!aPositionsToCheck.isEmpty()) { Chunk aLocalChunk; @@ -297,7 +296,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase implements ISurvi } } if (!aChunksToCheck.isEmpty()) { - AutoMap aEntitiesFound = new AutoMap<>(); + ArrayList aEntitiesFound = new ArrayList<>(); for (Chunk aChunk : aChunksToCheck) { if (aChunk.isChunkLoaded) { List[] aEntityLists = aChunk.entityLists; @@ -327,7 +326,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase implements ISurvi private static void generateParticles(EntityLivingBase aEntity) { BlockPos aPlayerPosBottom = EntityUtils.findBlockPosOfEntity(aEntity); BlockPos aPlayerPosTop = aPlayerPosBottom.getUp(); - AutoMap aEntityPositions = new AutoMap<>(); + ArrayList 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 implements ISurvi public ArrayList getStoredInputs() { ArrayList tItems = super.getStoredInputs(); for (MTEHatchMillingBalls tHatch : validMTEList(mMillingBallBuses)) { - AutoMap aHatchContent = tHatch.getContentUsageSlots(); + ArrayList aHatchContent = tHatch.getContentUsageSlots(); if (!aHatchContent.isEmpty()) { tItems.addAll(aHatchContent); } @@ -456,7 +455,7 @@ public class MTEIsaMill extends GTPPMultiBlockBase implements ISurvi } else { MTEHatchMillingBalls aBus = mMillingBallBuses.get(0); if (aBus != null) { - AutoMap aAvailableItems = aBus.getContentUsageSlots(); + ArrayList 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> categories = new AutoMap<>(); - private static AutoMap categoryFish = new AutoMap<>(); - private static AutoMap categoryJunk = new AutoMap<>(); - private static AutoMap categoryLoot = new AutoMap<>(); + private static ArrayList> categories = new ArrayList<>(); + private static ArrayList categoryFish = new ArrayList<>(); + private static ArrayList categoryJunk = new ArrayList<>(); + private static ArrayList 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 imple public ArrayList getCatalystInputs() { ArrayList tItems = new ArrayList<>(); for (MTEHatchCatalysts tHatch : validMTEList(mCatalystBuses)) { - AutoMap aHatchContent = tHatch.getContentUsageSlots(); + ArrayList 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 aTurbineMats = new AutoMap<>(); - AutoMap aTurbineSizes = new AutoMap<>(); + ArrayList aTurbineMats = new ArrayList<>(); + ArrayList aTurbineSizes = new ArrayList<>(); for (MTEHatchTurbine aHatch : aTurbineAssemblies) { aTurbineMats.add(MetaGeneratedTool.getPrimaryMaterial(aHatch.getTurbine())); aTurbineSizes.add(getTurbineSize(aHatch.getTurbine())); -- cgit