diff --git a/src/main/java/net/minecraft/client/multiplayer/WorldClient.java b/src/main/java/net/minecraft/client/multiplayer/WorldClient.java index f82c6ad..5997c28 100644 --- a/src/main/java/net/minecraft/client/multiplayer/WorldClient.java +++ b/src/main/java/net/minecraft/client/multiplayer/WorldClient.java @@ -110,15 +110,15 @@ protected void func_147456_g() { super.func_147456_g(); - this.previousActiveChunkSet.retainAll(this.activeChunkSet.keySet()); + this.previousActiveChunkSet.retainAll(this.activeChunks.keySet()); - if (this.previousActiveChunkSet.size() == this.activeChunkSet.size()) + if (this.previousActiveChunkSet.size() == this.activeChunks.size()) { this.previousActiveChunkSet.clear(); } int i = 0; - for (IntCursor iter = activeChunkSet.keySet().cursor(); iter.moveNext();) + for (IntCursor iter = activeChunks.keySet().cursor(); iter.moveNext();) { int chunkCoord = iter.elem(); diff --git a/src/main/java/net/minecraft/world/World.java b/src/main/java/net/minecraft/world/World.java index c0dc9e0..b7a0639 100644 --- a/src/main/java/net/minecraft/world/World.java +++ b/src/main/java/net/minecraft/world/World.java @@ -28,6 +28,7 @@ import org.ultramine.server.event.ServerWorldEventProxy; import org.ultramine.server.event.WorldEventProxy; import org.ultramine.server.event.WorldUpdateObjectType; +import org.ultramine.server.util.VanillaChunkCoordIntPairSet; import net.minecraft.block.Block; import net.minecraft.block.BlockHopper; @@ -134,7 +135,8 @@ private final Calendar theCalendar = Calendar.getInstance(); protected Scoreboard worldScoreboard = new Scoreboard(); public boolean isRemote; - protected IntByteMap activeChunkSet = HashIntByteMaps.getDefaultFactory().withDefaultValue(Byte.MAX_VALUE).withDefaultExpectedSize(1024).newUpdatableMap(); + protected IntByteMap activeChunks = HashIntByteMaps.getDefaultFactory().withDefaultValue(Byte.MAX_VALUE).withDefaultExpectedSize(1024).newUpdatableMap(); + protected Set activeChunkSet = new VanillaChunkCoordIntPairSet(activeChunks.keySet()); private int ambientTickCountdown; protected boolean spawnHostileMobs; protected boolean spawnPeacefulMobs; @@ -2021,7 +2023,7 @@ TileEntity tileentity = (TileEntity)iterator.next(); int key = ChunkHash.chunkToKey(tileentity.xCoord >> 4, tileentity.zCoord >> 4); - if (!tileentity.isInvalid() && tileentity.hasWorldObj() && activeChunkSet.containsKey(key)) + if (!tileentity.isInvalid() && tileentity.hasWorldObj() && activeChunks.containsKey(key)) { eventProxy.startTileEntity(tileentity); chunkProfiler.startChunk(key); @@ -2895,7 +2897,7 @@ protected void setActivePlayerChunksAndCheckLight() { - this.activeChunkSet.clear(); + this.activeChunks.clear(); this.theProfiler.startSection("buildList"); if(isChunkLoaderEnabled()) { @@ -2903,7 +2905,7 @@ { if(chunkRoundExists(c.chunkXPos, c.chunkZPos, WorldConstants.CL_LOAD_RADIUS)) { - activeChunkSet.put(ChunkHash.chunkToKey(c.chunkXPos, c.chunkZPos), (byte)WorldConstants.CL_CHUNK_PRIOR); + activeChunks.put(ChunkHash.chunkToKey(c.chunkXPos, c.chunkZPos), (byte)WorldConstants.CL_CHUNK_PRIOR); } else { @@ -2940,7 +2942,7 @@ int priority = Math.max(Math.abs(i1), Math.abs(j1)); //Chunk chunk = this.chunkProvider.provideChunk(cx, cy); //if(priority > 1) priority -= Math.min(priority-2, (int)(this.getTotalWorldTime() - chunk.lastActiveOrBindTick)/20); - activeChunkSet.put(key, (byte)Math.min(priority, activeChunkSet.get(key))); + activeChunks.put(key, (byte)Math.min(priority, activeChunks.get(key))); } } } @@ -4206,17 +4208,17 @@ public int getActiveChunkSetSize() { - return activeChunkSet.size(); + return activeChunks.size(); } public IntByteMap getActiveChunkSet() { - return activeChunkSet; + return activeChunks; } public boolean isChunkActive(int cx, int cz) { - return activeChunkSet.containsKey(ChunkHash.chunkToKey(cx, cz)); + return activeChunks.containsKey(ChunkHash.chunkToKey(cx, cz)); } protected boolean isChunkLoaderEnabled() diff --git a/src/main/java/net/minecraft/world/WorldServer.java b/src/main/java/net/minecraft/world/WorldServer.java index 7faee61..bf0f518 100644 --- a/src/main/java/net/minecraft/world/WorldServer.java +++ b/src/main/java/net/minecraft/world/WorldServer.java @@ -323,7 +323,7 @@ int i = 0; int j = 0; - for (IntByteCursor iter = activeChunkSet.cursor(); iter.moveNext();) + for (IntByteCursor iter = activeChunks.cursor(); iter.moveNext();) { int chunkCoord = iter.key(); int chunkX = ChunkHash.keyToX(chunkCoord);