Merge branch 'develop'

This commit is contained in:
tastybento 2019-02-20 21:48:15 -08:00
commit 12d5b26536
10 changed files with 90 additions and 83 deletions

View File

@ -6,7 +6,7 @@
<groupId>world.bentobox</groupId>
<artifactId>bskyblock</artifactId>
<version>1.2.0</version>
<version>1.3.0-SNAPSHOT</version>
<name>BSkyBlock</name>
<description>BSkyBlock is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland.</description>
@ -91,7 +91,7 @@
<dependency>
<groupId>world.bentobox</groupId>
<artifactId>bentobox</artifactId>
<version>1.2.0</version>
<version>1.3.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@ -42,6 +42,7 @@ public class BSkyBlock extends GameModeAddon {
logError("BSkyBlock settings could not load! Addon disabled.");
setState(State.DISABLED);
}
new Config<>(this, Settings.class).saveConfigObject(settings);
}
@Override
@ -53,10 +54,6 @@ public class BSkyBlock extends GameModeAddon {
@Override
public void onDisable() {
// Save settings
if (settings != null) {
new Config<>(this, Settings.class).saveConfigObject(settings);
}
}
@Override

View File

@ -28,11 +28,19 @@ import world.bentobox.bentobox.database.objects.adapters.FlagSerializer2;
*/
@StoreAt(filename="config.yml", path="addons/BSkyBlock") // Explicitly call out what name this should have.
@ConfigComment("BSkyBlock Configuration [version]")
@ConfigComment("This config file is dynamic and saved when the server is shutdown.")
@ConfigComment("You cannot edit it while the server is running because changes will")
@ConfigComment("be lost! Use in-game settings GUI or edit when server is offline.")
public class Settings implements DataObject, WorldSettings {
/* Commands */
@ConfigComment("Island Command. What command users will run to access their island.")
@ConfigComment("To define alias, just separate commands with white space.")
@ConfigEntry(path = "bskyblock.command.island")
private String islandCommand = "island is";
@ConfigComment("The island admin command.")
@ConfigComment("To define alias, just separate commands with white space.")
@ConfigEntry(path = "bskyblock.command.admin")
private String adminCommand = "bsbadmin bsb";
/* WORLD */
@ConfigComment("Friendly name for this world. Used in admin commands. Must be a single word")
@ConfigEntry(path = "world.friendly-name")
@ -203,9 +211,6 @@ public class Settings implements DataObject, WorldSettings {
@ConfigEntry(path = "island.reset.reset-limit")
private int resetLimit = -1;
@ConfigEntry(path = "island.require-confirmation.reset")
private boolean resetConfirmation = true;
@ConfigComment("Kicked or leaving players lose resets")
@ConfigComment("Players who leave a team will lose an island reset chance")
@ConfigComment("If a player has zero resets left and leaves a team, they cannot make a new")
@ -254,10 +259,6 @@ public class Settings implements DataObject, WorldSettings {
@ConfigEntry(path = "island.reset.on-leave.ender-chest")
private boolean onLeaveResetEnderChest = false;
@ConfigComment("Have player's respawn on their island if they die")
@ConfigEntry(path = "island.respawn-on-island")
private boolean respawnOnIsland = true;
// Sethome
@ConfigEntry(path = "island.sethome.nether.allow")
private boolean allowSetHomeInNether = true;
@ -301,12 +302,6 @@ public class Settings implements DataObject, WorldSettings {
@ConfigEntry(path = "protection.invincible-visitors")
private List<String> ivSettings = new ArrayList<>();
//---------------------------------------------------------------------------------------/
@ConfigComment("Whether GUIs should be closed when the player clicks outside.")
@ConfigEntry(path = "panel.close-on-click-outside")
private boolean closePanelOnClickOutside = true;
//---------------------------------------------------------------------------------------/
@ConfigComment("These settings should not be edited")
@ConfigEntry(path = "do-not-edit-these-settings.reset-epoch")
@ -561,13 +556,6 @@ public class Settings implements DataObject, WorldSettings {
return resetLimit;
}
/**
* @return the resetConfirmation
*/
public boolean isResetConfirmation() {
return resetConfirmation;
}
/**
* @return the leaversLoseReset
*/
@ -630,13 +618,6 @@ public class Settings implements DataObject, WorldSettings {
return onLeaveResetEnderChest;
}
/**
* @return the respawnOnIsland
*/
public boolean isRespawnOnIsland() {
return respawnOnIsland;
}
/**
* @return the isDeathsCounted
*/
@ -716,13 +697,6 @@ public class Settings implements DataObject, WorldSettings {
return ivSettings;
}
/**
* @return the closePanelOnClickOutside
*/
public boolean isClosePanelOnClickOutside() {
return closePanelOnClickOutside;
}
/**
* @return the resetEpoch
*/
@ -957,13 +931,6 @@ public class Settings implements DataObject, WorldSettings {
this.resetLimit = resetLimit;
}
/**
* @param resetConfirmation the resetConfirmation to set
*/
public void setResetConfirmation(boolean resetConfirmation) {
this.resetConfirmation = resetConfirmation;
}
/**
* @param leaversLoseReset the leaversLoseReset to set
*/
@ -1020,13 +987,6 @@ public class Settings implements DataObject, WorldSettings {
this.onLeaveResetEnderChest = onLeaveResetEnderChest;
}
/**
* @param respawnOnIsland the respawnOnIsland to set
*/
public void setRespawnOnIsland(boolean respawnOnIsland) {
this.respawnOnIsland = respawnOnIsland;
}
/**
* @param deathsCounted the deathsCounted to set
*/
@ -1069,13 +1029,6 @@ public class Settings implements DataObject, WorldSettings {
this.ivSettings = ivSettings;
}
/**
* @param closePanelOnClickOutside the closePanelOnClickOutside to set
*/
public void setClosePanelOnClickOutside(boolean closePanelOnClickOutside) {
this.closePanelOnClickOutside = closePanelOnClickOutside;
}
/**
* @param allowSetHomeInNether the allowSetHomeInNether to set
*/
@ -1158,4 +1111,46 @@ public class Settings implements DataObject, WorldSettings {
public void setBanLimit(int banLimit) {
this.banLimit = banLimit;
}
/**
* This method returns the islandCommand value.
* @return the value of islandCommand.
*/
public String getIslandCommand()
{
return islandCommand;
}
/**
* This method sets the islandCommand value.
* @param islandCommand the islandCommand new value.
*
*/
public void setIslandCommand(String islandCommand)
{
this.islandCommand = islandCommand;
}
/**
* This method returns the adminCommand value.
* @return the value of adminCommand.
*/
public String getAdminCommand()
{
return adminCommand;
}
/**
* This method sets the adminCommand value.
* @param adminCommand the adminCommand new value.
*
*/
public void setAdminCommand(String adminCommand)
{
this.adminCommand = adminCommand;
}
}

View File

@ -4,13 +4,17 @@ 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.AdminEmptyTrashCommand;
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.AdminSwitchtoCommand;
import world.bentobox.bentobox.api.commands.admin.AdminTeleportCommand;
import world.bentobox.bentobox.api.commands.admin.AdminTrashCommand;
import world.bentobox.bentobox.api.commands.admin.AdminUnregisterCommand;
import world.bentobox.bentobox.api.commands.admin.AdminVersionCommand;
import world.bentobox.bentobox.api.commands.admin.AdminWhyCommand;
@ -29,7 +33,9 @@ import world.bentobox.bskyblock.BSkyBlock;
public class AdminCommand extends CompositeCommand {
public AdminCommand(BSkyBlock addon) {
super(addon, "bsbadmin", "bsb");
super(addon,
addon.getSettings().getAdminCommand().split(" ")[0],
addon.getSettings().getAdminCommand().split(" "));
}
@Override
@ -70,6 +76,12 @@ public class AdminCommand extends CompositeCommand {
new AdminReloadCommand(this);
// Spawn
new AdminSetspawnCommand(this);
// Reset flags
new AdminResetFlagsCommand(this);
// Trash
new AdminTrashCommand(this);
new AdminEmptyTrashCommand(this);
new AdminSwitchtoCommand(this);
}
@Override

View File

@ -23,7 +23,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) 2017 - 2018 tastybento, Poslovitch");
user.sendRawMessage("Copyright (c) 2017 - 2019 tastybento, Poslovitch");
user.sendRawMessage("See https://www.eclipse.org/legal/epl-2.0/");
user.sendRawMessage("for license information.");
return true;

View File

@ -25,7 +25,9 @@ import world.bentobox.bskyblock.BSkyBlock;
public class IslandCommand extends CompositeCommand {
public IslandCommand(BSkyBlock addon) {
super(addon, "island", "is");
super(addon,
addon.getSettings().getIslandCommand().split(" ")[0],
addon.getSettings().getIslandCommand().split(" "));
}
/* (non-Javadoc)

View File

@ -43,7 +43,7 @@ public class ChunkGeneratorWorld extends ChunkGenerator {
if (world.getEnvironment().equals(Environment.NORMAL)) {
biomeGrid.setBiome(x, z, addon.getSettings().getDefaultBiome());
}
for (int y = 0; y < addon.getSettings().getSeaHeight(); y++) {
for (int y = 0; y <= addon.getSettings().getSeaHeight(); y++) {
result.setBlock(x, y, z, Material.WATER);
}

View File

@ -19,7 +19,7 @@ permissions:
description: Let the player use the sethome command
default: true
bskyblock.island.info:
description: Let the player check their island level
description: Let the player check other players info
default: true
bskyblock.island.lock:
description: Allows island locking
@ -54,6 +54,9 @@ permissions:
bskyblock.island.team.coop:
description: Let a player use team coop commands
default: true
bskyblock.island.team.promote:
description: Let a player use promote commands
default: true
bskyblock.settings.*:
description: Allow use of settings on island
default: true
@ -66,9 +69,6 @@ permissions:
bskyblock.mod.clearreset:
description: Allow clearing of island reset limit
default: false
bskyblock.mod.tp:
description: Allows teleport to an island
default: op
bskyblock.mod.bypasscooldowns:
description: Allow moderator to bypass cooldowns
default: op
@ -93,6 +93,9 @@ permissions:
bskyblock.mod.resetname:
description: Enables reset of player's island names
default: false
bskyblock.admin.tp:
description: Allows teleport to an island
default: op
bskyblock.admin.clearresetall:
description: Allow clearing of island reset limit of all players
default: op

View File

@ -1,7 +1,12 @@
# BSkyBlock Configuration 1.1
# This config file is dynamic and saved when the server is shutdown.
# You cannot edit it while the server is running because changes will
# be lost! Use in-game settings GUI or edit when server is offline.
# BSkyBlock Configuration ${version}
bskyblock:
command:
# Island Command. What command users will run to access their island.
# To define alias, just separate commands with white space.
island: island is
# The island admin command.
# To define alias, just separate commands with white space.
admin: bsbadmin bsb
world:
# Friendly name for this world. Used in admin commands. Must be a single word
friendly-name: BSkyBlock
@ -223,10 +228,6 @@ island:
inventory: false
# Reset Ender Chest - if true, the player's Ender Chest will be cleared.
ender-chest: false
require-confirmation:
reset: true
# Have player's respawn on their island if they die
respawn-on-island: false
sethome:
nether:
allow: true
@ -276,9 +277,6 @@ protection:
- HOT_FLOOR
- CRAMMING
- VOID
panel:
# Whether GUIs should be closed when the player clicks outside.
close-on-click-outside: true
do-not-edit-these-settings:
# These settings should not be edited
reset-epoch: 0