Merge pull request #2525 from BallOfEnergy1/master

Tiny changes
This commit is contained in:
HbmMods 2025-11-10 16:07:16 +01:00 committed by GitHub
commit ab48d52265
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 26 deletions

View File

@ -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;
@ -19,7 +20,7 @@ import net.minecraftforge.event.world.WorldEvent;
*/
public class ChunkRadiationHandler3D extends ChunkRadiationHandler {
private HashMap<World, ThreeDimRadiationPerWorld> perWorld = new HashMap();
private Map<World, ThreeDimRadiationPerWorld> perWorld = new HashMap<>();
@Override @Untested
public float getRadiation(World world, int x, int y, int z) {
@ -73,8 +74,8 @@ public class ChunkRadiationHandler3D extends ChunkRadiationHandler {
for(Entry<World, ThreeDimRadiationPerWorld> entry : perWorld.entrySet()) {
HashMap<ChunkCoordIntPair, Float[]> radiation = entry.getValue().radiation;
HashMap<ChunkCoordIntPair, Float[]> buff = new HashMap(radiation);
Map<ChunkCoordIntPair, Float[]> radiation = entry.getValue().radiation;
Map<ChunkCoordIntPair, Float[]> buff = new HashMap<>(radiation);
radiation.clear();
for(Entry<ChunkCoordIntPair, Float[]> chunk : buff.entrySet()) {
@ -182,7 +183,6 @@ public class ChunkRadiationHandler3D extends ChunkRadiationHandler {
}
public static class ThreeDimRadiationPerWorld {
public HashMap<ChunkCoordIntPair, Float[]> radiation = new HashMap();
public Map<ChunkCoordIntPair, Float[]> radiation = new HashMap<>();
}
}

View File

@ -36,7 +36,7 @@ public class ChunkRadiationHandlerNT extends ChunkRadiationHandler {
/* once i have to start debugging this, even my nightmares will start shitting themselves */
private static HashMap<World, WorldRadiationData> worldMap = new HashMap();
private static Map<World, WorldRadiationData> worldMap = new HashMap<>();
@Override
public void clearSystem(World world) {
@ -727,12 +727,12 @@ public class ChunkRadiationHandlerNT extends ChunkRadiationHandler {
public static class WorldRadiationData {
public World world;
private Set<BlockPos> dirtyChunks = new HashSet();
private Set<BlockPos> dirtyChunks2 = new HashSet();
private Set<BlockPos> dirtyChunks = new HashSet<>();
private Set<BlockPos> dirtyChunks2 = new HashSet<>();
private boolean iteratingDirty = false;
public Set<RadPocket> activePockets = new HashSet();
public HashMap<ChunkCoordIntPair, ChunkRadiationStorage> data = new HashMap();
public Set<RadPocket> activePockets = new HashSet<>();
public Map<ChunkCoordIntPair, ChunkRadiationStorage> data = new HashMap<>();
public WorldRadiationData(World world) {
this.world = world;

View File

@ -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;
@ -45,7 +46,7 @@ import net.minecraftforge.event.world.WorldEvent;
*/
public class ChunkRadiationHandlerPRISM extends ChunkRadiationHandler {
public ConcurrentHashMap<World, RadPerWorld> perWorld = new ConcurrentHashMap();
public Map<World, RadPerWorld> perWorld = new ConcurrentHashMap<>();
public static int cycles = 0;
public static final float MAX_RADIATION = 1_000_000;
@ -172,7 +173,7 @@ public class ChunkRadiationHandlerPRISM extends ChunkRadiationHandler {
}
}
public static final HashMap<ChunkCoordIntPair, SubChunk[]> newAdditions = new HashMap();
public static final Map<ChunkCoordIntPair, SubChunk[]> newAdditions = new HashMap<>();
@Override
public void updateSystem() {
@ -260,7 +261,7 @@ 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<ChunkCoordIntPair, SubChunk[]> map, ForgeDirection dir) {
private static float spreadRadiation(World world, SubChunk source, int y, ChunkCoordIntPair origin, SubChunk[] chunk, Map<ChunkCoordIntPair, SubChunk[]> 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<ChunkCoordIntPair, SubChunk[]> radiation = new ConcurrentHashMap();
public Map<ChunkCoordIntPair, SubChunk[]> radiation = new ConcurrentHashMap<>();
}
public static class SubChunk {

View File

@ -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<World, SimpleRadiationPerWorld> perWorld = new HashMap();
private Map<World, SimpleRadiationPerWorld> perWorld = new HashMap<>();
private static final float maxRad = 100_000F;
@Override
@ -71,8 +72,8 @@ public class ChunkRadiationHandlerSimple extends ChunkRadiationHandler {
for(Entry<World, SimpleRadiationPerWorld> entry : perWorld.entrySet()) {
HashMap<ChunkCoordIntPair, Float> radiation = entry.getValue().radiation;
HashMap<ChunkCoordIntPair, Float> buff = new HashMap(radiation);
Map<ChunkCoordIntPair, Float> radiation = entry.getValue().radiation;
Map<ChunkCoordIntPair, Float> 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<ChunkCoordIntPair, Float> radiation = new HashMap();
public Map<ChunkCoordIntPair, Float> radiation = new HashMap<>();
}
@Override