From 378a855bde81b8f8879b21c4be4973d41e069430 Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 16 Aug 2019 14:21:17 -0700 Subject: [PATCH 1/7] Version 1.7.0 up Adjusted Travis --- .travis.yml | 7 ++++++- pom.xml | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 568528f..ae6bc33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,12 @@ addons: - develop - master jdk: - - oraclejdk8 + - openjdk8 + - openjdk11 + +matrix: + allow_failures: + - jdk: openjdk11 script: - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent package -P sonar sonar:sonar -B diff --git a/pom.xml b/pom.xml index 88003e2..dd87100 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ -LOCAL - 1.6.0 + 1.7.0 From 8e2f4a4b5effe0b038fe9543ad600b13d5396227 Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 16 Aug 2019 19:07:13 -0700 Subject: [PATCH 2/7] Fixes bug where island world settings in config were not used https://github.com/BentoBoxWorld/Level/issues/80 --- .../level/calculators/CalcIslandLevel.java | 15 +++++++++------ .../world/bentobox/level/config/Settings.java | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main/java/world/bentobox/level/calculators/CalcIslandLevel.java b/src/main/java/world/bentobox/level/calculators/CalcIslandLevel.java index a1b060b..0a05fa1 100644 --- a/src/main/java/world/bentobox/level/calculators/CalcIslandLevel.java +++ b/src/main/java/world/bentobox/level/calculators/CalcIslandLevel.java @@ -191,12 +191,8 @@ public class CalcIslandLevel { result.ofCount.add(md); return 0; } - } else if (addon.getSettings().getBlockValues().containsKey(md)) { - return getValue(md); - } else { - result.ncCount.add(md); - return 0; } + return getValue(md); } /** @@ -206,10 +202,17 @@ public class CalcIslandLevel { * @return value of a material */ private int getValue(Material md) { + // Check world settings if (addon.getSettings().getWorldBlockValues().containsKey(world) && addon.getSettings().getWorldBlockValues().get(world).containsKey(md)) { return addon.getSettings().getWorldBlockValues().get(world).get(md); } - return addon.getSettings().getBlockValues().getOrDefault(md, 0); + // Check baseline + if (addon.getSettings().getBlockValues().containsKey(md)) { + return addon.getSettings().getBlockValues().get(md); + } + // Not in config + result.ncCount.add(md); + return 0; } /** diff --git a/src/main/java/world/bentobox/level/config/Settings.java b/src/main/java/world/bentobox/level/config/Settings.java index 0c63609..ce7264c 100644 --- a/src/main/java/world/bentobox/level/config/Settings.java +++ b/src/main/java/world/bentobox/level/config/Settings.java @@ -109,7 +109,7 @@ public class Settings { for (String material : worldValues.getKeys(false)) { Material mat = Material.valueOf(material); Map values = worldBlockValues.getOrDefault(bWorld, new HashMap<>()); - values.put(mat, worldValues.getInt("blocks." + material, 0)); + values.put(mat, worldValues.getInt(material)); worldBlockValues.put(bWorld, values); } } else { From 94114c65e176459b12bbb1b92901093db55a0379 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 17 Aug 2019 10:28:50 -0700 Subject: [PATCH 3/7] Fixes reporting of world-specific block values in console --- .../bentobox/level/calculators/CalcIslandLevel.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/world/bentobox/level/calculators/CalcIslandLevel.java b/src/main/java/world/bentobox/level/calculators/CalcIslandLevel.java index 0a05fa1..30ba3a0 100644 --- a/src/main/java/world/bentobox/level/calculators/CalcIslandLevel.java +++ b/src/main/java/world/bentobox/level/calculators/CalcIslandLevel.java @@ -330,15 +330,12 @@ public class CalcIslandLevel { for (Entry en : entriesSortedByCount) { Material type = en.getElement(); - int value = 0; - if (addon.getSettings().getBlockValues().containsKey(type)) { - // Specific - value = addon.getSettings().getBlockValues().get(type); + int value = getValue(type); + + r.add(type.toString() + ":" + + String.format("%,d", en.getCount()) + " blocks x " + value + " = " + (value * en.getCount())); + total += (value * en.getCount()); - r.add(type.toString() + ":" - + String.format("%,d", en.getCount()) + " blocks x " + value + " = " + (value * en.getCount())); - total += (value * en.getCount()); - } } r.add("Subtotal = " + total); r.add(LINE_BREAK); From 960f5cbe78d929cc7f236a29c27fac7840dab3ce Mon Sep 17 00:00:00 2001 From: tastybento Date: Wed, 21 Aug 2019 22:13:41 -0700 Subject: [PATCH 4/7] added permissions to readme --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 6d5b042..2ff2a20 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,31 @@ for game modes listed in the config.yml. 1. Read the release notes carefully, but you may have to delete the old config.yml to use a new one. +## Permissons +Permissions are given automatically to players as listed below for BSkyBlock, AcidIsland and CaveBlock. If your permissions plugin strips permissions then you may have to allocate these manually. Note that if a player doesn't have the intopten permission, they will not be listed in the top ten. + +``` +permissions: + bskyblock.intopten: + description: Player is in the top ten. + default: true + bskyblock.island.level: + description: Player can use level command + default: true + bskyblock.island.top: + description: Player can use top ten command + default: true + bskyblock.island.value: + description: Player can use value command + default: true + bskyblock.admin.level: + description: Player can use admin level command + default: true + bskyblock.admin.topten: + description: Player can use admin top ten command + default: true +``` + ## Config.yml The config.yml has the following sections: From 407c2640f17b956af44919b43550cb7c440be87e Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Sun, 25 Aug 2019 21:00:20 +0200 Subject: [PATCH 5/7] Added icon in addon.yml --- src/main/resources/addon.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/addon.yml b/src/main/resources/addon.yml index 6035359..edee9a7 100755 --- a/src/main/resources/addon.yml +++ b/src/main/resources/addon.yml @@ -1,6 +1,7 @@ name: Level main: world.bentobox.level.Level version: ${version}${build.number} +icon: DIAMOND softdepend: AcidIsland, BSkyBlock @@ -81,4 +82,4 @@ permissions: default: true skygird.admin.topten: description: Player can use admin top ten command - default: true \ No newline at end of file + default: true From e428d52a45db642886640fabf32e9c4dd8153a85 Mon Sep 17 00:00:00 2001 From: Florian CUNY Date: Sat, 7 Sep 2019 14:29:58 +0200 Subject: [PATCH 6/7] Use Addon#logWarning() instead of BentoBox's logger --- .../java/world/bentobox/level/config/Settings.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/world/bentobox/level/config/Settings.java b/src/main/java/world/bentobox/level/config/Settings.java index ce7264c..a0e1e31 100644 --- a/src/main/java/world/bentobox/level/config/Settings.java +++ b/src/main/java/world/bentobox/level/config/Settings.java @@ -69,7 +69,7 @@ public class Settings { setLevelCost(level.getConfig().getInt("levelcost", 100)); if (getLevelCost() < 1) { setLevelCost(1); - level.getLogger().warning("levelcost in blockvalues.yml cannot be less than 1. Setting to 1."); + level.logWarning("levelcost in blockvalues.yml cannot be less than 1. Setting to 1."); } if (level.getConfig().isSet("limits")) { @@ -79,7 +79,7 @@ public class Settings { Material mat = Material.valueOf(material); bl.put(mat, level.getConfig().getInt("limits." + material, 0)); } catch (Exception e) { - level.getLogger().warning(() -> "Unknown material (" + material + ") in blockvalues.yml Limits section. Skipping..."); + level.logWarning("Unknown material (" + material + ") in blockvalues.yml Limits section. Skipping..."); } } setBlockLimits(bl); @@ -92,12 +92,12 @@ public class Settings { Material mat = Material.valueOf(material); bv.put(mat, level.getConfig().getInt("blocks." + material, 0)); } catch (Exception e) { - level.getLogger().warning(()-> "Unknown material (" + material + ") in config.yml blocks section. Skipping..."); + level.logWarning("Unknown material (" + material + ") in config.yml blocks section. Skipping..."); } } setBlockValues(bv); } else { - level.getLogger().severe("No block values in config.yml! All island levels will be zero!"); + level.logWarning("No block values in config.yml! All island levels will be zero!"); } // Worlds if (level.getConfig().isSet("worlds")) { @@ -113,7 +113,7 @@ public class Settings { worldBlockValues.put(bWorld, values); } } else { - level.getLogger().severe(() -> "Level Addon: No such world in config.yml : " + world); + level.logWarning("Level Addon: No such world in config.yml : " + world); } } } From bdb319b8a1c1504346edb782b2f6e733c79576b1 Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 9 Sep 2019 10:42:05 -0700 Subject: [PATCH 7/7] Renamed locales for GitLocalize --- src/main/resources/locales/{es-ES.yml => es.yml} | 0 src/main/resources/locales/{fr-FR.yml => fr.yml} | 0 src/main/resources/locales/{lv-LV.yml => lv.yml} | 0 src/main/resources/locales/{tr-TR.yml => tr.yml} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/locales/{es-ES.yml => es.yml} (100%) rename src/main/resources/locales/{fr-FR.yml => fr.yml} (100%) rename src/main/resources/locales/{lv-LV.yml => lv.yml} (100%) rename src/main/resources/locales/{tr-TR.yml => tr.yml} (100%) diff --git a/src/main/resources/locales/es-ES.yml b/src/main/resources/locales/es.yml similarity index 100% rename from src/main/resources/locales/es-ES.yml rename to src/main/resources/locales/es.yml diff --git a/src/main/resources/locales/fr-FR.yml b/src/main/resources/locales/fr.yml similarity index 100% rename from src/main/resources/locales/fr-FR.yml rename to src/main/resources/locales/fr.yml diff --git a/src/main/resources/locales/lv-LV.yml b/src/main/resources/locales/lv.yml similarity index 100% rename from src/main/resources/locales/lv-LV.yml rename to src/main/resources/locales/lv.yml diff --git a/src/main/resources/locales/tr-TR.yml b/src/main/resources/locales/tr.yml similarity index 100% rename from src/main/resources/locales/tr-TR.yml rename to src/main/resources/locales/tr.yml