diff --git a/config.yml b/config.yml index 5dd572810..d9b431943 100644 --- a/config.yml +++ b/config.yml @@ -268,7 +268,7 @@ island: # Accessed via sethome or go # Use this permission to set for specific user groups: askyblock.island.maxhomes. max-homes: 1 - + # Island naming # Only players with the TODO can name their island # It is displayed in the top ten and enter and exit announcements @@ -399,6 +399,16 @@ island: reset: true reset-wait: 10 + + # Deaths count + deaths: + # Max deaths + # If player dies more than this, it doesn't count anymore + max: 10 + + # Sum team deaths - if true, all the teams deaths are summed + # If false, only the leader's deaths counts + sum-team: false ### Protection Settings ### protection: diff --git a/src/main/java/us/tastybento/bskyblock/BSkyBlock.java b/src/main/java/us/tastybento/bskyblock/BSkyBlock.java index 8838c92f8..1f87d3155 100755 --- a/src/main/java/us/tastybento/bskyblock/BSkyBlock.java +++ b/src/main/java/us/tastybento/bskyblock/BSkyBlock.java @@ -72,7 +72,7 @@ public class BSkyBlock extends JavaPlugin{ islandsManager.save(true); offlineHistoryMessages.save(true); } - }, Settings.backupPeriod, Settings.backupPeriod); + }, Settings.databaseBackupPeriod, Settings.databaseBackupPeriod); } @Override diff --git a/src/main/java/us/tastybento/bskyblock/commands/IslandCommand.java b/src/main/java/us/tastybento/bskyblock/commands/IslandCommand.java index 6c2596a1c..209998c19 100755 --- a/src/main/java/us/tastybento/bskyblock/commands/IslandCommand.java +++ b/src/main/java/us/tastybento/bskyblock/commands/IslandCommand.java @@ -349,12 +349,12 @@ public class IslandCommand extends BSBCommand{ } // Check if the name isn't too short or too long - if(name.length() < Settings.minIslandNameLength){ - Util.sendMessage(player, ChatColor.RED + plugin.getLocale(player).errorTooShort.replace("[length]", String.valueOf(Settings.minIslandNameLength))); + if(name.length() < Settings.nameMinLength){ + Util.sendMessage(player, ChatColor.RED + plugin.getLocale(player).errorTooShort.replace("[length]", String.valueOf(Settings.nameMinLength))); return; } - if(name.length() > Settings.maxIslandNameLength){ - Util.sendMessage(player, ChatColor.RED + plugin.getLocale(player).errorTooLong.replace("[length]", String.valueOf(Settings.maxIslandNameLength))); + if(name.length() > Settings.nameMaxLength){ + Util.sendMessage(player, ChatColor.RED + plugin.getLocale(player).errorTooLong.replace("[length]", String.valueOf(Settings.nameMaxLength))); return; } diff --git a/src/main/java/us/tastybento/bskyblock/config/Settings.java b/src/main/java/us/tastybento/bskyblock/config/Settings.java index ba17e2073..25d307281 100755 --- a/src/main/java/us/tastybento/bskyblock/config/Settings.java +++ b/src/main/java/us/tastybento/bskyblock/config/Settings.java @@ -49,7 +49,7 @@ public class Settings { /* WORLD */ public static String worldName; - public static int distance; + public static int islandDistance; public static int protectionRange; public static int startX; public static int startZ; @@ -117,6 +117,10 @@ public class Settings { public static boolean confirmReset; public static int confirmResetWait; + // Deaths + public static int deathsMax; + public static boolean deathsSumTeam; + /* PROTECTION */ public static boolean allowPistonPush; public static boolean restrictWither; diff --git a/src/main/java/us/tastybento/bskyblock/database/objects/Island.java b/src/main/java/us/tastybento/bskyblock/database/objects/Island.java index a45d5de40..9134c7aea 100755 --- a/src/main/java/us/tastybento/bskyblock/database/objects/Island.java +++ b/src/main/java/us/tastybento/bskyblock/database/objects/Island.java @@ -38,8 +38,6 @@ public class Island { private int minProtectedZ; // Protection size private int protectionRange; - // Height of island - private int y; // World the island is in private World world; @@ -582,18 +580,18 @@ public class Island { * Resets the flags to their default as set in config.yml for this island */ public void setFlagsDefaults(){ - for(SettingsFlag flag : SettingsFlag.values()){ + /*for(SettingsFlag flag : SettingsFlag.values()){ this.flags.put(flag, Settings.defaultIslandSettings.get(flag)); - } + }*/ //TODO default flags } /** * Resets the flags to their default as set in config.yml for the spawn */ public void setSpawnFlagsDefaults(){ - for(SettingsFlag flag : SettingsFlag.values()){ + /*for(SettingsFlag flag : SettingsFlag.values()){ this.flags.put(flag, Settings.defaultSpawnSettings.get(flag)); - } + }*/ //TODO default flags } /** diff --git a/src/main/java/us/tastybento/bskyblock/database/objects/Players.java b/src/main/java/us/tastybento/bskyblock/database/objects/Players.java index d03ae5749..f34e2d047 100755 --- a/src/main/java/us/tastybento/bskyblock/database/objects/Players.java +++ b/src/main/java/us/tastybento/bskyblock/database/objects/Players.java @@ -36,7 +36,7 @@ public class Players { this.uuid = uuid; this.homeLocations = new HashMap(); this.playerName = ""; - this.resetsLeft = Settings.defaultResetLimit; + this.resetsLeft = Settings.resetLimit; this.locale = ""; this.useControlPanel = Settings.useControlPanel; this.kickedList = new HashMap(); @@ -186,8 +186,8 @@ public class Players { */ public void setDeaths(int deaths) { this.deaths = deaths; - if (this.deaths > Settings.maxDeaths) { - this.deaths = Settings.maxDeaths; + if (this.deaths > Settings.deathsMax) { + this.deaths = Settings.deathsMax; } } @@ -196,8 +196,8 @@ public class Players { */ public void addDeath() { this.deaths++; - if (this.deaths > Settings.maxDeaths) { - this.deaths = Settings.maxDeaths; + if (this.deaths > Settings.deathsMax) { + this.deaths = Settings.deathsMax; } }