From d2965c380980f85e6e71dc1fc0ea1f83ed0e4c2a Mon Sep 17 00:00:00 2001 From: tastybento Date: Sun, 26 Jan 2020 09:15:50 -0800 Subject: [PATCH 1/6] Version 1.11.1 Preemptive bug fix version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 79f2d79..5363d57 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ -LOCAL - 1.11.0 + 1.11.1 From 5b25c2ddc81c03d510989ffe75573ec6f85eaa7c Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 30 Jan 2020 10:33:56 -0800 Subject: [PATCH 2/6] Czech translation. Credit @Polda18 --- src/main/resources/locales/cs.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/main/resources/locales/cs.yml diff --git a/src/main/resources/locales/cs.yml b/src/main/resources/locales/cs.yml new file mode 100644 index 0000000..31e9980 --- /dev/null +++ b/src/main/resources/locales/cs.yml @@ -0,0 +1,13 @@ +########################################################################################### +# This is a YML file. Be careful when editing. Check your edits in a YAML checker like # +# the one at http://yaml-online-parser.appspot.com # +# # +# Translation by: CZghost # +########################################################################################### + +bskyblock: + sign: + line0: '&cBSkyBlock' + line1: VĂ­tej! + line2: '[name]' + line3: Nespadni! &c<3 From 2f8169a1093f2b88bc4987cb2e344c6e831e1f47 Mon Sep 17 00:00:00 2001 From: tastybento Date: Fri, 7 Feb 2020 18:46:14 -0800 Subject: [PATCH 3/6] Adds bskyblock.mod.bypassdelays perm https://github.com/BentoBoxWorld/BentoBox/issues/1136 --- src/main/resources/addon.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/resources/addon.yml b/src/main/resources/addon.yml index 1bfc9e5..ed7a35f 100755 --- a/src/main/resources/addon.yml +++ b/src/main/resources/addon.yml @@ -92,6 +92,9 @@ permissions: bskyblock.mod.bypasscooldowns: description: Allow moderator to bypass cooldowns default: op + bskyblock.mod.bypassdelays: + description: Allow moderator to bypass delays + default: op bskyblock.mod.bypassprotect: description: Allow moderator to bypass island protection default: op From 7bc76333eb9bb92146b4943f32d075c5492bcb6a Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 7 Mar 2020 17:58:53 -0800 Subject: [PATCH 4/6] Version 1.11.2 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5363d57..e379aeb 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ -LOCAL - 1.11.1 + 1.11.2 From 675b052b9581d964722f5327700e16b44fce0880 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 7 Mar 2020 17:59:08 -0800 Subject: [PATCH 5/6] Added spawn limit settings to config.yml --- .../world/bentobox/bskyblock/BSkyBlock.java | 14 +- .../world/bentobox/bskyblock/Settings.java | 141 +++++++++++++++--- src/main/resources/config.yml | 128 ++++++++++------ .../bentobox/bskyblock/BSkyBlockTest.java | 8 +- 4 files changed, 225 insertions(+), 66 deletions(-) diff --git a/src/main/java/world/bentobox/bskyblock/BSkyBlock.java b/src/main/java/world/bentobox/bskyblock/BSkyBlock.java index 2ca0430..e373eae 100644 --- a/src/main/java/world/bentobox/bskyblock/BSkyBlock.java +++ b/src/main/java/world/bentobox/bskyblock/BSkyBlock.java @@ -89,7 +89,6 @@ public class BSkyBlock extends GameModeAddon implements Listener { // Create the world if it does not exist islandWorld = getWorld(worldName, World.Environment.NORMAL, chunkGenerator); - // Make the nether if it does not exist if (settings.isNetherGenerate()) { if (getServer().getWorld(worldName + NETHER) == null) { @@ -118,7 +117,18 @@ public class BSkyBlock extends GameModeAddon implements Listener { worldName2 = env.equals(World.Environment.NETHER) ? worldName2 + NETHER : worldName2; worldName2 = env.equals(World.Environment.THE_END) ? worldName2 + THE_END : worldName2; WorldCreator wc = WorldCreator.name(worldName2).type(WorldType.FLAT).environment(env); - return settings.isUseOwnGenerator() ? wc.createWorld() : wc.generator(chunkGenerator2).createWorld(); + World w = settings.isUseOwnGenerator() ? wc.createWorld() : wc.generator(chunkGenerator2).createWorld(); + // Set spawn rates + if (w != null) { + w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters()); + w.setAmbientSpawnLimit(getSettings().getSpawnLimitAmbient()); + w.setAnimalSpawnLimit(getSettings().getSpawnLimitAnimals()); + w.setWaterAnimalSpawnLimit(getSettings().getSpawnLimitWaterAnimals()); + w.setTicksPerAnimalSpawns(getSettings().getTicksPerAnimalSpawns()); + w.setTicksPerMonsterSpawns(getSettings().getTicksPerMonsterSpawns()); + } + return w; + } @Override diff --git a/src/main/java/world/bentobox/bskyblock/Settings.java b/src/main/java/world/bentobox/bskyblock/Settings.java index 347fa30..6ce9a05 100644 --- a/src/main/java/world/bentobox/bskyblock/Settings.java +++ b/src/main/java/world/bentobox/bskyblock/Settings.java @@ -55,6 +55,25 @@ public class Settings implements WorldSettings { @ConfigEntry(path = "world.difficulty") private Difficulty difficulty = Difficulty.NORMAL; + @ConfigComment("Spawn limits. These override the limits set in bukkit.yml") + @ConfigComment("If set to a negative number, the server defaults will be used") + @ConfigEntry(path = "world.spawn-limits.monsters", since = "1.11.2") + private int spawnLimitMonsters = -1; + @ConfigEntry(path = "world.spawn-limits.animals", since = "1.11.2") + private int spawnLimitAnimals = -1; + @ConfigEntry(path = "world.spawn-limits.water-animals", since = "1.11.2") + private int spawnLimitWaterAnimals = -1; + @ConfigEntry(path = "world.spawn-limits.ambient", since = "1.11.2") + private int spawnLimitAmbient = -1; + @ConfigComment("Setting to 0 will disable animal spawns, but this is not recommended. Minecraft default is 400.") + @ConfigComment("A negative value uses the server default") + @ConfigEntry(path = "world.spawn-limits.ticks-per-animal-spawns", since = "1.11.2") + private int ticksPerAnimalSpawns = -1; + @ConfigComment("Setting to 0 will disable monster spawns, but this is not recommended. Minecraft default is 400.") + @ConfigComment("A negative value uses the server default") + @ConfigEntry(path = "world.spawn-limits.ticks-per-monster-spawns", since = "1.11.2") + private int ticksPerMonsterSpawns = -1; + @ConfigComment("Radius of island in blocks. (So distance between islands is twice this)") @ConfigComment("It is the same for every dimension : Overworld, Nether and End.") @ConfigComment("This value cannot be changed mid-game and the plugin will not start if it is different.") @@ -328,8 +347,8 @@ public class Settings implements WorldSettings { private boolean createIslandOnFirstLoginAbortOnLogout = true; @ConfigComment("Toggles whether the player should be teleported automatically to his island when it is created.") - @ConfigComment("If set to false, the player will be told his island is ready but will have to teleport to his island using the command.") - @ConfigEntry(path = "island.teleport-player-to-island-when-created", since = "1.10.0") + @ConfigComment("If set to false, the player will be told his island is ready but will have to teleport to his island using the command.") + @ConfigEntry(path = "island.teleport-player-to-island-when-created", since = "1.10.0") private boolean teleportPlayerToIslandUponIslandCreation = true; @ConfigComment("Create Nether or End islands if they are missing when a player goes through a portal.") @@ -1445,22 +1464,106 @@ public class Settings implements WorldSettings { this.pasteMissingIslands = pasteMissingIslands; } - /** - * Toggles whether the player should be teleported automatically to his island when it is created. - * @return {@code true} if the player should be teleported automatically to his island when it is created, - * {@code false} otherwise. - * @since 1.10.0 - */ - @Override - public boolean isTeleportPlayerToIslandUponIslandCreation() { - return teleportPlayerToIslandUponIslandCreation; - } + /** + * Toggles whether the player should be teleported automatically to his island when it is created. + * @return {@code true} if the player should be teleported automatically to his island when it is created, + * {@code false} otherwise. + * @since 1.10.0 + */ + @Override + public boolean isTeleportPlayerToIslandUponIslandCreation() { + return teleportPlayerToIslandUponIslandCreation; + } - /** - * @param teleportPlayerToIslandUponIslandCreation the teleportPlayerToIslandUponIslandCreation to set - * @since 1.10.0 - */ - public void setTeleportPlayerToIslandUponIslandCreation(boolean teleportPlayerToIslandUponIslandCreation) { - this.teleportPlayerToIslandUponIslandCreation = teleportPlayerToIslandUponIslandCreation; - } + /** + * @param teleportPlayerToIslandUponIslandCreation the teleportPlayerToIslandUponIslandCreation to set + * @since 1.10.0 + */ + public void setTeleportPlayerToIslandUponIslandCreation(boolean teleportPlayerToIslandUponIslandCreation) { + this.teleportPlayerToIslandUponIslandCreation = teleportPlayerToIslandUponIslandCreation; + } + + /** + * @return the spawnLimitMonsters + */ + public int getSpawnLimitMonsters() { + return spawnLimitMonsters; + } + + /** + * @param spawnLimitMonsters the spawnLimitMonsters to set + */ + public void setSpawnLimitMonsters(int spawnLimitMonsters) { + this.spawnLimitMonsters = spawnLimitMonsters; + } + + /** + * @return the spawnLimitAnimals + */ + public int getSpawnLimitAnimals() { + return spawnLimitAnimals; + } + + /** + * @param spawnLimitAnimals the spawnLimitAnimals to set + */ + public void setSpawnLimitAnimals(int spawnLimitAnimals) { + this.spawnLimitAnimals = spawnLimitAnimals; + } + + /** + * @return the spawnLimitWaterAnimals + */ + public int getSpawnLimitWaterAnimals() { + return spawnLimitWaterAnimals; + } + + /** + * @param spawnLimitWaterAnimals the spawnLimitWaterAnimals to set + */ + public void setSpawnLimitWaterAnimals(int spawnLimitWaterAnimals) { + this.spawnLimitWaterAnimals = spawnLimitWaterAnimals; + } + + /** + * @return the spawnLimitAmbient + */ + public int getSpawnLimitAmbient() { + return spawnLimitAmbient; + } + + /** + * @param spawnLimitAmbient the spawnLimitAmbient to set + */ + public void setSpawnLimitAmbient(int spawnLimitAmbient) { + this.spawnLimitAmbient = spawnLimitAmbient; + } + + /** + * @return the ticksPerAnimalSpawns + */ + public int getTicksPerAnimalSpawns() { + return ticksPerAnimalSpawns; + } + + /** + * @param ticksPerAnimalSpawns the ticksPerAnimalSpawns to set + */ + public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) { + this.ticksPerAnimalSpawns = ticksPerAnimalSpawns; + } + + /** + * @return the ticksPerMonsterSpawns + */ + public int getTicksPerMonsterSpawns() { + return ticksPerMonsterSpawns; + } + + /** + * @param ticksPerMonsterSpawns the ticksPerMonsterSpawns to set + */ + public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) { + this.ticksPerMonsterSpawns = ticksPerMonsterSpawns; + } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 91548d3..9da14ef 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -18,6 +18,25 @@ world: # World difficulty setting - PEACEFUL, EASY, NORMAL, HARD # Other plugins may override this setting difficulty: NORMAL + spawn-limits: + # Spawn limits. These override the limits set in bukkit.yml + # If set to a negative number, the server defaults will be used + # Added since 1.11.2. + monsters: -1 + # Added since 1.11.2. + animals: -1 + # Added since 1.11.2. + water-animals: -1 + # Added since 1.11.2. + ambient: -1 + # Setting to 0 will disable animal spawns, but this is not recommended. Minecraft default is 400. + # A negative value uses the server default + # Added since 1.11.2. + ticks-per-animal-spawns: -1 + # Setting to 0 will disable monster spawns, but this is not recommended. Minecraft default is 400. + # A negative value uses the server default + # Added since 1.11.2. + ticks-per-monster-spawns: -1 # Radius of island in blocks. (So distance between islands is twice this) # It is the same for every dimension : Overworld, Nether and End. # This value cannot be changed mid-game and the plugin will not start if it is different. @@ -92,10 +111,10 @@ world: dragon-spawn: false # Mob white list - these mobs will NOT be removed when logging in or doing /island remove-mobs-whitelist: - - WITHER - - PIG_ZOMBIE - - ENDERMAN - - ZOMBIE_VILLAGER + - WITHER + - PIG_ZOMBIE + - ZOMBIE_VILLAGER + - ENDERMAN # World flags. These are boolean settings for various flags for this world flags: CREEPER_DAMAGE: true @@ -141,8 +160,8 @@ world: LEVER: 500 RIDING: 500 HURT_MONSTERS: 0 - NAME_TAG: 500 ARMOR_STAND: 500 + NAME_TAG: 500 TRADING: 0 EGGS: 500 ITEM_DROP: 0 @@ -150,19 +169,19 @@ world: NETHER_PORTAL: 500 ITEM_PICKUP: 0 CROP_TRAMPLE: 500 - DROPPER: 500 BREWING: 500 + DROPPER: 500 COLLECT_WATER: 500 BUTTON: 500 FIRE_EXTINGUISH: 500 BEACON: 500 TRAPDOOR: 500 PRESSURE_PLATE: 0 - PLACE_BLOCKS: 500 ITEM_FRAME: 500 + PLACE_BLOCKS: 500 CRAFTING: 0 - SHEARING: 500 ENCHANTING: 0 + SHEARING: 500 SPAWN_EGGS: 500 BED: 500 MILKING: 0 @@ -171,8 +190,8 @@ world: EXPERIENCE_PICKUP: 500 HOPPER: 500 LEASH: 500 - BREAK_BLOCKS: 500 MOUNT_INVENTORY: 500 + BREAK_BLOCKS: 500 CHORUS_FRUIT: 500 CONTAINER: 500 POTION_THROWING: 500 @@ -180,8 +199,8 @@ world: # These are the default settings for new islands default-island-settings: PVP_END: false - ANIMAL_SPAWN: true PVP_NETHER: false + ANIMAL_SPAWN: true MONSTER_SPAWN: true FIRE_SPREAD: true PVP_OVERWORLD: false @@ -191,17 +210,17 @@ world: hidden-flags: [] # Visitor banned commands - Visitors to islands cannot use these commands in this world visitor-banned-commands: - - spawner - - spawnmob + - spawner + - spawnmob # Falling banned commands - players cannot use these commands when falling # if the PREVENT_TELEPORT_WHEN_FALLING world setting flag is active # Added since 1.8.0. falling-banned-commands: - - warp - - spawn + - warp + - spawn island: # Default max team size - # Permission size cannot be less than the default below. + # Permission size cannot be less than the default below. max-team-size: 4 # Default maximum number of homes a player can have. Min = 1 # Accessed via /is sethome or /is go @@ -308,10 +327,30 @@ island: # Added since 1.10.0. create-missing-nether-end-islands: false commands: - # List of commands to run when a player joins. + # List of commands to run when a player joins an island or creates one. + # These commands are run by the console, unless otherwise stated using the [SUDO] prefix, + # in which case they are executed by the player. + # + # Available placeholders for the commands are the following: + # * [name]: name of the player + # + # Here are some examples of valid commands to execute: + # * "[SUDO] bbox version" + # * "bsbadmin deaths set [player] 0" # Added since 1.8.0. on-join: [] - # list of commands to run when a player leaves. + # List of commands to run when a player leaves an island, resets his island or gets kicked from it. + # These commands are run by the console, unless otherwise stated using the [SUDO] prefix, + # in which case they are executed by the player. + # + # Available placeholders for the commands are the following: + # * [name]: name of the player + # + # Here are some examples of valid commands to execute: + # * '[SUDO] bbox version' + # * 'bsbadmin deaths set [player] 0' + # + # Note that player-executed commands might not work, as these commands can be run with said player being offline. # Added since 1.8.0. on-leave: [] sethome: @@ -335,36 +374,37 @@ protection: # Geo restrict mobs. # Mobs that exit the island space where they were spawned will be removed. geo-limit-settings: - - GHAST - - BAT - - BLAZE + - GHAST + - BAT + - BLAZE # Invincible visitors. List of damages that will not affect visitors. # Make list blank if visitors should receive all damages invincible-visitors: - - BLOCK_EXPLOSION - - CONTACT - - CUSTOM - - DROWNING - - ENTITY_ATTACK - - ENTITY_EXPLOSION - - FALL - - FALLING_BLOCK - - FIRE - - FIRE_TICK - - LAVA - - LIGHTNING - - MAGIC - - POISON - - PROJECTILE - - STARVATION - - SUFFOCATION - - THORNS - - WITHER - - DRAGON_BREATH - - FLY_INTO_WALL - - HOT_FLOOR - - CRAMMING - - VOID + - BLOCK_EXPLOSION + - CONTACT + - CUSTOM + - DROWNING + - ENTITY_ATTACK + - ENTITY_EXPLOSION + - FALL + - FALLING_BLOCK + - FIRE + - FIRE_TICK + - LAVA + - LIGHTNING + - MAGIC + - POISON + - PROJECTILE + - STARVATION + - SUFFOCATION + - THORNS + - WITHER + - DRAGON_BREATH + - FLY_INTO_WALL + - HOT_FLOOR + - CRAMMING + - VOID do-not-edit-these-settings: # These settings should not be edited reset-epoch: 0 + diff --git a/src/test/java/world/bentobox/bskyblock/BSkyBlockTest.java b/src/test/java/world/bentobox/bskyblock/BSkyBlockTest.java index c90531b..97cad7e 100644 --- a/src/test/java/world/bentobox/bskyblock/BSkyBlockTest.java +++ b/src/test/java/world/bentobox/bskyblock/BSkyBlockTest.java @@ -39,6 +39,7 @@ import org.powermock.modules.junit4.PowerMockRunner; import org.powermock.reflect.Whitebox; import world.bentobox.bentobox.BentoBox; +import world.bentobox.bentobox.Settings; import world.bentobox.bentobox.api.addons.AddonDescription; import world.bentobox.bentobox.api.configuration.Config; import world.bentobox.bentobox.api.user.User; @@ -70,6 +71,8 @@ public class BSkyBlockTest { private BentoBox plugin; @Mock private FlagsManager fm; + @Mock + private Settings settings; /** * @throws java.lang.Exception @@ -141,11 +144,14 @@ public class BSkyBlockTest { // Addons manager AddonsManager am = mock(AddonsManager.class); when(plugin.getAddonsManager()).thenReturn(am); - + // Flags manager when(plugin.getFlagsManager()).thenReturn(fm); when(fm.getFlags()).thenReturn(Collections.emptyList()); + // Settings + when(plugin.getSettings()).thenReturn(settings); + } /** From 6e7d92a3d5b9ac2283a8819868dc3f843ab26d3e Mon Sep 17 00:00:00 2001 From: tastybento Date: Tue, 24 Mar 2020 08:04:24 -0700 Subject: [PATCH 6/6] Version 1.12.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e379aeb..0013264 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ -LOCAL - 1.11.2 + 1.12.0