Update to BentoBox 1.13.0 release.

Changes:
- Use general player and admin command. Adding new commands will require whole addon update.
- Add default-action, new-player-action, block-mobs config options.
- Rename link for max-trusted-size and max-coop-size from island to cave.
This commit is contained in:
BONNe 2020-05-01 23:29:02 +03:00
parent 053c181ecd
commit f2a060afee
8 changed files with 185 additions and 225 deletions

View File

@ -45,8 +45,8 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<!-- More visible way how to change dependency versions -->
<spigot.version>1.15.1-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.13.0-SNAPSHOT</bentobox.version>
<spigot.version>1.15.2-R0.1-SNAPSHOT</spigot.version>
<bentobox.version>1.13.0</bentobox.version>
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. -->

View File

@ -9,11 +9,12 @@ import org.bukkit.generator.ChunkGenerator;
import org.eclipse.jdt.annotation.NonNull;
import world.bentobox.bentobox.api.addons.GameModeAddon;
import world.bentobox.bentobox.api.commands.admin.DefaultAdminCommand;
import world.bentobox.bentobox.api.commands.island.DefaultPlayerCommand;
import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.api.configuration.WorldSettings;
import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.caveblock.commands.AdminCommand;
import world.bentobox.caveblock.commands.IslandCommand;
import world.bentobox.caveblock.commands.IslandAboutCommand;
import world.bentobox.caveblock.generators.ChunkGeneratorWorld;
import world.bentobox.caveblock.listeners.CustomHeightLimitations;
@ -35,9 +36,19 @@ public class CaveBlock extends GameModeAddon
this.chunkGenerator = new ChunkGeneratorWorld(this);
this.playerCommand = new IslandCommand(this);
this.adminCommand = new AdminCommand(this);
// Player Command
this.playerCommand = new DefaultPlayerCommand(this)
{
@Override
public void setup()
{
super.setup();
new IslandAboutCommand(this);
}
};
// Admin command.
this.adminCommand = new DefaultAdminCommand(this) {};
}

View File

