diff --git a/pom.xml b/pom.xml index 3b62bd7..232b61b 100644 --- a/pom.xml +++ b/pom.xml @@ -54,18 +54,18 @@ UTF-8 UTF-8 - 16 + 17 2.0.9 - 1.17.1-R0.1-SNAPSHOT - 1.17.1 + 1.19-R0.1-SNAPSHOT + 1.21.0 ${build.version}-SNAPSHOT -LOCAL - 1.15.2 + 1.16.0 BentoBoxWorld_BSkyBlock bentobox-world @@ -230,7 +230,33 @@ 3.0.0-M5 - --illegal-access=permit + --add-opens java.base/java.lang=ALL-UNNAMED + --add-opens java.base/java.math=ALL-UNNAMED + --add-opens java.base/java.io=ALL-UNNAMED + --add-opens java.base/java.util=ALL-UNNAMED + --add-opens + java.base/java.util.stream=ALL-UNNAMED + --add-opens java.base/java.text=ALL-UNNAMED + --add-opens + java.base/java.util.regex=ALL-UNNAMED + --add-opens + java.base/java.nio.channels.spi=ALL-UNNAMED + --add-opens java.base/sun.nio.ch=ALL-UNNAMED + --add-opens java.base/java.net=ALL-UNNAMED + --add-opens + java.base/java.util.concurrent=ALL-UNNAMED + --add-opens java.base/sun.nio.fs=ALL-UNNAMED + --add-opens java.base/sun.nio.cs=ALL-UNNAMED + --add-opens java.base/java.nio.file=ALL-UNNAMED + --add-opens + java.base/java.nio.charset=ALL-UNNAMED + --add-opens + java.base/java.lang.reflect=ALL-UNNAMED + --add-opens + java.logging/java.util.logging=ALL-UNNAMED + --add-opens java.base/java.lang.ref=ALL-UNNAMED + --add-opens java.base/java.util.jar=ALL-UNNAMED + --add-opens java.base/java.util.zip=ALL-UNNAMED diff --git a/src/main/java/world/bentobox/bskyblock/Settings.java b/src/main/java/world/bentobox/bskyblock/Settings.java index fb39a3e..324297a 100644 --- a/src/main/java/world/bentobox/bskyblock/Settings.java +++ b/src/main/java/world/bentobox/bskyblock/Settings.java @@ -1,11 +1,6 @@ package world.bentobox.bskyblock; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import org.bukkit.Difficulty; import org.bukkit.GameMode; @@ -21,8 +16,7 @@ import world.bentobox.bentobox.api.configuration.StoreAt; import world.bentobox.bentobox.api.configuration.WorldSettings; import world.bentobox.bentobox.api.flags.Flag; import world.bentobox.bentobox.database.objects.adapters.Adapter; -import world.bentobox.bentobox.database.objects.adapters.FlagSerializer; -import world.bentobox.bentobox.database.objects.adapters.FlagSerializer2; +import world.bentobox.bentobox.database.objects.adapters.FlagBooleanSerializer; /** * All the plugin settings are here @@ -232,13 +226,12 @@ public class Settings implements WorldSettings { @ConfigComment(" SUB-OWNER = 900") @ConfigComment(" OWNER = 1000") @ConfigEntry(path = "world.default-island-flags") - @Adapter(FlagSerializer.class) - private Map defaultIslandFlags = new HashMap<>(); + private Map defaultIslandFlagNames = new HashMap<>(); @ConfigComment("These are the default settings for new islands") @ConfigEntry(path = "world.default-island-settings") - @Adapter(FlagSerializer2.class) - private Map defaultIslandSettings = new HashMap<>(); + @Adapter(FlagBooleanSerializer.class) + private Map defaultIslandSettingNames = new HashMap<>(); @ConfigComment("These settings/flags are hidden from users") @ConfigComment("Ops can toggle hiding in-game using SHIFT-LEFT-CLICK on flags in settings") @@ -690,22 +683,57 @@ public class Settings implements WorldSettings { return worldFlags; } + /** * @return the defaultIslandFlags + * @deprecated since 1.21 */ @Override - public Map getDefaultIslandFlags() { - return defaultIslandFlags; + public Map getDefaultIslandFlags() + { + return Collections.emptyMap(); } + /** * @return the defaultIslandSettings + * @deprecated since 1.21 */ @Override - public Map getDefaultIslandSettings() { - return defaultIslandSettings; + public Map getDefaultIslandSettings() + { + return Collections.emptyMap(); } + + /** + * Return map of flags ID's linked to default rank for new island. + * This is necessary so users could specify any flag names in settings file from other plugins and addons. + * Otherwise, Flag reader would mark flag as invalid and remove it. + * @since 1.21 + * @return default rank settings for new islands. + */ + @Override + public Map getDefaultIslandFlagNames() + { + return this.defaultIslandFlagNames; + } + + + /** + * Return map of flags ID's linked to default settings for new island. + * This is necessary so users could specify any flag names in settings file from other plugins and addons. + * Otherwise, Flag reader would mark flag as invalid and remove it. + * @since 1.21 + * @return default settings for new islands. + */ + @Override + public Map getDefaultIslandSettingNames() + { + return this.defaultIslandSettingNames; + } + + /** * @return the hidden flags */ @@ -1097,20 +1125,29 @@ public class Settings implements WorldSettings { this.worldFlags = worldFlags; } - /** - * @param defaultIslandFlags the defaultIslandFlags to set - */ - public void setDefaultIslandFlags(Map defaultIslandFlags) { - this.defaultIslandFlags = defaultIslandFlags; - } /** - * @param defaultIslandSettings the defaultIslandSettings to set + * Sets default island flag names. + * + * @param defaultIslandFlagNames the default island flag names */ - public void setDefaultIslandSettings(Map defaultIslandSettings) { - this.defaultIslandSettings = defaultIslandSettings; + public void setDefaultIslandFlagNames(Map defaultIslandFlagNames) + { + this.defaultIslandFlagNames = defaultIslandFlagNames; } + + /** + * Sets default island setting names. + * + * @param defaultIslandSettingNames the default island setting names + */ + public void setDefaultIslandSettingNames(Map defaultIslandSettingNames) + { + this.defaultIslandSettingNames = defaultIslandSettingNames; + } + + /** * @param hiddenFlags the hidden flags to set */ diff --git a/src/main/java/world/bentobox/bskyblock/commands/IslandAboutCommand.java b/src/main/java/world/bentobox/bskyblock/commands/IslandAboutCommand.java index 7774fc0..1406333 100644 --- a/src/main/java/world/bentobox/bskyblock/commands/IslandAboutCommand.java +++ b/src/main/java/world/bentobox/bskyblock/commands/IslandAboutCommand.java @@ -23,7 +23,7 @@ public class IslandAboutCommand extends CompositeCommand { @Override public boolean execute(User user, String label, List args) { user.sendRawMessage("About " + getAddon().getDescription().getName() + " " + getAddon().getDescription().getVersion() + ":"); - user.sendRawMessage("Copyright (c) 2017 - 2020 tastybento, Poslovitch"); + user.sendRawMessage("Copyright (c) 2017 - 2022 tastybento, Poslovitch"); user.sendRawMessage("See https://www.eclipse.org/legal/epl-2.0/"); user.sendRawMessage("for license information."); return true; diff --git a/src/main/java/world/bentobox/bskyblock/generators/ChunkGeneratorWorld.java b/src/main/java/world/bentobox/bskyblock/generators/ChunkGeneratorWorld.java index 31350e2..6edd388 100644 --- a/src/main/java/world/bentobox/bskyblock/generators/ChunkGeneratorWorld.java +++ b/src/main/java/world/bentobox/bskyblock/generators/ChunkGeneratorWorld.java @@ -39,7 +39,7 @@ public class ChunkGeneratorWorld extends ChunkGenerator { public ChunkData generateChunks(World world) { ChunkData result = createChunkData(world); if (world.getEnvironment().equals(Environment.NORMAL) && addon.getSettings().getSeaHeight() > 0) { - result.setRegion(0, 0, 0, 16, addon.getSettings().getSeaHeight() + 1, 16, Material.WATER); + result.setRegion(0, world.getMinHeight(), 0, 16, addon.getSettings().getSeaHeight() + 1, 16, Material.WATER); } if (world.getEnvironment().equals(Environment.NETHER) && addon.getSettings().isNetherRoof()) { roofChunk.forEach((k,v) -> result.setBlock(k.getBlockX(), world.getMaxHeight() + k.getBlockY(), k.getBlockZ(), v)); @@ -58,7 +58,7 @@ public class ChunkGeneratorWorld extends ChunkGenerator { world.getEnvironment() == Environment.NETHER ? addon.getSettings().getDefaultNetherBiome() : addon.getSettings().getDefaultEndBiome(); for (int x = 0; x < 16; x+=4) { for (int z = 0; z < 16; z+=4) { - for (int y = 0; y < world.getMaxHeight(); y+=4) { + for (int y = world.getMinHeight(); y < world.getMaxHeight(); y+=4) { biomeGrid.setBiome(x, y, z, biome); } } diff --git a/src/main/resources/addon.yml b/src/main/resources/addon.yml index c6d1a02..389261e 100755 --- a/src/main/resources/addon.yml +++ b/src/main/resources/addon.yml @@ -1,7 +1,7 @@ name: BSkyBlock main: world.bentobox.bskyblock.BSkyBlock version: ${version}${build.number} -api-version: 1.16.5 +api-version: 1.21.0 metrics: true icon: "OAK_SAPLING" repository: "BentoBoxWorld/BSkyBlock" diff --git a/src/main/resources/locales/de.yml b/src/main/resources/locales/de.yml new file mode 100644 index 0000000..dff51be --- /dev/null +++ b/src/main/resources/locales/de.yml @@ -0,0 +1,7 @@ +--- +bskyblock: + sign: + line0: "&cBSkyBlock" + line1: Herzlich willkommen! + line2: "[name]" + line3: Fall nicht hin! &c<3 diff --git a/src/main/resources/locales/fr.yml b/src/main/resources/locales/fr.yml index 32254c8..3474dbb 100644 --- a/src/main/resources/locales/fr.yml +++ b/src/main/resources/locales/fr.yml @@ -1,16 +1,10 @@ -########################################################################################### -# Ceci est un fichier YAML. Soyez prudent lors de l'édition.Vérifiez vos changements dans # -# le vérificateur YAML suivant: http://yaml-online-parser.appspot.com # -########################################################################################### - -meta: - authors: - - x9nico - +--- bskyblock: sign: line0: "&cBSkyBlock" - line1: "Bienvenue!" + line1: Bienvenue! line2: "[name]" - line3: "Ne tombez pas ! &c<3" - + line3: Ne tombez pas ! &c<3 +meta: + authors: + - x9nico diff --git a/src/main/resources/locales/pt.yml b/src/main/resources/locales/pt.yml index b76e5b8..4b34d1f 100644 --- a/src/main/resources/locales/pt.yml +++ b/src/main/resources/locales/pt.yml @@ -1,6 +1,7 @@ +--- bskyblock: sign: line0: "&cBSkyBlock" + line1: Bem vindo(a)! line2: "[name]" line3: Não caia! &c<3 - line1: Bem vinda! diff --git a/src/main/resources/locales/ro.yml b/src/main/resources/locales/ro.yml new file mode 100644 index 0000000..a2d6b33 --- /dev/null +++ b/src/main/resources/locales/ro.yml @@ -0,0 +1,8 @@ +--- +bskyblock: + sign: + line0: "&cBSkyBlock" + line1: "Bine ai venit!" + line2: "[name]" + line3: "Sa nu cazi! &c<3" + diff --git a/src/main/resources/locales/tr.yml b/src/main/resources/locales/tr.yml new file mode 100644 index 0000000..8b0c5de --- /dev/null +++ b/src/main/resources/locales/tr.yml @@ -0,0 +1,7 @@ +--- +bskyblock: + sign: + line0: "&cBSkyBlock" + line1: Hoş Geldin! + line2: "[name]" + line3: Aşağı Düşme! &c<3 diff --git a/src/main/resources/locales/vi.yml b/src/main/resources/locales/vi.yml new file mode 100644 index 0000000..e290d78 --- /dev/null +++ b/src/main/resources/locales/vi.yml @@ -0,0 +1,7 @@ +--- +bskyblock: + sign: + line0: "&cBSkyBlock" + line1: Chào mừng! + line2: "[Tên]" + line3: Đừng ngã xuống! &c<3 diff --git a/src/main/resources/locales/zh-CN.yml b/src/main/resources/locales/zh-CN.yml index 38a62b9..4d14bdb 100644 --- a/src/main/resources/locales/zh-CN.yml +++ b/src/main/resources/locales/zh-CN.yml @@ -1,6 +1,7 @@ +--- bskyblock: sign: line0: "&c空岛生存" - line1: "欢迎你来到这里!" + line1: 欢迎你来到这里! line2: "[name]" - line3: "千万不要掉下去! &c<3" + line3: 千万不要掉下去! &c<3 diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 3dde4ab..c38b629 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: Pladdon main: world.bentobox.bskyblock.BSkyBlockPladdon version: ${version} -api-version: 1.17 +api-version: 1.19 description: A SkyBlock Plugin author: tastybento depend: