[MECH] WorldBorder v1.7.2 - feature-rich world size limiting plugin [BukkitDev]

Discussion in 'Archived: Plugin Releases' started by Brettflan, Apr 4, 2011.

  1. Offline

    Brettflan

  2. Offline

    Oxygene

    This is great. There jsut one time saving feature I'd love if pos! My server is going to add planes soon and the thought of them flying over the border being tped back and stalling is a pain so we decided to add a visible border like a row of blocks around the edge. Would it be pos to add a command which generates a visible border like that along the line of the set border?
     
  3. Offline

    Brettflan

    Solid border generation is on my "look into it some day" list for the plugin.
     
  4. Offline

    tgcarter

    The fill command worked wonders and thanks for implementing it. I ran the command when the server was on localhost only and it ran it very quickly. We have a nice round world now :)
     
  5. Offline

    EdGruberman

  6. Offline

    Oxygene

    Thought I'd post a little thank you image to demonstrate how this plugin has helped me!
    http://zoom.it/THtL
    A perfectly square world :) Yes there are a couple of bits unmapped but thats my fault, I trimmed them with a map editor just before the render.
     
  7. Offline

    Brettflan

    Thanks, might come in handy.

    You're welcome. :)

    I'm going to start attempting a world trimming method very soon now. Haven't quite determined if I'm going to be manually modifying the files (probably necessary, and I have a good basis for how to do so since Mojang released the region file storage code) or if I can find a way to sneak in the back door of the built-in RegionFile, RegionFileCache, and related code in order to do what I need.
    At the least, deleting regions (512x512 block / 32x32 chunk areas) which are completely outside the border should be easy since those are stored in individual files.
     
  8. Offline

    DDoS

    If I have a server with 8GBs of RAM, and an average population of 70 players, what would be the optimal radius for a round border? I can't decide between 25000 and 23500. Is there anyway to know the current size of your world (without walking)?

    Edit: well I used /wb set 50000 at the spawn of my SMP world, and everyone got tp'ed at the spawn, the region was like only 1 block wide. WTF?
     
  9. Offline

    findyourexit

    Just wanted to drop by and thank you for your hard work on this plugin @Brettflan.

    I also wanted to submit a feature request if you even find yourself with the time or wondering what could make this plugin any more awesome than it already is.

    Basically I'd really love to see a command that allows you to delete all chunks outside of the specified worldborder :) - I've been looking for something to fit this requirement for some time now and think it would best belong within a plugin such as WorldBorder. The command would essentially fill the requirement that was once covered by this tool (requires you to log into the MC forums first).

    Anyway, again, really love your work with the plugin :)
     
  10. Offline

    Oxygene

    +1 that would be excellent! Would have saved me ages in the world editor :p
     
  11. Offline

    Brettflan

    Confirmed, bizarre. Any border radius larger than 46340 shows that sort of behavior on my test server with a round border shape; no problems with square shape. Not sure just yet how it's even possible, but I'll hopefully have a bugfix out soonish.
    You do realize that's a massively hugely big radius, though, right? With 50000 radius, that's a 100,000 x 100,000 block area.
    EDIT: mystery solved. Since WorldBorder has to calculate the border's radius squared, any value of 46341 or higher squared is a larger number than can be held in an integer, which is what WorldBorder has been using to store that particular value. Thus, craziness results for a border radius that large.

    As for determining the current world size, I don't know a simple way offhand or available through Bukkit. You might be able to determine it using a tool like MC Edit or similar.

    That's the planned world trimming functionality I've been talking about above.
     
  12. Offline

    THEK

    This is a brilliant plugin! Is there any way to remove the chunks that aren't necessary outside the border? (Just to make a 3D map look good)
     
  13. Offline

    Brettflan

    Remove chunks inside the border? Why would you want to do that? The moment anyone gets remotely close to the chunk, it will end up being recreated again anyway. There's of course the fill command to fill in empty chunks inside the border.
    When/if I have the trim function ready, you will be free to temporarily set a smaller border radius and trim to it, if for whatever reason you want to trim off chunks inside your normal border.
     
  14. Offline

    THEK

    Not inside the border. Outside. I have an existing map where someone has walked in one continuous line. and there are several other chunks with nothing in them. Is there a way to remove unnecessary chunks from outside the border?
     
  15. Offline

    grandwazir

    This is really good. Thank you for creating this plugin. I'd like to second my support for world trimming functionality. BorderGuard broke silently a couple of days ago and my users have gone far past the intended border in the meantime. Trimming would be a great addition.
     
  16. Offline

    Brettflan

    Ah, my mistake; I misread that as "not necessarily" rather than "not necessary". As to that, the ability to trim chunks outside the border is the next major planned feature I've been talking about in several posts above.
     
  17. Offline

    Mox

    Awesome plugin, but I would love to see seperate radii per Permissions rank some day.
     
  18. Offline

    Brettflan

    Next up is to add in the world trimming functionality. No estimate on when that's be ready and released; it'll be done when it's done. I've only done research into how to pull it off so far.
     
    findyourexit likes this.
  19. Offline

    findyourexit

    Can't wait mate! Keep up the great work! :D
     
  20. Offline

    joeyismusic

    this is so much better than borderguard
     
  21. Offline

    LRFLEW

    Confirmed that there's a bug where filling in the missing chunks causes chunk 0,0 to be erased and inevitably blank.
     
  22. Offline

    Brettflan

    Re-tested it on a couple of worlds, could not reproduce. It shouldn't be possible based on how the fill process works, either. Can you provide more details on the world this happened in? Where is the spawn point located? What is the center and radius of the border you had set?
    Also, is this on an old world which has been in use for a while, or a newly generated one? Do you have a backup of the world from before running the fill operation, and if so, can you reproduce the blank chunk at 0,0 by running the fill operation again on the backup? For that matter, can you reproduce the problem in another new world?
    If it's reproducible for you on any particular world, I'd appreciate it if you could provide a copy of it to me (via Mediafire or similar).

    EDIT: also, did the chunk go missing immediately, or after restarting the server once, or what?
     
  23. Offline

    LRFLEW

    I've tried to find a way to constantly replicate this by trying it on fresh servers, but I can't get it to happen consistently. I have seen it on a well used server (Yuancity.de), my personal testing server I use every now and again, and a couple of times on a fresh server with no other plugins (except a simple plugin that takes me to the chunk in question). I think it's variability depends on if the chunk is in pre-loaded chunks when you start the server. If you want, I can try screen capturing more attempts, and send you the before and after worlds of any successful attempts.

    EDIT: to answer the other questions: the yuancity.de server did restore from a backup and tried again with the same results. As to when the chunk disappears, it seems to be when the chunk reloads, but I can't verify that specifically.
     
  24. Offline

    Brettflan

    And you're sure you're not just seeing the usual "empty chunk" which still occurs sometimes after teleporting, and which clears up in the client if you reconnect to the server? The chunk at 0,0 is a missing hole in the landscape if you do a map export? Dumb question I expect, but I figured it might be worth asking just in case.

    I suppose it might not be a bad idea to have it track which chunks are loaded when the task starts and not try to unload any of those as the fill process passes beyond them.
     
  25. Offline

    arthoz

    Wonder if you could add a permission node so me as an admin (and possibly other exceptions) can pass through the border?
     
  26. Offline

    fffizzz

    this has been discussed numerous times. defeats the purpose of a border plugin. Look into region protection like worldguard or the likes.
     
  27. Offline

    arthoz

    Worldguard does not support round regions, only polygons, and you also have to deal with parent/children and most likely more resource usage. (could just ignore borderchecks from the people in that node or something).

    But yeah, if its not planned then i guess i just have to expand/shrink world whenever something needs to be done outside border.
    Sorry about asking something thats asked umpteen times btw, for some reason i thought there only was 1 page in the thread when reading before posting so missed it ;P
     
  28. Offline

    robnar

    That's the main reason I need this feature--I need to limit the size of my world while giving my admins a chance to move structures from outside the border to a new home inside. Brett was kind enough to open source this plugin though, so it's pretty trivial to add an isOp() check. If Brett has no objections I don't mind posting the modified jar/source for those who want it, just don't expect long-term support. :D
     
  29. Offline

    Brettflan

    Trim functionality incoming very shortly. I tested it out on a backup of my server's main world, which has a 1600 radius border. When I first started that world a couple of months ago or so, I had the border set incorrectly, so when I did get it set properly there were some extra bits sticking out. So:

    [​IMG] [​IMG]
    Before trim ......(1600 radius)...... After trim
    [​IMG]
    And just for the hell of it, a further trim down to a radius of 1000.​
    To my knowledge, this is the only plugin which actually trims chunks off of a map. I know of WorldTrim (which is technically not a plugin since it's standalone), but it only trims off entire regions (512x512 block areas), not individual chunks (16x16).​
    Note that if an entire region is outside the border, the region file will be deleted by this process, freeing up space. A shortcoming to the individual chunk trimming, however, the process only really blanks the pointer for that chunk's data in the region file. The chunk's data is left orphaned. However, Minecraft will happily overwrite it when/if another chunk in that region is generated, so it's not so bad. To delete the chunk's full data would require completely rewriting the region file to rewire all of the chunks' pointers, which I'd just as well not get into.​
    The trim process is much much faster than the fill process, by the way.


    Feel free, though preferably with the disclaimer that it will impact the performance of the plugin. That's the main reason I'm not wanting it as an official feature, I want the border checking routine to be as fast as possible. WorldBorder is already more efficient than BorderGuard, and I'd just as well keep it that way. ;)

    OK, then.
    EDIT: by the way, the 1600 radius trim example above took ~7 seconds to run on my VM with the default frequency of 5000, and got no "Can't keep up!" messages. Hopefully that's a good indication of how fast it is.

    While playing around with the trim and fill functionality, I finally found a world in which I can reproduce this problem using the fill command. Nasty little bugger. It thankfully happens consistently on this world, too, so coming up with a fix should be much easier. For now, I recommend not using the fill command until I can get out a workaround fix out (I'm convinced it's really a Bukkit bug rather than a WorldBorder bug).
    To clarify, it's just the fill command which can cause that problem, the trim command doesn't cause it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016
  30. Offline

    LRFLEW

    I'm trying to isolate this as best I can too (I have a theory as to the source). Can you tell me the spawn location in the successful world?
     
  31. Offline

    Brettflan

    For this world, it's at X: 8 Y: 8.
    I've isolated the cause and a fix. It is indeed a Bukkit bug, which is triggered by using World.unloadChunk() under unknown particular circumstances. It's quite bizarre that it only seems to strike chunk 0,0, particularly since I had it running where the task wasn't even touching that chunk.
    I've switched to using unloadChunkRequest() for the fill task instead, which doesn't appear to trigger the bug. That method passes control back to the fill task faster yet it is also a fair bit slower to actually unload the chunk (since it handles unloading them in a queue), the combination of which causes memory usage to balloon pretty quickly if you're running the fill task at a high frequency. I'm going to need to adjust a couple of things due to that in order to keep it from potentially running out of memory before it can even detect the memory is low. I actually hit an OutOfMemory crash while initially testing the fix.

    I'll release a workaround fix release shortly.

    Here we are:
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 13, 2016

Share This Page