Spigot WorldBorder 1.9.10 (beta)

a feature-rich world size limiting plugin, which can also generate or trim a world to your border

  1. Brettflan submitted a new resource:

    WorldBorder - a feature-rich world size limiting plugin, which can also generate or trim a world to your border

    Read more about this resource...
     
  2. Brettflan updated WorldBorder with a new update entry:

    Version 1.9.0

    Read the rest of this update entry...
     
    • Friendly Friendly x 1
  3. Commands and Permissions


    Key: primary command <required value> [optional value]


    Note that [worldname] is actually required in the commands below if run from the server console, but optional if run in-game by you as a player, as it then defaults to the world you're in if not specified.


    /wb - list available commands like below (show help).

    Permission: worldborder.help


    /wb set <radiusX> [radiusZ] - set world border of specified radius (in blocks), centered on you. Can only be run by an in-game player. If radiusZ isn't specified, the radiusX value will be used for both.
    /wb [worldname] set <radiusX> [radiusZ] <x> <z> - set border with the x and z coordinates of the center specified.
    /wb [worldname] set <radiusX> [radiusZ] spawn - set border with the world's spawn point used as the center.
    /wb set <radiusX> [radiusZ] player <playername> - set border centered on the specified player for the world they're currently in.
    /wb [worldname] setcorners <x1> <z1> <x2> <z2> - set a border based on corner coordinates from location (x1, z1) to (x2, z2).

    Permission: worldborder.set (all commands above)


    /wb [worldname] radius <radiusX> [radiusZ] - change border radius for this world. The world needs to have already had a border set, since the x and z values are not modified. If radiusZ isn't specified, the radiusX value will be used for both. A "+" or "-" can be added to the start of radiusX or radiusZ to have the current radius increased or decreased a specified amount, for example "+100" would increase the existing border radius by 100 blocks.

    Permission: worldborder.radius


    /wb [worldname] clear - remove border for this world.
    /wb clear all - remove all borders for all worlds.

    Permission: worldborder.clear (both commands above)


    /wb list - show full border information for all worlds.

    Permission: worldborder.list


    /wb shape <elliptic|round|rectangular|square> - set the primary border shape to elliptic/round (default), or rectangular/square. Note that "elliptic" and "round" are interchangeable here, as are "rectangular" and "square".

    Permission: worldborder.shape


    /wb knockback <distance> - how far to move the player back inside the border when they cross it.

    Permission: worldborder.knockback


    /wb [worldname] fill [freq] [pad] [force] - generate all missing chunks for this world, out to the border. The freq value is the number of times per second it will try to check/generate a chunk (default 20). For a server with players on it, you should probably stick with the default or possibly even a lower value. If you just want it to finish as quickly as possible, try 1000 or so. The pad value is how much of a buffer to add beyond your borders (default 208, should keep any more chunks from being generated by players). Specify "true" for the force value if you want to force loading of all world chunks instead of automatically skipping chunks which are already fully generated. Read below for more info.

    Permission: worldborder.fill


    /wb [worldname] trim [freq] [pad] - trim off extra chunks for this world, beyond the border. The freq value is the number of chunks per second it will try to check (default 5000). The pad value is how much of a buffer to keep beyond your borders (default 208, should keep any more chunks from being generated by players). Read below for more info.

    Permission: worldborder.trim


    /wb bypass [player] [on|off] - enable/disable bypass mode for a player, allowing them to go beyond the border without being knocked back. The list of people with bypass mode enabled is stored between server restarts. The specified [player] name is optional if run in-game and defaults to the player running the command if not specified, but is instead required if run from console. [on|off] is optional and will simply toggle if you don't specify "on" or "off".

    Permission: worldborder.bypass


    /wb bypasslist - outputs a list of all players who have border bypass enabled.

    Permission: worldborder.bypasslist


    /wb fillautosave <seconds> - set the interval for automatic saving of the world during the Fill process. Default 30 seconds, set to 0 to disable automatic world saving (not recommended).

    Permission: worldborder.fillautosave


    /wb wshape [worldname] <elliptic|round|rectangular|square|default> - Override the shape for this world only. The world needs to have already had a border set. The default shape used by other worlds (set via /wb shape) will not be changed by this. Note that "elliptic" and "round" are interchangeable here, as are "rectangular" and "square".

    Permission: worldborder.wshape


    /wb wrap [worldname] <on|off> - toggle border wrapping for the specified world (default off). This will make border crossings in that world send the player around to the opposite edge of the border instead of just knocking them back.

    Permission: worldborder.wrap


    /wb getmsg - display the message shown to people who cross the border.

    Permission: worldborder.getmsg


    /wb setmsg <message> - change the border message.

    Permission: worldborder.setmsg


    /wb delay <amount> - the number of server ticks it will wait between border checks, the default is 5 ticks (250ms); each server tick is roughly 50ms.

    Permission: worldborder.delay


    /wb whoosh <on|off> - turn knockback "whoosh" effect on or off.

    Permission: worldborder.whoosh


    /wb portal <on|off> - turn portal redirection on or off (default on). Makes sure portals are made/directed inside the world's border. You should normally only need to turn it off if you have problems with Multiverse not creating portals or any other plugin incompatibilities.

    Permission: worldborder.portal


    /wb denypearl <on|off> - toggle option which cancels ender pearls which are thrown past the border, rather than just adjusting their target location. (default on)

    Permission: worldborder.denypearl


    /wb dynmap <on|off> - enable/disable DynMap integration. This will show your borders in DynMap, and they should update almost immediately if you change anything about the border. Defaults to true.

    Permission: worldborder.dynmap


    /wb dynmapmsg <text> - Borders shown in DynMap will have a label with this text. Defaults to "The border of the world."

    Permission: worldborder.dynmapmsg


    /wb remount <amount> - Set the delay in server ticks before remounting a player to their vehicle after they're knocked back from the border. Defaults to 0, which disables re-mounting and leaves the vehicle next to the player. This value should not be set to a value lower than 10 (the former default value) on a public server as that would lead to client glitches. Even the former default value of 10 has been reported to rarely glitch on some servers, which is why remounting now defaults to disabled.

    Permission: worldborder.remount


    /wb reload - re-load data from config.yml. Normally should never be needed, but here just in case.

    Permission: worldborder.reload


    /wb debug <on|off> - turn console debug output on or off. Also should normally never be needed.

    Permission: worldborder.debug


    Notes:

    • The /wb command is an alias of the main command /wborder, so unless another plugin interferes, you can use /wb and /wborder interchangeably. From the console, you'll of course need to leave off the "/" either way.
    • If as a player you leave out [worldname], it will use the current world you're in; [worldname] is however required from the console.
    • The <radiusX>, <radiusZ>, and <amount> values must be a whole numbers (integers), but <x>, <z>, and <distance> can have a decimal point (they're doubles).
    • A border radius is the distance the border is in each direction from the center (x and z), so for example a radiusX of 600 and radiusZ of 300 would cover a 1200x600 area.
    Examples:

    /wb set 2000 - Sets a border for the current world with a radius of 2000 (total area 4000x4000 blocks), centered on exactly where you're standing.
    /wb set 2000 1000 - As above, but with an X radius of 2000 and a Z radius of 1000 (total area 4000x2000 blocks), making it wider on the X axis than the Z axis.
    /wb netherworld set 250 -12.5 47.3 - Sets a border for the world named "netherworld" with a radius of 250 (area 500x500), centered at -12.5 (X) by 47.3 (Z).
    /wb shape round - Sets the primary border shape to round/elliptic for all worlds.
    /wb wshape square - Sets the border shape for the current world to square/rectangular, not affecting the default shape used by other worlds.


    With your permission plugin of choice, you can also use the permission worldborder.* to grant all plugin commands to a group or player. Whether or not you're using a plugin for permissions, Ops and people with access to the server console will be able to use all commands.
     
    #3 Brettflan, Sep 19, 2018
    Last edited: Sep 20, 2018
    • Useful Useful x 3
  4. The Fill command:

    The "fill" command is a bit special, so I'll devote an entire section to describing it. Maybe easier to show than describe, so... Here's a world with a 512 radius round border set, the Before image being from a freshly generated world and the After image being right after WorldBorder's fill command has completed (176 block buffer used here, though 208 is the default):

    [​IMG]

    After initiating the fill command, you will receive a bit of info on the process, and will be required to enter /wb fill confirm to actually start the process. Every 5 seconds, it will give you a progress report along with an estimated completion percentage. To pause/unpause the process at any time while it's running, you can use the /wb fill pause command. Likewise, to cancel the process you can use the command /wb fill cancel.
    If it detects at any point that you are running extremely low on available memory (less than 200 MB), it will automatically pause the process, and will automatically resume if/when at least 500 MB of memory is available. If you shut down your server while the process is running, it will even mark its progress and will automatically continue on its own as soon as the server comes back up. That being the case, if you want it to finish as quickly as possible and it has hit low memory availability, simply stopping and restarting the server is generally much quicker than waiting for Java to decide to do garbage collection.
    It is strongly recommended to only use the default frequency value of 20 for the fill process; higher values have sometimes proven to cause the process to slow to a crawl or crash for no clear reason.



    The Trim command:

    NOTE: If you are using the DynMap plugin and use our "trim" command, you will need to restart your server afterwards and then run a "fullrender" in DynMap to properly update their map display.

    The "trim" command is a complement to the "fill" command, and similarly special. A visual demonstration is in order for it as well. Below is a backup of an old world which was largely unrestrained to begin with, as seen in the Before image. The After image shows it after the "trim" command has been run with a border radius of 750:

    [​IMG]

    After initiating the trim command, you will receive a bit of info on the process, and will be required to enter /wb trim confirm to actually start the process. Every 5 seconds, it will give you a progress report along with an estimated completion percentage. To pause/unpause the process at any time while it's running, you can use the /wb trim pause command. Likewise, to cancel the process you can use the command /wb trim cancel.
     
    #4 Brettflan, Sep 19, 2018
    Last edited: Sep 19, 2018
    • Useful Useful x 4
  5. Further Information

    This post simply contains some further miscellaneous info which doesn't really fit in other categories.

    Each world which you want to have a border will need to have one defined separately. You can of course use the appropriate commands to define borders for worlds which you aren't currently in or even worlds which don't exist yet. It will inform you if the world doesn't exist, but will store the border info and will use it if/when a world by that name is ever loaded.

    Whenever any configuration is changed by a command, whether it be adding or modifying a border or changing the border message, the configuration file is automatically saved. Since all configuration data is modifiable via the in-game command interface, you should never have to actually even know how to open this plugin's config.yml file.

    The default border shape is round/elliptic. A round/elliptic border makes for a nicer world map, but takes a few more calculations. Even so, the round/elliptic border is only a miniscule amount less efficient; it is based mostly on rBorder's excellently crafted algorithm for determining if a player is inside the border. You can also choose to have a square/rectangular border, which is very slightly more lightweight, and some might prefer the shape anyway.

    The border checking routine is done as a repeating task for higher performance, rather than being run with every player movement event like other border-providing plugins. It defaults to running every 4 ticks (200ms), but can be configured to run more or less often than that using the delay command. For reference, 20 ticks = 1000ms = 1 second.

    If a player moves outside the border, they are informed of it and teleported a few blocks back inside the border (3 blocks by default). The target location inside the border will be offset vertically if needed to the closest free spot where a player can stand (though it accepts placement in water). The target location will also be offset to the center of the block so the player won't be stuck in the edge of anything. If the player is using a vehicle, the vehicle will move back with them inside the border. In the rare case (such as some places in a Nether world) that no suitable vertical open space exists at the target X and Z coordinates, the player will be teleported back to the spawn location of the current world. If you're using square/rectangular borders, the move back inside the border will normally only be along one direction (X or Z). If you're using round/elliptic borders, the move back inside the border will instead be aimed in a direct line towards the border's center location; thus, it will quite often move the player back at an angle.


    Special thanks to Reil for his excellent lightweight round border detection code, which I use mostly unchanged from rBorder's source with permission.



    API / Integration

    Below is some example code for getting the Border data for a specific world:

    Code (Java):
    import com.wimbli.WorldBorder.BorderData;
    import com.wimbli.WorldBorder.Config;

    //...

    // example code with example world name
    String worldName = "world";
    BorderData border = Config.Border(worldName);
    // if border isn't set for world, it returns null; need to check for that
    if (border != null)
    {
        // can use border.getX() and border.getZ() to get the center position,
        // border.getRadiusX() and border.getRadiusZ() to get the radius values,
        // border.insideBorder(...) for checking if a location is inside the border,
        // along with everything else that's available through BorderData
    }
    You can further access and manipulate most other data through the plugin's Config class.
     
    #5 Brettflan, Sep 19, 2018
    Last edited: Sep 19, 2018
    • Like Like x 1
    • Useful Useful x 1
  6. Reserved in case I need another info post.
     
    • Winner Winner x 1
  7. (moved to make way for brettflans info posts)

    Welcome to Spigot. I wasn't sure if this plugin was even going to get updated again. It's the last plugin I still had to go back to the old bukkit site to grab. Thanks for continuing this great project!
     
  8. Hi ! (I use a version for 1.12.2)
    Can you explain thease :

    -------------------
    portal-redirection: true
    knock-back-dist: 10.0
    knock-back is if portal-redirection is false ?
    -----------------
    timer-delay-ticks: 5
    remount-delay-ticks: 0
    what are thease ?
    ----------------
    fill-autosave-frequency: 30
    fill-memory-tolerance: 500
    what are thease and what are the numbers ref ?

    ---------------
    Thanks very much :)
     
    • Agree Agree x 2
    • Optimistic Optimistic x 1
  9. How much ram would you say is required to pre generate a round world with a radius of 20 000? Currently I have 8 GB allocated to the server and about 6-7 GB is constantly being used after pre generating a round world with a radius of 5 000. Before pre loading only 3-4 GB was being used. Is it supposed to be using this much memory? The server still lags (TPS) when me and my friend use an elytra and fly in opposite directions really fast, however chunks seem to be loading faster than generating chunks on the fly.

    (1.13.1 version)
     
  10. UPDATE:
    Problem fixed, all I needed to do was restart the server, silly me!
     
  11. /wb portal <on|off> - turn portal redirection on or off (default on). Makes sure portals are made/directed inside the world's border. You should normally only need to turn it off if you have problems with Multiverse not creating portals or any other plugin incompatibilities.

    /wb
    knockback <distance>
    - how far to move the player back inside the border when they cross it.

    /wb delay <amount> - the number of server ticks it will wait between border checks, the default is 5 ticks (250ms); each server tick is roughly 50ms.

    /wb remount <amount> - Set the delay in server ticks before remounting a player to their vehicle after they're knocked back from the border. Defaults to 0, which disables re-mounting and leaves the vehicle next to the player. This value should not be set to a value lower than 10 (the former default value) on a public server as that would lead to client glitches. Even the former default value of 10 has been reported to rarely glitch on some servers, which is why remounting now defaults to disabled.

    /wb fillautosave <seconds> - set the interval for automatic saving of the world during the Fill process. Default 30 seconds, set to 0 to disable automatic world saving (not recommended).

    fill-memory-tolerance doesn't currently have a command to set it, but it refers to the amount of available memory (in MB) below which the Fill process will automatically pause.
     
    • Friendly Friendly x 1
  12. thanks very much !
     
  13. Hello and thank you for this plugin really useful that said during the generation of the world (fill) in the Nether I see that it is unusually slow ... its generates 3 chunk by 3 and so in 6h it was 5% (radius 3000 x 3000) is this normal? Freq 20 or 1000 nothings change.
     
  14. I don't want to be quick to blame this plugin -- more likely it's a vanilla or Spigot thing with chunks -- but I usually don't have issues with java garbage collection (we use BeastNode so I can't change startup arguments but they generally work well) except when using WB's fill command. It just slowly eats memory then keeps it maxed out until we restart the server. We usually have several players on so I've only been running it at speed 5 or 10 so as not to risk overload, but that seems to happen anyway after running for a bit. Even saving and unloading the world with Multiverse doesn't seem to affect anything -- only restarts will clear it. Any suggestions?
     
    • Agree Agree x 2
  15. Memory usage by the Fill process is strictly down to Bukkit's chunk loading / generation methods, and by extension the Minecraft server's.
     
  16. It seems fill-memory-tolerance not such useful as needed. Yes, it stops generating and try to cleanup, but possible cause of Spigot 1.13.1 memory leaks - memory does not clean good, so about after 30 min server will crash with out of memory error. I think it would be good feature to optionally restart the server, when memory is low.
     
    • Agree Agree x 1
  17. Trying to fill a world created by EWG and though 90% of it has filled, the outer edges that last 10% won't fill and I get this error anytime I try:
    https://pastebin.com/cGGzQaCS
    Players who venture out into those chunks also get stuck in a state where the server crashes until they are force tp'ed away
     
  18. Yeah, this part of your paste points to it likely being a problem in a plugin:
    Code (Text):
    Caused by: java.lang.NullPointerException
    at minelazz.iIIiIiiIii.createChunk(kc:300)
    A quick search for "minelazz.iIIiIiiIii" leads to:
    https://www.spigotmc.org/members/minelazz.11227/

    I see EWG which you mentioned in that list.

    Otherwise, it's possible the root cause of the error is in Spigot/Bukkit/NMS code.
     
  19. PaperSpigot now has AsyncChunks. I'd like a feature that supports that in the pregeneration, thank you.
     
  20. Been trying to get this dynmap in order, after a lot of switching between 1.12 and 1.13 until all plugins (almost all) were working again, and i had to rebuild the map of our biggest and oldest world. I ended up removing all but two plugins and hooked the server folder to my i7 with 16Gig RAM and let it do its job with 8Gig, I find it disturbing at times that it in the previous version of WB crashed so many times that I'm still waiting for the percentage to cross the finish line. Currently at 26%, ok, newest version 1.9.0 did not crash, yet! It likes to gobble all the memory I gave it, and hardly releases it, noticed that it has in use almost all gigs...
    Where does this go if I want to keep the server online>? Not possible, because processes are being stopped or taken over just to use it for render. And come to think of it the server really needs only 2GB memory to run smoothly.... So, something You guys made, makes a mess of things...
    Still, We, our team are very happy the plugin works without fault..... (except the fill drama) So, keep things up, thank you from all our players...