Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. final Chunk c = p.getWorld().getChunkAt(cX, cZ);
  2. //Unload the chunk unsafely and without saving
  3. if (c.unload(false, false)){
  4. System.out.println("Unloaded correctly");
  5. }
  6. //Load the Chunk async
  7. ((CraftWorld)p.getWorld()).getHandle().chunkProviderServer.getChunkAt(c.getX(), c.getZ(), new Runnable() {
  8. @Override
  9. public void run() {
  10. //Send a chunk packet update
  11. for (Player t : c.getWorld().getPlayers()){
  12. ((CraftPlayer)t).getHandle().playerConnection.sendPacket(new PacketPlayOutMapChunk(((CraftChunk)c).getHandle(), true, 65535));
  13. }
  14. //Refresh the chunk
  15. if (((CraftWorld)c.getWorld()).refreshChunk(c.getX(), c.getZ())){
  16. p.sendMessage("§a¡Success! §7Coords: " + c.getX() + " - " + c.getZ());
  17. }
  18. }
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement