From 6f53fe8a8517b05bd940ba965b1ab3244a14519a Mon Sep 17 00:00:00 2001 From: tastybento Date: Sat, 28 Sep 2019 16:12:37 -0700 Subject: [PATCH] Update to BentoBox 1.8.0 API --- .../world/bentobox/acidisland/AISettings.java | 35 +++++++++++++++++++ src/main/resources/config.yml | 5 +++ 2 files changed, 40 insertions(+) diff --git a/src/main/java/world/bentobox/acidisland/AISettings.java b/src/main/java/world/bentobox/acidisland/AISettings.java index 9cd551c..93f3d22 100644 --- a/src/main/java/world/bentobox/acidisland/AISettings.java +++ b/src/main/java/world/bentobox/acidisland/AISettings.java @@ -336,6 +336,15 @@ public class AISettings implements WorldSettings { @ConfigEntry(path = "island.reset.on-leave.ender-chest") private boolean onLeaveResetEnderChest = false; + // Commands + @ConfigComment("List of commands to run when a player joins.") + @ConfigEntry(path = "island.commands.on-join") + private List onJoinCommands = new ArrayList<>(); + + @ConfigComment("list of commands to run when a player leaves.") + @ConfigEntry(path = "island.commands.on-leave") + private List onLeaveCommands = new ArrayList<>(); + // Sethome @ConfigEntry(path = "island.sethome.nether.allow") private boolean allowSetHomeInNether = true; @@ -1285,5 +1294,31 @@ public class AISettings implements WorldSettings { public void setDeathsResetOnNewIsland(boolean deathsResetOnNewIsland) { this.deathsResetOnNewIsland = deathsResetOnNewIsland; } + /** + * @return the onJoinCommands + */ + @Override + public List getOnJoinCommands() { + return onJoinCommands; + } + /** + * @param onJoinCommands the onJoinCommands to set + */ + public void setOnJoinCommands(List onJoinCommands) { + this.onJoinCommands = onJoinCommands; + } + /** + * @return the onLeaveCommands + */ + @Override + public List getOnLeaveCommands() { + return onLeaveCommands; + } + /** + * @param onLeaveCommands the onLeaveCommands to set + */ + public void setOnLeaveCommands(List onLeaveCommands) { + this.onLeaveCommands = onLeaveCommands; + } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 243097e..82c77e7 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -269,6 +269,11 @@ island: inventory: false # Reset Ender Chest - if true, the player's Ender Chest will be cleared. ender-chest: false + commands: + # List of commands to run when a player joins. + on-join: [] + # List of commands to run when a player leaves. + on-leave: [] sethome: nether: allow: true