From 37e638acadadbc894b28c15451bdd5af3ff4e2f2 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sat, 7 Mar 2015 16:22:15 +1100 Subject: [PATCH] finished plot command confirmation (clear, delete, unlink) --- .../plot/PlotSquared.java | 11 ++++ .../plot/commands/Clear.java | 49 ++++++++++++++---- .../plot/commands/Command.java | 1 + .../plot/commands/Confirm.java | 16 ++++-- .../plot/commands/Delete.java | 50 +++++++++++-------- .../plot/commands/MainCommand.java | 2 +- .../plot/commands/Set.java | 13 +++-- .../plot/commands/Unlink.java | 25 ++++++++-- .../intellectualcrafters/plot/config/C.java | 6 +++ .../plot/config/Settings.java | 6 +++ .../plot/listeners/PlayerEvents.java | 2 + .../plot/object/CmdInstance.java | 7 +-- .../plot/util/CmdConfirm.java | 37 +++++++++++++- .../plot/util/MainUtil.java | 1 + 14 files changed, 174 insertions(+), 52 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java index 221aa7046..514e56f6c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotSquared.java @@ -708,6 +708,12 @@ public class PlotSquared { final Map options = new HashMap<>(); options.put("teleport.delay", 0); options.put("auto_update", false); + + options.put("confirmation.clear", Settings.CONFIRM_CLEAR); + options.put("confirmation.delete", Settings.CONFIRM_DELETE); + options.put("confirmation.unlink", Settings.CONFIRM_UNLINK); + + options.put("clusters.enabled", Settings.ENABLE_CLUSTERS); options.put("plotme-alias", Settings.USE_PLOTME_ALIAS); options.put("plotme-convert.enabled", Settings.CONVERT_PLOTME); @@ -738,6 +744,11 @@ public class PlotSquared { if (Settings.DEBUG) { log(C.PREFIX.s() + "&6Debug Mode Enabled (Default). Edit the config to turn this off."); } + + Settings.CONFIRM_CLEAR = config.getBoolean("confirmation.clear"); + Settings.CONFIRM_DELETE = config.getBoolean("confirmation.delete"); + Settings.CONFIRM_UNLINK = config.getBoolean("confirmation.unlink"); + Settings.TELEPORT_DELAY = config.getInt("teleport.delay"); Settings.CONSOLE_COLOR = config.getBoolean("console.color"); Settings.TELEPORT_ON_LOGIN = config.getBoolean("teleport.on_login"); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java index 301ddc6d4..c9454a84b 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Clear.java @@ -24,12 +24,15 @@ import java.util.Set; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; +import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotPlayer; +import com.intellectualcrafters.plot.util.CmdConfirm; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; +import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; public class Clear extends SubCommand { @@ -56,8 +59,19 @@ public class Clear extends SubCommand { if (plot == null) { PlotSquared.log("Could not find plot " + args[0] + " in world " + world); } else { - MainUtil.clear(world, plot, true, null); - PlotSquared.log("Plot " + plot.getId().toString() + " cleared."); + Runnable runnable = new Runnable() { + @Override + public void run() { + MainUtil.clear(world, plot, true, null); + PlotSquared.log("Plot " + plot.getId().toString() + " cleared."); + } + }; + if (Settings.CONFIRM_CLEAR) { + CmdConfirm.addPending(plr, "/plot clear " + id, runnable); + } + else { + TaskManager.runTask(runnable); + } } } } @@ -100,18 +114,31 @@ public class Clear extends SubCommand { return sendMessage(plr, C.NO_PLOT_PERMS); } assert plot != null; - final long start = System.currentTimeMillis(); - final boolean result = MainUtil.clearAsPlayer(plot, false, new Runnable() { + if (MainUtil.runners.containsKey(plot)) { + MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER); + return false; + } + Runnable runnable = new Runnable() { @Override public void run() { - MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start)); + final long start = System.currentTimeMillis(); + final boolean result = MainUtil.clearAsPlayer(plot, false, new Runnable() { + @Override + public void run() { + MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start)); + } + }); + if (!result) { + MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER); + } } - }); - if (!result) { - MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER); + }; + if (Settings.CONFIRM_CLEAR) { + CmdConfirm.addPending(plr, "/plot clear " + plot.id, runnable); } - // sign - // wall - return result; + else { + TaskManager.runTask(runnable); + } + return true; } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java index 9cc9f96fa..4e861414c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Command.java @@ -74,6 +74,7 @@ public enum Command { BAN("ban", "block"), UNBAN("unban", "unblock"), DATABASE("database", "convert"), + CONFIRM("confirm"), TP("tp", "tp"); /** * Command diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Confirm.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Confirm.java index 36abba675..3a49b2be3 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Confirm.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Confirm.java @@ -34,6 +34,7 @@ import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.util.CmdConfirm; import com.intellectualcrafters.plot.util.EconHandler; import com.intellectualcrafters.plot.util.MainUtil; +import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; /** @@ -47,12 +48,17 @@ public class Confirm extends SubCommand { @Override public boolean execute(final PlotPlayer plr, final String... args) { String name = plr.getName(); - CmdInstance command = CmdConfirm.pending.get(name); - if (cmd == null) { - // Tell user no pending commands + CmdInstance command = CmdConfirm.getPending(plr); + if (command == null) { + MainUtil.sendMessage(plr, C.FAILED_CONFIRM); return false; } - // TODO check command timestamp; - return command.command.execute(plr, command.args); + CmdConfirm.removePending(plr); + if (System.currentTimeMillis() - command.timestamp > 10000) { + MainUtil.sendMessage(plr, C.FAILED_CONFIRM); + return false; + } + TaskManager.runTask(command.command); + return true; } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java index 68628ef36..85e634dec 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Delete.java @@ -22,14 +22,17 @@ package com.intellectualcrafters.plot.commands; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; +import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotWorld; +import com.intellectualcrafters.plot.util.CmdConfirm; import com.intellectualcrafters.plot.util.EconHandler; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; +import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; public class Delete extends SubCommand { @@ -52,32 +55,39 @@ public class Delete extends SubCommand { } assert plot != null; final PlotWorld pWorld = PlotSquared.getPlotWorld(plot.world); - if ((PlotSquared.economy != null) && pWorld.USE_ECONOMY && (plot != null) && plot.hasOwner() && plot.getOwner().equals(UUIDHandler.getUUID(plr))) { - final double c = pWorld.SELL_PRICE; - if (c > 0d) { - EconHandler.depositPlayer(plr, c); - sendMessage(plr, C.ADDED_BALANCE, c + ""); - } - } if (MainUtil.runners.containsKey(plot)) { MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER); return false; } - final boolean result = PlotSquared.removePlot(loc.getWorld(), plot.id, true); - final long start = System.currentTimeMillis(); - if (result) { - final boolean result2 = MainUtil.clearAsPlayer(plot, true, new Runnable() { - @Override - public void run() { - MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start)); + Runnable runnable = new Runnable() { + @Override + public void run() { + if ((PlotSquared.economy != null) && pWorld.USE_ECONOMY && (plot != null) && plot.hasOwner() && plot.getOwner().equals(UUIDHandler.getUUID(plr))) { + final double c = pWorld.SELL_PRICE; + if (c > 0d) { + EconHandler.depositPlayer(plr, c); + sendMessage(plr, C.ADDED_BALANCE, c + ""); + } } - }); - if (!result2) { - MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER); + PlotSquared.removePlot(loc.getWorld(), plot.id, true); + final long start = System.currentTimeMillis(); + final boolean result = MainUtil.clearAsPlayer(plot, true, new Runnable() { + @Override + public void run() { + MainUtil.sendMessage(plr, C.CLEARING_DONE, "" + (System.currentTimeMillis() - start)); + } + }); + if (!result) { + MainUtil.sendMessage(plr, C.WAIT_FOR_TIMER); + } + DBFunc.delete(loc.getWorld(), plot); } - DBFunc.delete(loc.getWorld(), plot); - } else { - MainUtil.sendMessage(plr, "Plot deletion has been denied."); + }; + if (Settings.CONFIRM_DELETE) { + CmdConfirm.addPending(plr, "/plot delete " + plot.id, runnable); + } + else { + TaskManager.runTask(runnable); } return true; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index 574038289..e5aa7240a 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -40,7 +40,7 @@ public class MainCommand { /** * Main Permission Node */ - private final static SubCommand[] _subCommands = new SubCommand[] { new Template(), new Setup(), new DebugSaveTest(), new DebugLoadTest(), new CreateRoadSchematic(), new RegenAllRoads(), new DebugClear(), new Claim(), new Auto(), new Home(), new Visit(), new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(), new Info(), new list(), new Help(), new Debug(), new SchematicCmd(), new plugin(), new Inventory(), new Purge(), new Reload(), new Merge(), new Unlink(), new Kick(), new Rate(), new DebugClaimTest(), new Inbox(), new Comment(), new Database(), new Unclaim(), new Swap(), new MusicSubcommand(), new DebugRoadRegen(), new Trim(), new DebugExec(), new FlagCmd(), new Target(), new DebugFixFlags(), new Move(), new Condense() }; + private final static SubCommand[] _subCommands = new SubCommand[] { new Template(), new Setup(), new DebugSaveTest(), new DebugLoadTest(), new CreateRoadSchematic(), new RegenAllRoads(), new DebugClear(), new Claim(), new Auto(), new Home(), new Visit(), new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(), new Info(), new list(), new Help(), new Debug(), new SchematicCmd(), new plugin(), new Inventory(), new Purge(), new Reload(), new Merge(), new Unlink(), new Kick(), new Rate(), new DebugClaimTest(), new Inbox(), new Comment(), new Database(), new Unclaim(), new Swap(), new MusicSubcommand(), new DebugRoadRegen(), new Trim(), new DebugExec(), new FlagCmd(), new Target(), new DebugFixFlags(), new Move(), new Condense(), new Confirm() }; public final static ArrayList subCommands = new ArrayList() { { addAll(Arrays.asList(_subCommands)); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java index 289d431f2..d52b13113 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java @@ -70,9 +70,11 @@ public class Set extends SubCommand { sendMessage(plr, C.PLOT_NOT_CLAIMED); return false; } - if (!plot.isAdded(plr.getUUID()) && !Permissions.hasPermission(plr, "plots.admin.command.set")) { - MainUtil.sendMessage(plr, C.NO_PLOT_PERMS); - return false; + if (!plot.isAdded(plr.getUUID())) { + if (!Permissions.hasPermission(plr, "plots.set.other")) { + MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.set.other"); + return false; + } } if (args.length < 1) { PlotManager manager = PlotSquared.getPlotManager(loc.getWorld()); @@ -111,7 +113,7 @@ public class Set extends SubCommand { return false; } if (!Permissions.hasPermission(plr, "plots.set.flag." + args[1].toLowerCase())) { - MainUtil.sendMessage(plr, C.NO_PERMISSION); + MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.set.flag." + args[1].toLowerCase()); return false; } if (args.length == 2) { @@ -225,6 +227,9 @@ public class Set extends SubCommand { final String[] components = manager.getPlotComponents(plotworld, plot.id); for (final String component : components) { if (component.equalsIgnoreCase(args[0])) { + if (!Permissions.hasPermission(plr, "plots.set." + component)) { + MainUtil.sendMessage(plr, C.NO_PERMISSION, "plots.set." + component); + } PlotBlock[] blocks; try { blocks = (PlotBlock[]) Configuration.BLOCKLIST.parseString(args[1]); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java index cb99409f8..81c4db8eb 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Unlink.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import com.intellectualcrafters.plot.PlotSquared; import com.intellectualcrafters.plot.config.C; +import com.intellectualcrafters.plot.config.Settings; import com.intellectualcrafters.plot.database.DBFunc; import com.intellectualcrafters.plot.object.Location; import com.intellectualcrafters.plot.object.Plot; @@ -31,9 +32,11 @@ import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotManager; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotWorld; +import com.intellectualcrafters.plot.util.CmdConfirm; import com.intellectualcrafters.plot.util.EventUtil; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; +import com.intellectualcrafters.plot.util.TaskManager; import com.intellectualcrafters.plot.util.bukkit.UUIDHandler; /** @@ -59,12 +62,24 @@ public class Unlink extends SubCommand { if (MainUtil.getTopPlot(plot).equals(MainUtil.getBottomPlot(plot))) { return sendMessage(plr, C.UNLINK_IMPOSSIBLE); } - if (!unlinkPlot(plot)) { - MainUtil.sendMessage(plr, "&cUnlink has been cancelled"); - return false; + + Runnable runnable = new Runnable() { + @Override + public void run() { + if (!unlinkPlot(plot)) { + MainUtil.sendMessage(plr, "&cUnlink has been cancelled"); + return; + } + MainUtil.update(plr.getLocation()); + MainUtil.sendMessage(plr, C.UNLINK_SUCCESS); + } + }; + if (Settings.CONFIRM_UNLINK) { + CmdConfirm.addPending(plr, "/plot unlink " + plot.id, runnable); + } + else { + TaskManager.runTask(runnable); } - MainUtil.update(plr.getLocation()); - MainUtil.sendMessage(plr, "&6Plots unlinked successfully!"); return true; } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java index 039842e88..5b05c2cc7 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -35,6 +35,11 @@ import com.intellectualsites.translation.bukkit.BukkitTranslation; * @author Citymonstret */ public enum C { + /* + * Confirm + */ + FAILED_CONFIRM("$2You have no pending actions to confirm!"), + REQUIRES_CONFIRM("$2Are you sure you wish to execute: $1%s$2?\n$2If you are sure: $1/plot confirm"), /* * Move */ @@ -208,6 +213,7 @@ public enum C { NO_PERM_MERGE("$2You are not the owner of the plot: $1%plot%"), UNLINK_REQUIRED("$2An unlink is required to do this."), UNLINK_IMPOSSIBLE("$2You can only unlink a mega-plot"), + UNLINK_SUCCESS("$2Successfully unlinked plots."), NO_MERGE_TO_MEGA("$2Mega plots cannot be merged into. Please merge from the desired mega plot."), /* * Commands diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/Settings.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/Settings.java index 60ff04f24..051ab5cf0 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/Settings.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/config/Settings.java @@ -136,6 +136,12 @@ public class Settings { * Use offline mode storage */ public static boolean OFFLINE_MODE = false; + /** + * Command confirmation + */ + public static boolean CONFIRM_CLEAR = true; + public static boolean CONFIRM_DELETE = true; + public static boolean CONFIRM_UNLINK = true; /** * Database settings diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index 018f5b3c9..83b89bb24 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -79,6 +79,7 @@ import com.intellectualcrafters.plot.object.PlotManager; import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotWorld; import com.intellectualcrafters.plot.object.StringWrapper; +import com.intellectualcrafters.plot.util.CmdConfirm; import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.SetupUtils; @@ -812,6 +813,7 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi if (SetupUtils.setupMap.containsKey(name)) { SetupUtils.setupMap.remove(name); } + CmdConfirm.removePending(name); BukkitUtil.removePlayer(name); if (Settings.DELETE_PLOTS_ON_BAN && event.getPlayer().isBanned()) { final Collection plots = PlotSquared.getPlots(name).values(); diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/CmdInstance.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/CmdInstance.java index cd11e217a..ac55a321c 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/CmdInstance.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/CmdInstance.java @@ -1,15 +1,12 @@ package com.intellectualcrafters.plot.object; -import com.intellectualcrafters.plot.commands.SubCommand; public class CmdInstance { - public final SubCommand command; - public final String[] args; + public final Runnable command; public final long timestamp; - public CmdInstance(SubCommand command, String[] args) { + public CmdInstance(Runnable command) { this.command = command; - this.args = args; this.timestamp = System.currentTimeMillis(); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/CmdConfirm.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/CmdConfirm.java index 6c799d4c9..9b4f51644 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/CmdConfirm.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/CmdConfirm.java @@ -3,8 +3,43 @@ package com.intellectualcrafters.plot.util; import java.util.HashMap; import com.intellectualcrafters.plot.commands.SubCommand; +import com.intellectualcrafters.plot.config.C; import com.intellectualcrafters.plot.object.CmdInstance; +import com.intellectualcrafters.plot.object.PlotPlayer; public class CmdConfirm { - public static HashMap pending = new HashMap<>(); + private static HashMap pending = new HashMap<>(); + + public static CmdInstance getPending(PlotPlayer player) { + if (player == null) { + return pending.get("__CONSOLE__"); + } + return pending.get(player.getName()); + } + + public static void removePending(PlotPlayer player) { + if (player == null) { + pending.remove("__CONSOLE__"); + } + else { + pending.remove(player.getName()); + } + } + + public static void removePending(String name) { + pending.remove(name); + } + + public static void addPending(PlotPlayer player, String commandStr, Runnable runnable) { + MainUtil.sendMessage(player, C.REQUIRES_CONFIRM, commandStr); + CmdInstance cmd = new CmdInstance(runnable); + String name; + if (player == null) { + name = "__CONSOLE__"; + } + else { + name = player.getName(); + } + pending.put(name, cmd); + } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java index 0a916840c..bcc9c0b01 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java @@ -591,6 +591,7 @@ public class MainUtil { final int bottomZ = getPlotBottomLoc(world, plot.id).getZ() + 1; final int topZ = getPlotTopLoc(world, plot.id).getZ(); BukkitUtil.setBiome(world, bottomX, bottomZ, topX, topZ, biome); + update(getPlotHome(world, plot)); } public static int getHeighestBlock(final String world, final int x, final int z) {