diff --git a/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandler3D.java b/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandler3D.java index ed64bfc90..53e03b203 100644 --- a/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandler3D.java +++ b/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandler3D.java @@ -1,6 +1,7 @@ package com.hbm.handler.radiation; import java.util.HashMap; +import java.util.Map; import java.util.Map.Entry; import com.hbm.interfaces.Untested; @@ -18,8 +19,8 @@ import net.minecraftforge.event.world.WorldEvent; * @author hbm */ public class ChunkRadiationHandler3D extends ChunkRadiationHandler { - - private HashMap perWorld = new HashMap(); + + private Map perWorld = new HashMap<>(); @Override @Untested public float getRadiation(World world, int x, int y, int z) { @@ -72,9 +73,9 @@ public class ChunkRadiationHandler3D extends ChunkRadiationHandler { public void updateSystem() { for(Entry entry : perWorld.entrySet()) { - - HashMap radiation = entry.getValue().radiation; - HashMap buff = new HashMap(radiation); + + Map radiation = entry.getValue().radiation; + Map buff = new HashMap<>(radiation); radiation.clear(); for(Entry chunk : buff.entrySet()) { @@ -182,7 +183,6 @@ public class ChunkRadiationHandler3D extends ChunkRadiationHandler { } public static class ThreeDimRadiationPerWorld { - - public HashMap radiation = new HashMap(); + public Map radiation = new HashMap<>(); } } diff --git a/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerNT.java b/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerNT.java index 50144d6aa..1bda5f318 100644 --- a/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerNT.java +++ b/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerNT.java @@ -35,8 +35,8 @@ import net.minecraftforge.event.world.WorldEvent; public class ChunkRadiationHandlerNT extends ChunkRadiationHandler { /* once i have to start debugging this, even my nightmares will start shitting themselves */ - - private static HashMap worldMap = new HashMap(); + + private static Map worldMap = new HashMap<>(); @Override public void clearSystem(World world) { @@ -727,13 +727,13 @@ public class ChunkRadiationHandlerNT extends ChunkRadiationHandler { public static class WorldRadiationData { public World world; - private Set dirtyChunks = new HashSet(); - private Set dirtyChunks2 = new HashSet(); + private Set dirtyChunks = new HashSet<>(); + private Set dirtyChunks2 = new HashSet<>(); private boolean iteratingDirty = false; - - public Set activePockets = new HashSet(); - public HashMap data = new HashMap(); - + + public Set activePockets = new HashSet<>(); + public Map data = new HashMap<>(); + public WorldRadiationData(World world) { this.world = world; } diff --git a/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerPRISM.java b/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerPRISM.java index 861d029db..0b7c75040 100644 --- a/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerPRISM.java +++ b/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerPRISM.java @@ -2,6 +2,7 @@ package com.hbm.handler.radiation; import java.util.HashMap; import java.util.Iterator; +import java.util.Map; import java.util.Map.Entry; import java.util.concurrent.ConcurrentHashMap; @@ -44,8 +45,8 @@ import net.minecraftforge.event.world.WorldEvent; * */ public class ChunkRadiationHandlerPRISM extends ChunkRadiationHandler { - - public ConcurrentHashMap perWorld = new ConcurrentHashMap(); + + public Map perWorld = new ConcurrentHashMap<>(); public static int cycles = 0; public static final float MAX_RADIATION = 1_000_000; @@ -171,8 +172,8 @@ public class ChunkRadiationHandlerPRISM extends ChunkRadiationHandler { } } } - - public static final HashMap newAdditions = new HashMap(); + + public static final Map newAdditions = new HashMap<>(); @Override public void updateSystem() { @@ -260,8 +261,8 @@ public class ChunkRadiationHandlerPRISM extends ChunkRadiationHandler { } /** Returns the amount of radiation spread */ - private static float spreadRadiation(World world, SubChunk source, int y, ChunkCoordIntPair origin, SubChunk[] chunk, ConcurrentHashMap map, ForgeDirection dir) { - + private static float spreadRadiation(World world, SubChunk source, int y, ChunkCoordIntPair origin, SubChunk[] chunk, Map map, ForgeDirection dir) { + float spread = 0.1F; float amount = source.prevRadiation * spread; @@ -305,7 +306,7 @@ public class ChunkRadiationHandlerPRISM extends ChunkRadiationHandler { } public static class RadPerWorld { - public ConcurrentHashMap radiation = new ConcurrentHashMap(); + public Map radiation = new ConcurrentHashMap<>(); } public static class SubChunk { diff --git a/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerSimple.java b/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerSimple.java index d77c6b34b..687294b64 100644 --- a/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerSimple.java +++ b/src/main/java/com/hbm/handler/radiation/ChunkRadiationHandlerSimple.java @@ -1,6 +1,7 @@ package com.hbm.handler.radiation; import java.util.HashMap; +import java.util.Map; import java.util.Map.Entry; import com.hbm.blocks.ModBlocks; @@ -25,7 +26,7 @@ import net.minecraftforge.event.world.WorldEvent; */ public class ChunkRadiationHandlerSimple extends ChunkRadiationHandler { - private HashMap perWorld = new HashMap(); + private Map perWorld = new HashMap<>(); private static final float maxRad = 100_000F; @Override @@ -71,8 +72,8 @@ public class ChunkRadiationHandlerSimple extends ChunkRadiationHandler { for(Entry entry : perWorld.entrySet()) { - HashMap radiation = entry.getValue().radiation; - HashMap buff = new HashMap(radiation); + Map radiation = entry.getValue().radiation; + Map buff = new HashMap<>(radiation); radiation.clear(); World world = entry.getKey(); @@ -183,7 +184,7 @@ public class ChunkRadiationHandlerSimple extends ChunkRadiationHandler { public static class SimpleRadiationPerWorld { - public HashMap radiation = new HashMap(); + public Map radiation = new HashMap<>(); } @Override