1
0
forked from xjboss/KCauldronX

Finally fix #67

This commit is contained in:
Prototik
2015-06-27 16:32:21 +07:00
parent 9fdf330495
commit 8c50b9899f
19 changed files with 737 additions and 704 deletions

View File

@ -138,7 +138,7 @@ public class CraftWorld implements World {
}
public Chunk[] getLoadedChunks() {
Object[] chunks = world.theChunkProviderServer.loadedChunkHashMap.values();
Object[] chunks = world.theChunkProviderServer.loadedChunkHashMap_KC.values();
org.bukkit.Chunk[] craftChunks = new CraftChunk[chunks.length];
for (int i = 0; i < chunks.length; i++) {
@ -262,7 +262,7 @@ public class CraftWorld implements World {
}
world.theChunkProviderServer.chunksToUnload.remove(x, z);
net.minecraft.world.chunk.Chunk chunk = world.theChunkProviderServer.loadedChunkHashMap.get(LongHash.toLong(x, z));
net.minecraft.world.chunk.Chunk chunk = world.theChunkProviderServer.loadedChunkHashMap_KC.get(LongHash.toLong(x, z));
if (chunk == null) {
world.timings.syncChunkLoadTimer.startTiming(); // Spigot
@ -276,9 +276,8 @@ public class CraftWorld implements World {
private void chunkLoadPostProcess(net.minecraft.world.chunk.Chunk chunk, int x, int z) {
if (chunk != null) {
world.theChunkProviderServer.loadedChunkHashMap.put(LongHash.toLong(x, z), chunk);
world.theChunkProviderServer.loadedChunkHashMap_KC.put(LongHash.toLong(x, z), chunk);
world.theChunkProviderServer.loadedChunks.add(chunk); // Cauldron - vanilla compatibility
world.theChunkProviderServer.loadedChunkHashMap_vanilla.add(ChunkCoordIntPair.chunkXZ2Int(x, z), chunk);
chunk.onChunkLoad();
@ -1395,7 +1394,7 @@ public class CraftWorld implements World {
}
final net.minecraft.world.gen.ChunkProviderServer cps = world.theChunkProviderServer;
cps.loadedChunkHashMap.forEachValue(new TObjectProcedure<net.minecraft.world.chunk.Chunk>() {
cps.loadedChunkHashMap_KC.forEachValue(new TObjectProcedure<net.minecraft.world.chunk.Chunk>() {
@Override
public boolean execute(net.minecraft.world.chunk.Chunk chunk) {
// If in use, skip it

View File

@ -89,7 +89,7 @@ public class WatchdogThread extends Thread
{
log.log(Level.SEVERE, " Dimension:" + world.provider.dimensionId);
log.log(Level.SEVERE,
" Loaded Chunks: " + world.theChunkProviderServer.loadedChunkHashMap.size() + " Active Chunks: " + world.activeChunkSet.size()
" Loaded Chunks: " + world.theChunkProviderServer.loadedChunkHashMap_KC.size() + " Active Chunks: " + world.activeChunkSet.size()
+ " Entities: " + world.loadedEntityList.size() + " Tile Entities: " + world.loadedTileEntityList.size());
log.log(Level.SEVERE, " Entities Last Tick: " + world.entitiesTicked);
log.log(Level.SEVERE, " Tiles Last Tick: " + world.tilesTicked);
@ -153,7 +153,7 @@ public class WatchdogThread extends Thread
for (net.minecraft.world.WorldServer world : MinecraftServer.getServer().worlds)
{
log.log(Level.WARNING, " Dimension:" + world.provider.dimensionId);
log.log(Level.WARNING, " Loaded Chunks: " + world.theChunkProviderServer.loadedChunkHashMap.size() +
log.log(Level.WARNING, " Loaded Chunks: " + world.theChunkProviderServer.loadedChunkHashMap_KC.size() +
" Active Chunks: " + world.activeChunkSet.size() +
" Entities: " + world.loadedEntityList.size() +
" Tile Entities: " + world.loadedTileEntityList.size());