From 6af7ce506d30ffad025b939eee2728132dc5296d Mon Sep 17 00:00:00 2001 From: tastybento Date: Tue, 24 Mar 2020 08:03:56 -0700 Subject: [PATCH 1/9] Version 1.12.1 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 657a83c..bff69fa 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ -LOCAL - 1.12.0 + 1.12.1 From a01171f0ca9ce1a7bb3bb198aa32d3fa21a582b5 Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 6 Apr 2020 16:55:52 -0700 Subject: [PATCH 2/9] Version 1.13.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index bff69fa..38d4482 100644 --- a/pom.xml +++ b/pom.xml @@ -59,13 +59,13 @@ 2.0.4 1.15-R0.1-SNAPSHOT - 1.11.0 + 1.13.0-SNAPSHOT ${build.version}-SNAPSHOT -LOCAL - 1.12.1 + 1.13.0 From 2b4417f245e96e540696b54bf716c42dbaee404f Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 6 Apr 2020 16:58:06 -0700 Subject: [PATCH 3/9] Adds support for max coop and team sizes in config.yml https://github.com/BentoBoxWorld/BentoBox/pull/1267 --- .../world/bentobox/acidisland/AISettings.java | 41 +++++++++++++++++++ src/main/resources/config.yml | 10 +++++ 2 files changed, 51 insertions(+) diff --git a/src/main/java/world/bentobox/acidisland/AISettings.java b/src/main/java/world/bentobox/acidisland/AISettings.java index 0ee7275..7417a48 100644 --- a/src/main/java/world/bentobox/acidisland/AISettings.java +++ b/src/main/java/world/bentobox/acidisland/AISettings.java @@ -319,6 +319,18 @@ public class AISettings implements WorldSettings { @ConfigEntry(path = "island.max-team-size") private int maxTeamSize = 4; + @ConfigComment("Default maximum number of coop rank members per island") + @ConfigComment("Players can have the acidisland.coop.maxsize. permission to be bigger but") + @ConfigComment("permission size cannot be less than the default below. ") + @ConfigEntry(path = "island.max-coop-size", since = "1.13.0") + private int maxCoopSize = 4; + + @ConfigComment("Default maximum number of trusted rank members per island") + @ConfigComment("Players can have the acidisland.trust.maxsize. permission to be bigger but") + @ConfigComment("permission size cannot be less than the default below. ") + @ConfigEntry(path = "island.max-trusted-size", since = "1.13.0") + private int maxTrustSize = 4; + @ConfigComment("Default maximum number of homes a player can have. Min = 1") @ConfigComment("Accessed via /ai sethome or /ai go ") @ConfigComment("Use this permission to set for specific user groups: acidisland.island.maxhomes.") @@ -1693,4 +1705,33 @@ public class AISettings implements WorldSettings { public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) { this.ticksPerMonsterSpawns = ticksPerMonsterSpawns; } + /** + * @return the maxCoopSize + */ + @Override + public int getMaxCoopSize() { + return maxCoopSize; + } + + /** + * @param maxCoopSize the maxCoopSize to set + */ + public void setMaxCoopSize(int maxCoopSize) { + this.maxCoopSize = maxCoopSize; + } + + /** + * @return the maxTrustSize + */ + @Override + public int getMaxTrustSize() { + return maxTrustSize; + } + + /** + * @param maxTrustSize the maxTrustSize to set + */ + public void setMaxTrustSize(int maxTrustSize) { + this.maxTrustSize = maxTrustSize; + } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 19d7885..8a0bdf0 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -298,6 +298,16 @@ island: # Use this permission to set for specific user groups: acidisland.team.maxsize. # Permission size cannot be less than the default below. max-team-size: 4 + # Default maximum number of coop rank members per island + # Players can have the acidisland.coop.maxsize. permission to be bigger but + # permission size cannot be less than the default below. + # Added since 1.13.0. + max-coop-size: 4 + # Default maximum number of trusted rank members per island + # Players can have the acidisland.trust.maxsize. permission to be bigger but + # permission size cannot be less than the default below. + # Added since 1.13.0. + max-trusted-size: 4 # Default maximum number of homes a player can have. Min = 1 # Accessed via /ai sethome or /ai go # Use this permission to set for specific user groups: acidisland.island.maxhomes. From 5b3344498da57a434b48df8c64d79082f98feab5 Mon Sep 17 00:00:00 2001 From: tastybento Date: Mon, 6 Apr 2020 17:00:00 -0700 Subject: [PATCH 4/9] Removed commands for island trash because they should not be needed. --- .../world/bentobox/acidisland/commands/AcidCommand.java | 9 +++------ .../bentobox/acidisland/commands/AcidCommandTest.java | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/main/java/world/bentobox/acidisland/commands/AcidCommand.java b/src/main/java/world/bentobox/acidisland/commands/AcidCommand.java index ba1facd..1055b78 100644 --- a/src/main/java/world/bentobox/acidisland/commands/AcidCommand.java +++ b/src/main/java/world/bentobox/acidisland/commands/AcidCommand.java @@ -5,7 +5,6 @@ import java.util.List; import world.bentobox.bentobox.api.addons.Addon; 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; @@ -15,9 +14,7 @@ import world.bentobox.bentobox.api.commands.admin.AdminSetrankCommand; import world.bentobox.bentobox.api.commands.admin.AdminSetspawnCommand; import world.bentobox.bentobox.api.commands.admin.AdminSettingsCommand; import world.bentobox.bentobox.api.commands.admin.AdminSwitchCommand; -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; @@ -81,9 +78,9 @@ public class AcidCommand extends CompositeCommand { // Reset flags new AdminResetFlagsCommand(this); // Trash - new AdminTrashCommand(this); - new AdminEmptyTrashCommand(this); - new AdminSwitchtoCommand(this); + //new AdminTrashCommand(this); + //new AdminEmptyTrashCommand(this); + //new AdminSwitchtoCommand(this); // Switch new AdminSwitchCommand(this); // Purge diff --git a/src/test/java/world/bentobox/acidisland/commands/AcidCommandTest.java b/src/test/java/world/bentobox/acidisland/commands/AcidCommandTest.java index 5da0e86..a988c34 100644 --- a/src/test/java/world/bentobox/acidisland/commands/AcidCommandTest.java +++ b/src/test/java/world/bentobox/acidisland/commands/AcidCommandTest.java @@ -36,7 +36,7 @@ import world.bentobox.bentobox.managers.FlagsManager; @PrepareForTest({Bukkit.class, BentoBox.class, User.class }) public class AcidCommandTest { - private static final int NUM_COMMANDS = 29; + private static final int NUM_COMMANDS = 26; @Mock private User user; @Mock From f344208460dd7fdb157cc6a3bef402612390ff19 Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 9 Apr 2020 11:01:46 -0700 Subject: [PATCH 5/9] Only burn entities in loaded chunks https://github.com/BentoBoxWorld/AcidIsland/issues/84 --- src/main/java/world/bentobox/acidisland/world/AcidTask.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/world/bentobox/acidisland/world/AcidTask.java b/src/main/java/world/bentobox/acidisland/world/AcidTask.java index ca8ee31..61a992a 100644 --- a/src/main/java/world/bentobox/acidisland/world/AcidTask.java +++ b/src/main/java/world/bentobox/acidisland/world/AcidTask.java @@ -48,6 +48,8 @@ public class AcidTask { entityBurnTask = Bukkit.getScheduler().scheduleSyncRepeatingTask(addon.getPlugin(), () -> getEntityStream() // These entities are immune to acid .filter(e -> !IMMUNE.contains(e.getType())) + // Only burn if the chunk is loaded + .filter(e -> e.getLocation().getChunk().isLoaded()) .filter(w -> w.getLocation().getBlock().getType().equals(Material.WATER)) .forEach(e -> { if ((e instanceof Monster || e instanceof MagmaCube) && addon.getSettings().getAcidDamageMonster() > 0D) { From ded273c7e5bd632df7347ed996e5e90c1a05ffa3 Mon Sep 17 00:00:00 2001 From: tastybento Date: Thu, 9 Apr 2020 11:03:22 -0700 Subject: [PATCH 6/9] Only burn items in loaded chunks. https://github.com/BentoBoxWorld/AcidIsland/issues/84 --- src/main/java/world/bentobox/acidisland/world/AcidTask.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/world/bentobox/acidisland/world/AcidTask.java b/src/main/java/world/bentobox/acidisland/world/AcidTask.java index 61a992a..190796f 100644 --- a/src/main/java/world/bentobox/acidisland/world/AcidTask.java +++ b/src/main/java/world/bentobox/acidisland/world/AcidTask.java @@ -91,6 +91,7 @@ public class AcidTask { Set newItemsInWater = new HashSet<>(); getEntityStream() .filter(e -> e.getType().equals(EntityType.DROPPED_ITEM)) + .filter(e -> e.getLocation().getChunk().isLoaded()) .filter(e -> e.getLocation().getBlock().getType().equals(Material.WATER) || (e.getLocation().getY() > 0 && e.getLocation().getBlock().getRelative(BlockFace.DOWN).getType().equals(Material.WATER))) .forEach(e -> { From 476d6486f1f70e59c1dc357c091dd5b1c6c024c7 Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 18 Apr 2020 14:31:40 -0700 Subject: [PATCH 7/9] Updated copyright notice. --- .../world/bentobox/acidisland/commands/IslandAboutCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/acidisland/commands/IslandAboutCommand.java b/src/main/java/world/bentobox/acidisland/commands/IslandAboutCommand.java index a16c24f..8cd0d35 100644 --- a/src/main/java/world/bentobox/acidisland/commands/IslandAboutCommand.java +++ b/src/main/java/world/bentobox/acidisland/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 - 2019 tastybento"); + user.sendRawMessage("Copyright (c) 2017 - 2020 tastybento"); user.sendRawMessage("See https://www.eclipse.org/legal/epl-2.0/ for license information."); return true; } From a3d4b0e381e26820a0f77c689310bb55a3a0b41f Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 18 Apr 2020 14:45:55 -0700 Subject: [PATCH 8/9] Version 1.13.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bff69fa..92e119d 100644 --- a/pom.xml +++ b/pom.xml @@ -65,7 +65,7 @@ -LOCAL - 1.12.1 + 1.13.0 From 111875f09ce54aaccd813c82fca5442f08004acb Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 18 Apr 2020 14:46:06 -0700 Subject: [PATCH 9/9] Add use-control-panel option to config --- .../world/bentobox/acidisland/AISettings.java | 16 ++++++++++++++++ .../bentobox/acidisland/commands/AiCommand.java | 8 +++++++- src/main/resources/config.yml | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/bentobox/acidisland/AISettings.java b/src/main/java/world/bentobox/acidisland/AISettings.java index 0ee7275..33260d2 100644 --- a/src/main/java/world/bentobox/acidisland/AISettings.java +++ b/src/main/java/world/bentobox/acidisland/AISettings.java @@ -50,7 +50,11 @@ public class AISettings implements WorldSettings { @ConfigComment("The island admin command.") @ConfigEntry(path = "acid.command.admin") + private String adminCommand = "acid"; + @ConfigComment("Use control panel if it exists (ControlPanel addon must be in addons)") + @ConfigEntry(path = "acid.use-control-panel", since = "1.13.0") + private boolean useControlPanel = false; // Damage @ConfigComment("Damage that a player will experience in acid. 10 is half their health typically. 5 would be easier.") @@ -1693,4 +1697,16 @@ public class AISettings implements WorldSettings { public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) { this.ticksPerMonsterSpawns = ticksPerMonsterSpawns; } + /** + * @return the useControlPanel + */ + public boolean isUseControlPanel() { + return useControlPanel; + } + /** + * @param useControlPanel the useControlPanel to set + */ + public void setUseControlPanel(boolean useControlPanel) { + this.useControlPanel = useControlPanel; + } } diff --git a/src/main/java/world/bentobox/acidisland/commands/AiCommand.java b/src/main/java/world/bentobox/acidisland/commands/AiCommand.java index b4e228e..df12325 100644 --- a/src/main/java/world/bentobox/acidisland/commands/AiCommand.java +++ b/src/main/java/world/bentobox/acidisland/commands/AiCommand.java @@ -3,6 +3,7 @@ package world.bentobox.acidisland.commands; import java.util.ArrayList; import java.util.List; +import world.bentobox.acidisland.AcidIsland; import world.bentobox.bentobox.api.addons.Addon; import world.bentobox.bentobox.api.commands.CompositeCommand; import world.bentobox.bentobox.api.commands.island.IslandBanCommand; @@ -71,8 +72,13 @@ public class AiCommand extends CompositeCommand { if (args.isEmpty()) { // If in world, go if (getPlugin().getIslands().getIsland(getWorld(), user.getUniqueId()) != null) { - return getSubCommand("go").map(goCmd -> goCmd.call(user, label, new ArrayList<>())).orElse(false); + if (((AcidIsland)getAddon()).getSettings().isUseControlPanel() + && getSubCommand("controlpanel").isPresent()) { + return getSubCommand("controlpanel").get().call(user, label, new ArrayList<>()); + } + return getSubCommand("go").map(goCmd -> goCmd.call(user, goCmd.getLabel(), new ArrayList<>())).orElse(false); } + // No islands currently return getSubCommand("create").map(createCmd -> createCmd.call(user, label, new ArrayList<>())).orElse(false); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 19d7885..04798d8 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -9,6 +9,8 @@ acid: island: ai # The island admin command. admin: acid + # Use control panel if it exists (ControlPanel addon must be in addons) + use-control-panel: false damage: acid: # Damage that a player will experience in acid. 10 is half their health typically. 5 would be easier.