@ -811,22 +811,50 @@ public class Settings implements WorldSettings
/**
* This method returns the islandCommand value.
* @return the value of islandCommand.
* {@inheritDoc}
*/
public String getIslandCommand()
@Override
public List<String> getMobLimitSettings()
{
return islandCommand;
return mobLimitSettings;
}
/**
* This method returns the adminCommand value.
* @return the value of adminCommand.
* {@inheritDoc}
*/
public String getAdminCommand()
public String getPlayerCommandAliases()
{
return adminCommand;
return playerCommandAliases;
}
/**
* {@inheritDoc}
*/
public String getAdminCommandAliases()
{
return adminCommandAliases;
}
/**
* {@inheritDoc}
*/
@Override
public String getDefaultPlayerAction()
{
return defaultPlayerAction;
}
/**
* {@inheritDoc}
*/
@Override
public String getDefaultNewPlayerAction()
{
return defaultNewPlayerAction;
}
@ -1601,24 +1629,24 @@ public class Settings implements WorldSettings
/**
* This method sets the islandCommand value.
* @param islandCommand the islandCommand new value.
* This method sets the playerCommandAliases value.
* @param playerCommandAliases the playerCommandAliases new value.
*
*/
public void setIslandCommand(String islandCommand)
public void setPlayerCommandAliases(String playerCommandAliases)
{
this.islandCommand = islandCommand;
this.playerCommandAliases = playerCommandAliases;
}
/**
* This method sets the adminCommand value.
* @param adminCommand the adminCommand new value.
* This method sets the adminCommandAliases value.
* @param adminCommandAliases the adminCommandAliases new value.
*
*/
public void setAdminCommand(String adminCommand)
public void setAdminCommandAliases(String adminCommandAliases)
{
this.adminCommand = adminCommand;
this.adminCommandAliases = adminCommandAliases;
}
/**
@ -1802,6 +1830,36 @@ public class Settings implements WorldSettings
}
/**
* Method Settings#setDefaultPlayerAction sets new value for the defaultPlayerAction of this object.
* @param defaultPlayerAction new value for this object.
*/
public void setDefaultPlayerAction(String defaultPlayerAction)
{
this.defaultPlayerAction = defaultPlayerAction;
}
/**
* Method Settings#setDefaultNewPlayerAction sets new value for the defaultNewPlayerAction of this object.
* @param defaultNewPlayerAction new value for this object.
*/
public void setDefaultNewPlayerAction(String defaultNewPlayerAction)
{
this.defaultNewPlayerAction = defaultNewPlayerAction;
}
/**
* Method Settings#setMobLimitSettings sets new value for the mobLimitSettings of this object.
* @param mobLimitSettings new value for this object.
*/
public void setMobLimitSettings(List<String> mobLimitSettings)
{
this.mobLimitSettings = mobLimitSettings;
}
// ---------------------------------------------------------------------
// Section: Variables
// ---------------------------------------------------------------------
@ -1810,12 +1868,24 @@ public class Settings implements WorldSettings
@ConfigComment("Cave Command. What command users will run to access their cave.")
@ConfigComment("To define alias, just separate commands with white space.")
@ConfigEntry(path = "caveblock.command.cave")
private String islandCommand = "cave cb";
private String playerCommandAliases = "cave cb";
@ConfigComment("The Cave admin command.")
@ConfigComment("To define alias, just separate commands with white space.")
@ConfigEntry(path = "caveblock.command.admin")
private String adminCommand = "cbadmin cba";
private String adminCommandAliases = "cbadmin cba";
@ConfigComment("The default action for new player command call.")
@ConfigComment("Sub-command of main player command that will be run on first player command call.")
@ConfigComment("By default it is sub-command 'create'.")
@ConfigEntry(path = "caveblock.command.new-player-action", since = "1.13.0")
private String defaultNewPlayerAction = "create";
@ConfigComment("The default action for player command.")
@ConfigComment("Sub-command of main player command that will be run on each player command call.")
@ConfigComment("By default it is sub-command 'go'.")
@ConfigEntry(path = "caveblock.command.default-action", since = "1.13.0")
private String defaultPlayerAction = "go";
/* WORLD */
@ConfigComment("Friendly name for this world. Used in admin commands. Must be a single word")
@ -2054,16 +2124,16 @@ public class Settings implements WorldSettings
@ConfigEntry(path = "cave.max-team-size")
private int maxTeamSize = 4;
@ConfigComment("Default maximum number of coop rank members per island")
@ConfigComment("Default maximum number of coop rank members per cave")
@ConfigComment("Players can have the caveblock.coop.maxsize.<number> permission to be bigger but")
@ConfigComment("permission size cannot be less than the default below. ")
@ConfigEntry(path = "island.max-coop-size", since = "1.13.0")
@ConfigEntry(path = "cave.max-coop-size", since = "1.13.0")
private int maxCoopSize = 4;
@ConfigComment("Default maximum number of trusted rank members per island")
@ConfigComment("Default maximum number of trusted rank members per cave")
@ConfigComment("Players can have the caveblock.trust.maxsize.<number> permission to be bigger but")
@ConfigComment("permission size cannot be less than the default below. ")
@ConfigEntry(path = "island.max-trusted-size", since = "1.13.0")
@ConfigEntry(path = "cave.max-trusted-size", since = "1.13.0")
private int maxTrustSize = 4;
@ConfigComment("Default maximum number of homes a player can have. Min = 1")
@ -2245,6 +2315,11 @@ public class Settings implements WorldSettings
@ConfigEntry(path = "protection.geo-limit-settings")
private List<String> geoLimitSettings = new ArrayList<>();
@ConfigComment("CaveBlock blocked mobs.")
@ConfigComment("List of mobs that should not spawn in the CaveBlock.")
@ConfigEntry(path = "protection.block-mobs", since = "1.13.0")
private List<String> mobLimitSettings = new ArrayList<>();
// Invincible visitor settings
@ConfigComment("Invincible visitors. List of damages that will not affect visitors.")
@ConfigComment("Make list blank if visitors should receive all damages")

View File

