Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final Chunk c = p.getWorld().getChunkAt(cX, cZ);
- //Unload the chunk unsafely and without saving
- if (c.unload(false, false)){
- System.out.println("Unloaded correctly");
- }
- //Load the Chunk async
- ((CraftWorld)p.getWorld()).getHandle().chunkProviderServer.getChunkAt(c.getX(), c.getZ(), new Runnable() {
- @Override
- public void run() {
- //Send a chunk packet update
- for (Player t : c.getWorld().getPlayers()){
- ((CraftPlayer)t).getHandle().playerConnection.sendPacket(new PacketPlayOutMapChunk(((CraftChunk)c).getHandle(), true, 65535));
- }
- //Refresh the chunk
- if (((CraftWorld)c.getWorld()).refreshChunk(c.getX(), c.getZ())){
- p.sendMessage("§a¡Success! §7Coords: " + c.getX() + " - " + c.getZ());
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement