Update to latest BentoBox 1.9-SNAPSHOT API changes. (#70)

- Add fallingBannedCommands
- Add createIslandOnFirstLoginEnabled
- Add createIslandOnFirstLoginDelay
- Add createIslandOnFirstLoginAbortOnLogout
This commit is contained in:
BONNe 2019-11-09 20:30:52 +02:00 committed by tastybento
parent 2d93aa2f5a
commit 8b7f43a673
3 changed files with 158 additions and 2 deletions

View File

@ -59,13 +59,13 @@
<powermock.version>2.0.2</powermock.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.14.4-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.8.0</bentobox.version>
<bentobox.version>1.9.0-SNAPSHOT</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.8.0</build.version>
<build.version>1.9.0</build.version>
</properties>
<!-- Profiles will allow to automatically change build version. -->

View File

@ -257,6 +257,11 @@ public class AISettings implements WorldSettings {
@ConfigEntry(path = "world.visitor-banned-commands")
private List<String> visitorBannedCommands = new ArrayList<>();
@ConfigComment("Falling banned commands - players cannot use these commands when falling")
@ConfigComment("if the PREVENT_TELEPORT_WHEN_FALLING world setting flag is active")
@ConfigEntry(path = "world.falling-banned-commands")
private List<String> fallingBannedCommands = new ArrayList<>();
// ---------------------------------------------
/* ISLAND */
@ -360,6 +365,43 @@ public class AISettings implements WorldSettings {
@ConfigEntry(path = "island.reset.on-leave.ender-chest")
private boolean onLeaveResetEnderChest = false;
@ConfigComment("Toggles the automatic island creation upon the player's first login on your server.")
@ConfigComment("If set to true,")
@ConfigComment(" * Upon connecting to your server for the first time, the player will be told that")
@ConfigComment(" an island will be created for him.")
@ConfigComment(" * Make sure you have a Blueprint Bundle called \"default\": this is the one that will")
@ConfigComment(" be used to create the island.")
@ConfigComment(" * An island will be created for the player without needing him to run the create command.")
@ConfigComment("If set to false, this will disable this feature entirely.")
@ConfigComment("Warning:")
@ConfigComment(" * If you are running multiple gamemodes on your server, and all of them have")
@ConfigComment(" this feature enabled, an island in all the gamemodes will be created simultaneously.")
@ConfigComment(" However, it is impossible to know on which island the player will be teleported to afterwards.")
@ConfigComment(" * Island creation can be resource-intensive, please consider the options below to help mitigate")
@ConfigComment(" the potential issues, especially if you expect a lot of players to connect to your server")
@ConfigComment(" in a limited period of time.")
@ConfigEntry(path = "island.create-island-on-first-login.enable")
private boolean createIslandOnFirstLoginEnabled;
@ConfigComment("Time in seconds after the player logged in, before his island gets created.")
@ConfigComment("If set to 0 or less, the island will be created directly upon the player's login.")
@ConfigComment("It is recommended to keep this value under a minute's time.")
@ConfigEntry(path = "island.create-island-on-first-login.delay")
private int createIslandOnFirstLoginDelay = 5;
@ConfigComment("Toggles whether the island creation should be aborted if the player logged off while the")
@ConfigComment("delay (see the option above) has not worn off yet.")
@ConfigComment("If set to true,")
@ConfigComment(" * If the player has logged off the server while the delay (see the option above) has not")
@ConfigComment(" worn off yet, this will cancel the island creation.")
@ConfigComment(" * If the player relogs afterward, since he will not be recognized as a new player, no island")
@ConfigComment(" would be created for him.")
@ConfigComment(" * If the island creation started before the player logged off, it will continue.")
@ConfigComment("If set to false, the player's island will be created even if he went offline in the meantime.")
@ConfigComment("Note this option has no effect if the delay (see the option above) is set to 0 or less.")
@ConfigEntry(path = "island.create-island-on-first-login.abort-on-logout")
private boolean createIslandOnFirstLoginAbortOnLogout = true;
// Commands
@ConfigComment("List of commands to run when a player joins.")
@ConfigEntry(path = "island.commands.on-join")
@ -691,6 +733,15 @@ public class AISettings implements WorldSettings {
public List<String> getVisitorBannedCommands() {
return visitorBannedCommands;
}
/**
* @return the fallingBannedCommands
*/
@Override
public List<String> getFallingBannedCommands() {
return fallingBannedCommands;
}
/**
* @return the worldFlags
*/
@ -777,6 +828,44 @@ public class AISettings implements WorldSettings {
public boolean isKickedKeepInventory() {
return kickedKeepInventory;
}
/**
* This method returns the createIslandOnFirstLoginEnabled boolean value.
* @return the createIslandOnFirstLoginEnabled value
* @since 1.9.0
*/
@Override
public boolean isCreateIslandOnFirstLoginEnabled()
{
return createIslandOnFirstLoginEnabled;
}
/**
* This method returns the createIslandOnFirstLoginDelay int value.
* @return the createIslandOnFirstLoginDelay value
* @since 1.9.0
*/
@Override
public int getCreateIslandOnFirstLoginDelay()
{
return createIslandOnFirstLoginDelay;
}
/**
* This method returns the createIslandOnFirstLoginAbortOnLogout boolean value.
* @return the createIslandOnFirstLoginAbortOnLogout value
* @since 1.9.0
*/
@Override
public boolean isCreateIslandOnFirstLoginAbortOnLogout()
{
return createIslandOnFirstLoginAbortOnLogout;
}
/**
* @return the leaversLoseReset
*/
@ -1280,6 +1369,13 @@ public class AISettings implements WorldSettings {
this.visitorBannedCommands = visitorBannedCommands;
}
/**
* @param fallingBannedCommands the fallingBannedCommands to set
*/
public void setFallingBannedCommands(List<String> fallingBannedCommands) {
this.fallingBannedCommands = fallingBannedCommands;
}
/**
* @param worldFlags the worldFlags to set
*/
@ -1423,4 +1519,27 @@ public class AISettings implements WorldSettings {
this.onLeaveResetXP = onLeaveResetXP;
}
/**
* @param createIslandOnFirstLoginEnabled the createIslandOnFirstLoginEnabled to set
*/
public void setCreateIslandOnFirstLoginEnabled(boolean createIslandOnFirstLoginEnabled)
{
this.createIslandOnFirstLoginEnabled = createIslandOnFirstLoginEnabled;
}
/**
* @param createIslandOnFirstLoginDelay the createIslandOnFirstLoginDelay to set
*/
public void setCreateIslandOnFirstLoginDelay(int createIslandOnFirstLoginDelay)
{
this.createIslandOnFirstLoginDelay = createIslandOnFirstLoginDelay;
}
/**
* @param createIslandOnFirstLoginAbortOnLogout the createIslandOnFirstLoginAbortOnLogout to set
*/
public void setCreateIslandOnFirstLoginAbortOnLogout(boolean createIslandOnFirstLoginAbortOnLogout)
{
this.createIslandOnFirstLoginAbortOnLogout = createIslandOnFirstLoginAbortOnLogout;
}
}

View File

@ -214,6 +214,11 @@ world:
visitor-banned-commands:
- spawner
- spawnmob
# Falling banned commands - players cannot use these commands when falling
# if the PREVENT_TELEPORT_WHEN_FALLING world setting flag is active
falling-banned-commands:
- warp
- spawn
island:
# Default max team size
# Use this permission to set for specific user groups: acidisland.team.maxsize.<number>
@ -281,6 +286,38 @@ island:
exp: false
# Reset Ender Chest - if true, the player's Ender Chest will be cleared.
ender-chest: false
create-island-on-first-login:
# Toggles the automatic island creation upon the player's first login on your server.
# If set to true,
# * Upon connecting to your server for the first time, the player will be told that
# an island will be created for him.
# * Make sure you have a Blueprint Bundle called "default": this is the one that will
# be used to create the island.
# * An island will be created for the player without needing him to run the create command.
# If set to false, this will disable this feature entirely.
# Warning:
# * If you are running multiple gamemodes on your server, and all of them have
# this feature enabled, an island in all the gamemodes will be created simultaneously.
# However, it is impossible to know on which island the player will be teleported to afterwards.
# * Island creation can be resource-intensive, please consider the options below to help mitigate
# the potential issues, especially if you expect a lot of players to connect to your server
# in a limited period of time.
enable: false
# Time in seconds after the player logged in, before his island gets created.
# If set to 0 or less, the island will be created directly upon the player's login.
# It is recommended to keep this value under a minute's time.
delay: 5
# Toggles whether the island creation should be aborted if the player logged off while the
# delay (see the option above) has not worn off yet.
# If set to true,
# * If the player has logged off the server while the delay (see the option above) has not
# worn off yet, this will cancel the island creation.
# * If the player relogs afterward, since he will not be recognized as a new player, no island
# would be created for him.
# * If the island creation started before the player logged off, it will continue.
# If set to false, the player's island will be created even if he went offline in the meantime.
# Note this option has no effect if the delay (see the option above) is set to 0 or less.
abort-on-logout: true
commands:
# List of commands to run when a player joins.
on-join: []