Displaying specific chunks to player only

Discussion in 'Plugin Development' started by Dudemister1999, Apr 14, 2014.

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

    Dudemister1999

    Hello again! Another roadblock on my programing. I need to show chunks to a player, only him/her, and no other chunks. For instance, in a creative server, how cool would it be to only show that player his own creative plot? It'd be like he owns his own world! I just need to find a way to go about doing this.

    Any ideas?

    -Alex

    N3rdFall
    That would work, however the lag induced by sending hundreds of block updates (Which also causes light recalculation) would take forever just to load it.

    Small update, haven't found a way to do this yet, but I'm thinking of trying a Chunk Load event, and block it if it isn't a certain chunk. Does anyone have a better idea?

    Thanks,
    -Alex

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  2. Offline

    Dudemister1999

    Just a small bump, maybe?
     
  3. Offline

    BillyGalbreath

    Chunk Load/Unload Events are not for clients. They are for the server to load/unload to/from memory. You cannot do this per chunk per client like you want. The only possible solutions are the one stated above, or making your own client mods.
     
  4. Offline

    Dudemister1999

    BillyGalbreath That is unfortunate. I'll give it a try. But as I said before, block change events also cause light recalculations. I'll see what I can do.
     
  5. Offline

    BillyGalbreath

    Check out WorldEdit's source for their "fast mode" edits. I believe it involved NMS, but it allows changing a bunch of blocks with minimal extra processes (like light updates).
     
  6. Offline

    xTrollxDudex

    Dudemister1999
    ProtocolLib intercept MapChunkBulk or update chunk packets sent to specified client
     
    BillyGalbreath likes this.
  7. Offline

    Dudemister1999

    BillyGalbreath I'll take a look, thanks for the suggestion!

    xTrollxDudex It does? I'm already using ProtocolLib to block the player tab list, so this will be perfect! I will also take a look at that!

    xTrollxDudex
    Alright, I've gotten this far!

    Code:java
    1. PacketListener chunkPacketListener = new PacketAdapter(this, ListenerPriority.LOWEST, PacketType.Play.Server.MAP_CHUNK_BULK)
    2. {
    3. @Override
    4. public void onPacketSending(PacketEvent event)
    5. {
    6.  
    7. }
    8. };


    I know, it isn't much, but I am mostly unfamiliar with ProtocolLib.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  8. Offline

    xTrollxDudex

    Dudemister1999
    PacketPlayOutMapChunk and PacketPlayOutMapChunkBulk should be the two packets you should check for and intercept to an outbound player.
     
  9. Offline

    Dudemister1999

    xTrollxDudex
    Sweet, thanks for all your help! I'll let you know if my newbie tendencies take over.
     
Thread Status:
Not open for further replies.

Share This Page