LogHelper.info("Moving player " + player);
player.setLocationAndAngles(safeX, player.posY, safeZ, 0.0F, 0.0F);
worldObj.updateEntityWithOptionalForce(player, true);
}
}
final Chunk chunk = world.getChunkFromBlockCoords(x, z);
chunks.put(Pair.of(x1, z1), chunk); // save map of chunks
providerServer.unloadChunksIfNotNearSpawn(x1, z1);
}
}
// verify that chunks unloaded
int lastloaded = 0;
while (providerServer.getLoadedChunkCount() != lastloaded) {
lastloaded = providerServer.getLoadedChunkCount();
providerServer.unloadQueuedChunks();
for (final Pair<Integer, Integer> coord : chunks.keySet()) {
final Chunk chunk = chunks.get(coord);
if (chunk != null) {
if (chunk.isChunkLoaded) {
LogHelper.warning("Failed to unload chunk @ " + coord);
/*
* } else { LogHelper.info("Chunk unloaded @ " + coord);
*/
}
}
}
}
chunks.clear();
LogHelper.info(providerServer.makeString());
IChunkLoader chunkloader = providerServer.currentChunkLoader;
providerServer.currentChunkLoader = null;
for (int x1 = chunkX.intValue() - range; x1 <= chunkX.intValue() + range; x1++) {
for (int z1 = chunkZ.intValue() - range; z1 <= chunkZ.intValue() + range; z1++) {
// GenesisBiomeOverrideHandler.myQueue.add(new
// GenesisBiomeOverrideHandler.coord(x1, z1));
final Chunk chunk = providerServer.loadChunk(x1, z1);
byte[] chunkBiomes = chunk.getBiomeArray();
for (int k = 0; k < chunkBiomes.length; ++k) {
chunkBiomes[k] = (byte) newBiome.biomeID;
}
chunk.setBiomeArray(chunkBiomes);
//providerServer.populate(providerGenesis, x1, z1);
//chunk.sendUpdates = true;
//chunk.setStorageArrays(par1ArrayOfExtendedBlockStorage);
chunk.setChunkModified();
}
}
providerServer.currentChunkLoader = chunkloader;