@ -1,105 +0,0 @@
package world.bentobox.caveblock.commands;
import java.util.List;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.commands.admin.AdminDeleteCommand;
import world.bentobox.bentobox.api.commands.admin.AdminGetrankCommand;
import world.bentobox.bentobox.api.commands.admin.AdminInfoCommand;
import world.bentobox.bentobox.api.commands.admin.AdminRegisterCommand;
import world.bentobox.bentobox.api.commands.admin.AdminReloadCommand;
import world.bentobox.bentobox.api.commands.admin.AdminResetFlagsCommand;
import world.bentobox.bentobox.api.commands.admin.AdminSetrankCommand;
import world.bentobox.bentobox.api.commands.admin.AdminSetspawnCommand;
import world.bentobox.bentobox.api.commands.admin.AdminSettingsCommand;
import world.bentobox.bentobox.api.commands.admin.AdminSwitchCommand;
import world.bentobox.bentobox.api.commands.admin.AdminTeleportCommand;
import world.bentobox.bentobox.api.commands.admin.AdminUnregisterCommand;
import world.bentobox.bentobox.api.commands.admin.AdminVersionCommand;
import world.bentobox.bentobox.api.commands.admin.AdminWhyCommand;
import world.bentobox.bentobox.api.commands.admin.blueprints.AdminBlueprintCommand;
import world.bentobox.bentobox.api.commands.admin.deaths.AdminDeathsCommand;
import world.bentobox.bentobox.api.commands.admin.purge.AdminPurgeCommand;
import world.bentobox.bentobox.api.commands.admin.range.AdminRangeCommand;
import world.bentobox.bentobox.api.commands.admin.resets.AdminResetsResetCommand;
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamAddCommand;
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamDisbandCommand;
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamKickCommand;
import world.bentobox.bentobox.api.commands.admin.team.AdminTeamSetownerCommand;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.caveblock.CaveBlock;
public class AdminCommand extends CompositeCommand {
public AdminCommand(CaveBlock addon) {
super(addon,
addon.getSettings().getAdminCommand().split(" ")[0],
addon.getSettings().getAdminCommand().split(" "));
}
@Override
public void setup() {
setPermission("admin.*");
setOnlyPlayer(false);
setParametersHelp("commands.admin.help.parameters");
setDescription("commands.admin.help.description");
new AdminVersionCommand(this);
new AdminTeleportCommand(this, "tp");
new AdminTeleportCommand(this, "tpnether");
new AdminTeleportCommand(this, "tpend");
new AdminGetrankCommand(this);
new AdminSetrankCommand(this);
new AdminInfoCommand(this);
// Team commands
new AdminTeamAddCommand(this);
new AdminTeamKickCommand(this);
new AdminTeamDisbandCommand(this);
new AdminTeamSetownerCommand(this);
// Schems
new AdminBlueprintCommand(this);
// Register/unregister islands
new AdminRegisterCommand(this);
new AdminUnregisterCommand(this);
// Range
new AdminRangeCommand(this);
// Resets
new AdminResetsResetCommand(this);
// Delete
new AdminDeleteCommand(this);
// Why
new AdminWhyCommand(this);
// Deaths
new AdminDeathsCommand(this);
// Reload
new AdminReloadCommand(this);
// Spawn
new AdminSetspawnCommand(this);
// Reset flags
new AdminResetFlagsCommand(this);
// Trash
//new AdminTrashCommand(this);
//new AdminEmptyTrashCommand(this);
//new AdminSwitchtoCommand(this);
// Switch
new AdminSwitchCommand(this);
// Purge
new AdminPurgeCommand(this);
// Settings
new AdminSettingsCommand(this);
}
@Override
public boolean execute(User user, String label, List<String> args) {
if (!args.isEmpty()) {
user.sendMessage("general.errors.unknown-command", TextVariables.LABEL, getTopLabel());
return false;
}
// By default run the attached help command, if it exists (it should)
return showHelp(this, user);
}
}

View File

