Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resetting parts of a level

Comments in 'Plugin Development' started by AppPhil, Oct 5, 2015.

  1. AppPhil
    Offline

    AppPhil Active Member

    Joined:
    Oct 3, 2015
    Posts:
    54
    Hey there,

    I want to have different areas in one level where players can do everything they want. But after some time I want to reset one of these areas (not all at the same time) so I can't just make a copy of the world before the players come and just delete that and make a new copy of the normal world. I thought I could do it like this:
    When a player places a block, I add the position of the block to an array and when the area should be resettet, I remove all the blocks at the positions of the array. But I don't know if this is an effective way to do it and I also don't know how to reset blocks which where destroyed or replaced by the players.

    Maybe someone can help me, please! :)
  2. Gamecrafter
    Offline

    Gamecrafter

    Joined:
    Nov 20, 2014
    Posts:
    978
    Plugins:
    9
    Instead of moving around the entire world file, you should just move around the chunk files(16x16 parts of a map).
    AppPhil likes this.
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Is your server a survival server or some other game server?

    I am asking because I would like to share how I am planning to implement spleef in LegionPE. My concept was that when a player clicks on a block, broadcast the block changes to the users of that arena and cancel the event (do it at DataPacketReceiveEvent, otherwise PocketMine will resend the block to the player). This is most effective. You can simply unload the levels for the players, then PocketMine will resend them.
  4. AppPhil
    Offline

    AppPhil Active Member

    Joined:
    Oct 3, 2015
    Posts:
    54
    My server is a game server, but I don't understand what you mean. Maybe you could explain it a bit more. :)

    And how can I (when my area is a rectangle) check which chunks are between two positions?
  5. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    i also really need this. copying the world folder to another location and back does not work
  6. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    What I meant was a framework that disables world changes. Basically, on server-side nothing is changed (so things like water flowing won't work), but client-side players can see the blocks being placed/broken. And with that, you have to disable checks like noclip check and antifly check. (The previous one cannot be disabled from a plugin)
    AppPhil likes this.

Share This Page

Advertisement