Skip to content

Commit

Permalink
Cleanup documentation (#70)
Browse files Browse the repository at this point in the history
* Remove commented code

* Purify config.yml

As I see, this is just another place to duplicate our settings, documentation and changes to these.
This file is generated if missing.

* Cleanup Settings.java

This is another place where we duplicated documentation.

* Purify README.md

* Fix failing test: testIsUseWbapi

* Revert "Cleanup Settings.java"

This reverts commit f8e931c.

* Format Settings.java and add documentation link

* Regenerate config.yml
  • Loading branch information
arphox committed Dec 7, 2021
1 parent 9ded7cc commit 34dc0ce
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 103 deletions.
87 changes: 2 additions & 85 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,92 +4,9 @@
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_Border&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_Border)
[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=BentoBoxWorld_Border&metric=security_rating)](https://sonarcloud.io/dashboard?id=BentoBoxWorld_Border)

**Border** shows a world border around islands. The world border is the Minecraft world border and players cannot go outside of it or a barrier block border that can show up when required.
**Border** can create and show a border around islands which players cannot pass.

##Features##

* Minecraft vanilla world border (requires WorldBorderAPI plugin - see below)
* Alternative barrier blocks border - can block transit or just show where the border is using particles.
* Option to show maximum border - uses 🚫 particle.

## Installation
1. Put this jar into the BentoBox addons folder
2. Restart

## Configuration

The config.yml file contains a number of options.

### Disabled GameModes
By default, Border will operate in all game mode worlds on the BentoBox server. To disable a game mode it is necessary to write its name on new line that starts with -. Example:
```
disabled-gamemodes:
- BSkyBlock
```

### Use WorldBorderAPI (WBAPI)
If you want to use the vanilla world border then you must download the WorldBorderAPI plugin. You can find them here: https://github.com/yannicklamprecht/WorldBorderAPI/releases

Players cannot exit past the vanilla world border, so it will completely block movement outside of a player's protected island area. If you do not want this, then do not use WBAPI.

To activate WBAPI, set this to true in the config.yml:

```
use-wbapi: true
```

### Use barrier blocks.
Only applies if WBAPI isn't used.

If true, the the border will use barrier blocks to prevent most players from exiting the border. If players do manage to exit it, they will get teleported back inside it.

If false, the border is indicated by particles only.

The default is to use barrier blocks.

```
use-barrier-blocks: true
```

### Default border behavior
Players can turn the border on and off if they have the right permission using the border command. This setting makes the default on or off:

```
show-by-default: true
```

### Show max-protection range border.

Only applies if WBAPI isn't used.

This is a visual border only and not a barrier. It displays the 🚫 particle. This is useful for game modes like Boxed where the player's protection area can move around.

```
show-max-border: true
```

### Show particles
Only applies if WBAPI isn't used.

Enables/disables all types of wall particles shown by the addon.

```
show-particles: true
```

## Commands

### border
**Command**: `/[player command] border`
**Description**: Turns the border on/off.
**Permission**: `[gamemode].border.toggle`. Default: `op`.
**Notes**: Since Version 3.0.0 it requires a permission.

### border type {...}
**Command**: `/[player command] border type {barrier | vanilla}`
**Description**: Sets the border type.
**Permission**: `[gamemode].border.set-type`. Default: `true`.
**Example**: `/[player command] border type barrier`
**See the full documentation [here](https://docs.bentobox.world/en/latest/addons/Border/).**

## Like this addon?
[Sponsor tastybento](https://github.com/sponsors/tastybento) to get more addons like this and make this one better!
Expand Down
15 changes: 7 additions & 8 deletions src/main/java/world/bentobox/border/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
@StoreAt(filename = "config.yml", path = "addons/Border")
public class Settings implements ConfigObject {

@ConfigComment("Border Configuration file by tastybento")
@ConfigComment("Border addon configuration file")
@ConfigComment("See the documentation at https://docs.bentobox.world/en/latest/addons/Border/")
@ConfigComment("")
@ConfigComment("This list stores GameModes in which Border addon should not work.")
@ConfigComment("To disable addon it is necessary to write its name in new line that starts with -. Example:")
Expand All @@ -24,7 +25,7 @@ public class Settings implements ConfigObject {
@ConfigComment("Use vanilla world border. Requires WorldBorderAPI plugin.")
@ConfigComment("Download from https://github.com/yannicklamprecht/WorldBorderAPI/releases")
@ConfigEntry(path = "use-wbapi")
private boolean useWbapi = false;
private boolean useWbapi = true;

@ConfigComment("")
@ConfigComment("Teleport players back inside the border if they somehow get outside.")
Expand All @@ -41,13 +42,13 @@ public class Settings implements ConfigObject {
@ConfigComment("")
@ConfigComment("Default border behavior")
@ConfigEntry(path = "show-by-default")
private boolean showByDefault= true;
private boolean showByDefault = true;

@ConfigComment("")
@ConfigComment("Only applies if WBAPI isn't used.")
@ConfigComment("Show max-protection range border. This is a visual border only and not a barrier.")
@ConfigEntry(path = "show-max-border")
private boolean showMaxBorder= true;
private boolean showMaxBorder = true;

@ConfigComment("")
@ConfigComment("Only applies if WBAPI isn't used.")
Expand All @@ -58,16 +59,14 @@ public class Settings implements ConfigObject {
/**
* @param disabledGameModes new disabledGameModes value.
*/
public void setDisabledGameModes(Set<String> disabledGameModes)
{
public void setDisabledGameModes(Set<String> disabledGameModes) {
this.disabledGameModes = disabledGameModes;
}

/**
* @return disabledGameModes value.
*/
public Set<String> getDisabledGameModes()
{
public Set<String> getDisabledGameModes() {
return this.disabledGameModes;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public void setup() {
this.setPermission("border.set-type");
this.setDescription("border.set-type.description");
this.setOnlyPlayer(true);
// setConfigurableRankCommand(); // What is this? Should I use this? I guess not.
}

@Override
Expand Down
21 changes: 13 additions & 8 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
#
# Border addon configuration file
# See the documentation at https://docs.bentobox.world/en/latest/addons/Border/
#
# This list stores GameModes in which Border addon should not work.
# To disable addon it is necessary to write its name in new line that starts with -. Example:
# disabled-gamemodes:
# - BSkyBlock
disabled-gamemodes: []
#
#
# Use vanilla world border. Requires WorldBorderAPI plugin.
# Download from https://github.com/yannicklamprecht/WorldBorderAPI/releases
use-wbapi: true
#
# Teleport players back inside the border if they somehow get outside.
# This will teleport players back inside if they toggle the border with a command.
return-teleport: true
#
#
# Only applies if WBAPI isn't used.
# Use barrier blocks. If false, the border is indicated by particles only.
# Only applicable if vanilla world border is not used
use-barrier-blocks: false
#
use-barrier-blocks: true
#
# Default border behavior
show-by-default: true
#
#
# Only applies if WBAPI isn't used.
# Show max-protection range border. This is a visual border only and not a barrier.
show-max-border: true
# Show particles. If WABI isn't used, then enable/disable the particles
#
# Only applies if WBAPI isn't used.
# Enables/disables all types of wall particles shown by the addon
show-particles: true
2 changes: 1 addition & 1 deletion src/test/java/world/bentobox/border/SettingsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void testSetShowMaxBorder() {
*/
@Test
public void testIsUseWbapi() {
assertFalse(settings.isUseWbapi());
assertTrue(settings.isUseWbapi());
}

/**
Expand Down

0 comments on commit 34dc0ce

Please sign in to comment.