diff options
Diffstat (limited to 'src/main/java/gtPlusPlus/api/objects/minecraft')
4 files changed, 31 insertions, 34 deletions
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]); } } |
