Project Borders

Project Borders

A simple world border management plugin. This plugins makes it easier maintain borders in a multi world environment.

:gift: Donations

Creating plugins for Sponge takes time and effort. If you enjoy the hard work Iā€™ve put into to this please feel free to get my a cup of coffee. It is much appreciated.

Donate

:package: FEATURES

  • Multi-World support
  • Chunk Pre-generation
  • Easy to use

:open_file_folder: DOWNLOADS

Release: Download Here
Developement Builds Download Here

:wrench: COMMANDS

/border
/border center
/border damage
/border diameter
/border generate
/border warning
/border info

:hammer: PERMISSIONS

pjb.cmd.border
pjb.cmd.border.center
pjb.cmd.border.damage
pjb.cmd.border.diameter
pjb.cmd.border.generate
pjb.cmd.border.warning
pjb.cmd.border.info

:warning: Bugs

Known:

  • Pre-Generator crashes server periodically

If you find a bug or are having a problem with Project Borders, please create a ticket at GitHub

3 Likes

download link is wrong, it says Broders instead of Borders

A few things:

  • Iā€™m really recommending the use of injection. Especially here, youā€™re finding the config path arbitrarily, rather than using Spongeā€™s built-in utilities for getting default config files.
  • Why is everything in CommandManager a GenericArguments.optional(GenericArguments.string(key))? There are many, many GenericArguments methods that fit the exact use cases you have, yet youā€™re not using any of them. For one of your commands, thereā€™s a 7:1 ratio of parsing code to executing code. This is exactly what the high-level command API is supposed to solve. Also, calling special attention to the optional() part, because most of those arenā€™t actually optional (although /help will subsequently list them as such).

Just to explain. My reasoning behind my excessive use of optional arguments is because I found that Sponges argument error and usage outputs arenā€™t very helpful, and the more complicated the command the more confusing it can get when entering an invalid argument or command. Doing this way allows to override Sponges output and use my own. Iā€™ve never liked doing this way but it was either that, go low level or deal with flooding of questions, (pex anyone?). I always planned on changes this as Sponge development progressed, just havenā€™t found a good solution other than maybe creating my own generic arguments which I havenā€™t look into that much.

The configs is just an old habit from early Sponge development. I have a tendency to borrow code from my other projects if it wasnā€™t obvious.

2 Likes

Feel free to submit a PR to make them better. Meanwhile, you may as well just directly implement CommandCallable and split(" ") since youā€™re not actually using the high-level API. I find that a slightly difficult help message is worth being able to make a command in four lines.

One thing that Iā€™ve thought that might be worth adding to the API, is a genericArguments that can wrap stuff, and just pass-through the commandarguments, but let you change the usage text.

My question is why when executing a sub command that is missing arguments it returns the usage of the root command and not the sub command? At least thatā€™s what Iā€™m seeing. Example /border info requires world argument. Iā€™d expect the Usage output to be

Usage: /border info <world>

but instead I get

Usage: /border [damage|center|diameter|warning|generate|info]

which for someone that has never used this plugin is not very helpful in this situation. Idk I probably screwed something up.

2 Likes

Here is an issue that I created in April describing the same problem: Command usage displayed incorrectly Ā· Issue #1165 Ā· SpongePowered/SpongeAPI Ā· GitHub.

1 Like

When generating out to the world border, if you stop part way through (from a crash or nuclear meltdown, whatever) and then start it up later, will it take the same amount of time as if it was started from the beginning? And Iā€™m assuming it doesnā€™t regenerate existing chunks

I know it says easy to use, but the diameter command is not well explained. I looked at the current border for my world. whatever it defaults to and it says ā€œ6.0E7ā€

No idea what that means. I was expecting a diameter in blocks to set. For instance if I wanted my world to be more 30,000 blocks in diameter, Iā€™m not sure what to enter in the diameter command to get the world the size I want it and I see no link to a wiki or even a read me file to explain the commands and usage of the plugin

6.0E7 is a mathematical abbreviation. It represents 6 * 10^7, so a big number

so 60,000,000

would seem ā€œeasier to useā€ if it just let you limit in block size like this instead of needing a scientific calculator. Not many can do that kind of math in their head

Eh, itā€™s just adding zeroes; itā€™s just another way of saying ā€œ6 then seven 0ā€™sā€ which is probably my preference for number illustration. That said, users arenā€™t all going to know how itā€™s laid out, so I agree itā€™s probably worth changing

also another question

Will this que up the rendered chunks for load on dynmap as they rendered with the generator or will I have to do a full dynmap render again after pre loading the world

The mathematical abbreviation happens on itā€™s own. Itā€™s not something I purposely did. I never changed it, because short hand is better and it takes 5 seconds to Google it.

Yep, word for word.

Is this the case @TrenTech? My server died at 11% inexplicably after hours of chunk loading. Would be interesting to know if this picks up from it, or does the progress all over again. Similarly, if the latter is truly the case, will it then regenerate (and wipe) previously generated chunks?

Because if it does not re-generate, then it means that it is tracking down what chunks are generated, and therefore the process can be stopped, and continued without loosing said progress.

If there is a way to change you should, no matter how fast the google search is to learn it you will get endless ā€œhow do I make my map this sizeā€ post on here. Most like myself will come here to post questions for the dev instead of googling the term. One of the practices of this kind of dev process is helping the dev by providing feedback instead of googling your answer.

Also googling it only takes 5 secs when you google the equation, if you donā€™t know the name of the equation or how its used then trying the same google search in reverse becomes frustrating (IE I know I want X amout of blocks as my world size but donā€™t know the equation needed to get that number)

Just putting a scientific equation as a value in the config file seems not user friendly and not needed when you could have the player say the amount of blocks out right. The shortest distence between two lines as they lines. Now that I know it was unintentional Iā€™m glad I brought it up so it can have attention brought to it and hopefully get changed. The value of feedback :wink:

This is part of the HOCON spec by default. We donā€™t work with configuration files directly, we just use the library, which does this.Simply auto-saving the file causes it to be processed like that. The long form of the number works too.

ahh I didnā€™t know the long form as an entry was an option :slight_smile:

guess the only thing need changing is the description to make that know in game. So people donā€™t get an equation when they where expecting a straight forward number and go ā€œwait whatā€