@ -24,7 +24,7 @@ public class IslandAboutCommand extends CompositeCommand {
@Override
public boolean execute(User user, String label, List<String> args) {
user.sendRawMessage("About " + getAddon().getDescription().getName() + " " + getAddon().getDescription().getVersion() + ":");
user.sendRawMessage("Copyright (c) 2019 BONNe");
user.sendRawMessage("Copyright (c) 2020 BONNe");
user.sendRawMessage("See https://www.eclipse.org/legal/epl-2.0/");
user.sendRawMessage("for license information.");
return true;

View File

@ -1,75 +0,0 @@
package world.bentobox.caveblock.commands;
import java.util.ArrayList;
import java.util.List;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.commands.island.*;
import world.bentobox.bentobox.api.commands.island.team.IslandTeamCommand;
import world.bentobox.bentobox.api.localization.TextVariables;
import world.bentobox.bentobox.api.user.User;
import world.bentobox.caveblock.CaveBlock;
public class IslandCommand extends CompositeCommand {
public IslandCommand(CaveBlock addon) {
super(addon,
addon.getSettings().getIslandCommand().split(" ")[0],
addon.getSettings().getIslandCommand().split(" "));
}
/* (non-Javadoc)
* @see us.tastybento.bskyblock.api.commands.CompositeCommand#setup()
*/
@Override
public void setup() {
setDescription("commands.island.help.description");
setOnlyPlayer(true);
// Permission
setPermission("island");
// Set up subcommands
new IslandAboutCommand(this);
new IslandInfoCommand(this);
new IslandCreateCommand(this);
new IslandGoCommand(this);
new IslandSpawnCommand(this);
new IslandResetCommand(this);
new IslandSetnameCommand(this);
new IslandResetnameCommand(this);
new IslandSethomeCommand(this);
new IslandSettingsCommand(this);
new IslandLanguageCommand(this);
new IslandBanCommand(this);
new IslandUnbanCommand(this);
new IslandBanlistCommand(this);
new IslandNearCommand(this);
// Expel command
new IslandExpelCommand(this);
// Team commands
new IslandTeamCommand(this);
}
/* (non-Javadoc)
* @see us.tastybento.bskyblock.api.commands.CommandArgument#execute(org.bukkit.command.CommandSender, java.lang.String[])
*/
@Override
public boolean execute(User user, String label, List<String> args) {
if (user == null) {
return false;
}
if (args.isEmpty()) {
// If user has an island, go
if (getPlugin().getIslands().getIsland(getWorld(), user.getUniqueId()) != null) {
return getSubCommand("go").map(goCmd -> goCmd.call(user, goCmd.getLabel(), new ArrayList<>())).orElse(false);
}
// No islands currently
return getSubCommand("create").map(createCmd -> createCmd.call(user, createCmd.getLabel(), new ArrayList<>())).orElse(false);
}
user.sendMessage("general.errors.unknown-command", TextVariables.LABEL, getTopLabel());
return false;
}
}

View File

@ -1,6 +1,7 @@
name: CaveBlock
main: world.bentobox.caveblock.CaveBlock
version: ${version}${build.number}
api-version: 1.13.0
metrics: true
repository: "BentoBoxWorld/CaveBlock"
icon: "STONE_PICKAXE"
@ -17,6 +18,9 @@ permissions:
caveblock.island.home:
description: Allow teleporting to player cave
default: true
caveblock.island.sethome:
description: Let the player use the sethome command
default: true
caveblock.island.info:
description: Let the player check other players info
default: true
@ -48,7 +52,25 @@ permissions:
description: Player can use the cave reset or restart command
default: true
caveblock.island.team:
description: Let a player use team commands
description: Let a player use team command
default: true
caveblock.island.team.setowner:
description: Let a player change the team owner
default: true
caveblock.island.team.invite:
description: Let a player invite others
default: true
caveblock.island.team.reject:
description: Let a player reject invites
default: true
caveblock.island.team.leave:
description: Let a player leave the team
default: true
caveblock.island.team.kick:
description: Let a player kick team members
default: true
caveblock.island.team.accept:
description: Let a player accept invitations
default: true
caveblock.island.team.trust:
description: Let a player use team trust commands
@ -116,6 +138,9 @@ permissions:
caveblock.admin.setspawn:
description: Allows use of spawn tools
default: op
caveblock.admin.setspawnpoint:
description: Allows to set spawn point of cave
default: op
caveblock.admin.setrange:
description: Allows setting of cave protection range
default: op
@ -131,3 +156,9 @@ permissions:
caveblock.admin.setlanguage:
description: Resets all player languages and sets the default language
default: op
caveblock.admin.getrank:
description: Get a player's rank
default: op
caveblock.admin.setrank:
description: Set a player's rank
default: op

View File

@ -1,4 +1,4 @@
# CaveBlock Configuration ${version}
# CaveBlock Configuration 1.13.0
caveblock:
command:
# Cave Command. What command users will run to access their cave.
@ -7,6 +7,16 @@ caveblock:
# The Cave admin command.
# To define alias, just separate commands with white space.
admin: cbadmin cba
# The default action for new player command call.
# Sub-command of main player command that will be run on first player command call.
# By default it is sub-command 'create'.
# Added since 1.13.0.
new-player-action: create
# The default action for player command.
# Sub-command of main player command that will be run on each player command call.
# By default it is sub-command 'go'.
# Added since 1.13.0.
default-action: go
world:
# Friendly name for this world. Used in admin commands. Must be a single word
friendly-name: CaveBlock
@ -57,7 +67,7 @@ world:
# -1 = unlimited
ban-limit: -1
#
# This is cave... no height... only depth. Max 256.
# This is cave.. no height... only depth. Max 256.
# Should not be less then cave height.
# /!\ BentoBox currently does not support changing this value mid-game. If you do need to change it, do a full reset of your databases and worlds.
world-depth: 256
@ -176,10 +186,10 @@ world:
- MATERIAL:CHORUS_PLANT:1:3
# Mob white list - these mobs will NOT be removed when logging in or doing /cave
remove-mobs-whitelist:
- ZOMBIE_VILLAGER
- WITHER
- ENDERMAN
- PIG_ZOMBIE
- ZOMBIE_VILLAGER
# World flags. These are boolean settings for various flags for this world
flags:
CREEPER_DAMAGE: true
@ -191,6 +201,7 @@ world:
CLEAN_SUPER_FLAT: false
CHEST_DAMAGE: false
PREVENT_TELEPORT_WHEN_FALLING: false
NATURAL_SPAWNING_OUTSIDE_RANGE: true
ENTER_EXIT_MESSAGES: true
ENDERMAN_DEATH_DROP: true
OFFLINE_REDSTONE: true
@ -198,8 +209,14 @@ world:
ENDER_CHEST: false
ITEM_FRAME_DAMAGE: false
# These are the default protection settings for new caves.
# The value is the minimum cave rank required allowed to do the action
# Ranks are: Visitor = 0, Member = 900, Owner = 1000
# The value is the minimum cave rank required allowed to do the action.
# Ranks are the following:
# VISITOR = 0
# COOP = 200
# TRUSTED = 400
# MEMBER = 500
# SUB-OWNER = 900
# OWNER = 1000
default-cave-flags:
HURT_ANIMALS: 500
REDSTONE: 500
@ -213,21 +230,21 @@ world:
END_PORTAL: 500
BREEDING: 500
HURT_VILLAGERS: 500
FROST_WALKER: 500
TURTLE_EGGS: 500
FROST_WALKER: 500
COLLECT_LAVA: 500
LEVER: 500
RIDING: 500
HURT_MONSTERS: 0
NAME_TAG: 500
ARMOR_STAND: 500
NAME_TAG: 500
TRADING: 0
EGGS: 500
ITEM_DROP: 0
NOTE_BLOCK: 0
NETHER_PORTAL: 500
ITEM_PICKUP: 0
CROP_TRAMPLE: 500
ITEM_PICKUP: 0
DROPPER: 500
BREWING: 500
COLLECT_WATER: 500
@ -239,10 +256,10 @@ world:
PLACE_BLOCKS: 500
ITEM_FRAME: 500
CRAFTING: 0
ENCHANTING: 0
SHEARING: 500
SPAWN_EGGS: 500
ENCHANTING: 0
BED: 500
SPAWN_EGGS: 500
MILKING: 0
DISPENSER: 500
GATE: 0
@ -279,12 +296,12 @@ cave:
# Default max team size
# Permission size cannot be less than the default below.
max-team-size: 4
# Default maximum number of coop rank members per island
# Default maximum number of coop rank members per cave
# Players can have the caveblock.coop.maxsize.<number> permission to be bigger but
# permission size cannot be less than the default below.
# Added since 1.13.0.
max-coop-size: 4
# Default maximum number of trusted rank members per island
# Default maximum number of trusted rank members per cave
# Players can have the caveblock.trust.maxsize.<number> permission to be bigger but
# permission size cannot be less than the default below.
# Added since 1.13.0.
@ -307,7 +324,7 @@ cave:
# Overrides the on-leave inventory reset for kicked players.
kicked-keep-inventory: false
on-join:
# What the addon should reset when the player joins or creates a cave
# What the plugin should reset when the player joins or creates a cave
# Reset Money - if this is true, will reset the player's money to the starting money
# Recommendation is that this is set to true, but if you run multi-worlds
# make sure your economy handles multi-worlds too.
@ -345,7 +362,7 @@ cave:
create-cave-on-first-login:
# Toggles the automatic cave 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
# * Upon connecting to your server for the first time, the player will be told that
# a cave 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 cave.
@ -376,16 +393,18 @@ cave:
abort-on-logout: true
# Toggles whether the player should be teleported automatically to his cave when it is created.
# If set to false, the player will be told his cave is ready but will have to teleport to his cave using the command.
# Added since 1.10.0.
teleport-player-to-cave-when-created: true
# Create Nether or End cave if they are missing when a player goes through a portal.
# Nether and End cave are usually pasted when a player makes their cave, but if they are
# missing for some reason, you can switch this on.
# Note that bedrock removal glitches can exploit this option.
# Added since 1.10.0.
create-missing-nether-end-caves: false
commands:
# List of commands to run when a player joins.
on-join: []
# List of commands to run when a player leaves.
# list of commands to run when a player leaves.
on-leave: []
sethome:
nether:
@ -410,6 +429,10 @@ protection:
- GHAST
- BAT
- BLAZE
# CaveBlock blocked mobs.
# List of mobs that should not spawn in the CaveBlock.
# Added since 1.13.0.
block-mobs: []
# Invincible visitors. List of damages that will not affect visitors.
# Make list blank if visitors should receive all damages
invincible-visitors: