[solved] setBiome() require relogin

Discussion in 'Plugin Development' started by fromgate, Mar 30, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    fromgate

    Hello!

    I'm changing biomes with .setBiome() method. All works fine, but player will not see the changes until he relogin. Is it possible to force send to client information about new biomes?
     
  2. Offline

    hatstand

    Yes, you need to re-send the chunk. VoxelSniper has a command to do so, and they use this:
    Code:
    ((CraftPlayer)player).getHandle().netServerHandler.sendPacket(new Packet51MapChunk(((CraftChunk)player.getWorld().getChunkAt(player.getLocation().getBlock())).getHandle(), true, 0));
    That resends a particular chunk to a particular player. BananaChunk does similar things, but calls world.refreshChunk(chunkX, chunkZ)
     
    fromgate likes this.
  3. Offline

    fromgate

    Thank you! I'll tr it.
     
  4. Offline

    fromgate

    Thank you! You really helped me. refreshChunk is not "resending" it to client, but first method is nice.
    Yesterday I've finished biome changing plugin - LWGen :)
     
Thread Status:
Not open for further replies.

Share This Page