diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java index b856f7f85..9db361f56 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/listeners/PlayerEvents.java @@ -571,7 +571,7 @@ public class PlayerEvents extends PlotListener implements Listener { } } - @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onChat(AsyncPlayerChatEvent event) { PlotPlayer plotPlayer = BukkitUtil.getPlayer(event.getPlayer()); Location location = plotPlayer.getLocation(); @@ -603,14 +603,11 @@ public class PlayerEvents extends PlotListener implements Listener { } } } - String full = format.replaceAll("%plot_id%", id.x + ";" + id.y).replaceAll("%sender%", sender).replaceAll("%msg%", message); + String full = format.replace("%plot_id%", id.x + ";" + id.y).replace("%sender%", sender).replace("%msg%", message); full = ChatColor.translateAlternateColorCodes('&', full); -// format = format.replaceAll("%plot_id%", id.x + ";" + id.y).replaceAll("%sender%", "%s").replaceAll("%msg%", "%s"); -// format = ChatColor.translateAlternateColorCodes('&', format); for (Player receiver : recipients) { receiver.sendMessage(full); } -// event.setFormat(format); } @EventHandler(priority = EventPriority.LOWEST) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8_3.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8_3.java index d1e015dab..b9f5d3331 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8_3.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_8_3.java @@ -15,7 +15,6 @@ import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod.RefExecutor; import com.intellectualcrafters.plot.util.SetQueue; import com.intellectualcrafters.plot.util.SetQueue.ChunkWrapper; import com.intellectualcrafters.plot.util.TaskManager; -import com.plotsquared.bukkit.util.BukkitUtil; import com.plotsquared.bukkit.util.SendChunk; import org.bukkit.Chunk; import org.bukkit.Material; @@ -261,17 +260,6 @@ public class FastQueue_1_8_3 extends SlowQueue { return new FastChunk_1_8_3(wrap); } - @Override - public void regenerateChunk(String worldname, ChunkLoc loc) { - World world = BukkitUtil.getWorld(worldname); - Chunk chunk = world.getChunkAt(loc.x, loc.z); - if (chunk.getTileEntities().length > 0) { - Object w = this.methodGetHandleWorld.of(world).call(); - ((Collection) this.tileEntityListTick.of(w).get()).clear(); - } - super.regenerateChunk(worldname, loc); - } - /** * This should be overridden by any specialized queues * @param plotChunk diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_9.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_9.java index f3d150562..a68e9a93b 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_9.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/block/FastQueue_1_9.java @@ -1,7 +1,5 @@ package com.plotsquared.bukkit.util.block; -import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass; - import com.intellectualcrafters.plot.object.ChunkLoc; import com.intellectualcrafters.plot.object.PseudoRandom; import com.intellectualcrafters.plot.util.ChunkManager; @@ -15,12 +13,6 @@ import com.intellectualcrafters.plot.util.ReflectionUtils.RefMethod.RefExecutor; import com.intellectualcrafters.plot.util.SetQueue.ChunkWrapper; import com.intellectualcrafters.plot.util.TaskManager; import com.plotsquared.bukkit.util.BukkitUtil; -import org.bukkit.Chunk; -import org.bukkit.Material; -import org.bukkit.World; -import org.bukkit.World.Environment; -import org.bukkit.block.Biome; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -30,6 +22,14 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map.Entry; import java.util.Set; +import org.bukkit.Chunk; +import org.bukkit.Material; +import org.bukkit.World; +import org.bukkit.World.Environment; +import org.bukkit.block.Biome; + + +import static com.intellectualcrafters.plot.util.ReflectionUtils.getRefClass; public class FastQueue_1_9 extends SlowQueue { @@ -80,18 +80,6 @@ public class FastQueue_1_9 extends SlowQueue { MainUtil.initCache(); } - @Override - public void regenerateChunk(String worldname, ChunkLoc loc) { - World world = BukkitUtil.getWorld(worldname); - Chunk chunk = world.getChunkAt(loc.x, loc.z); - if (chunk.getTileEntities().length > 0) { - Object c = this.methodGetHandleChunk.of(chunk).call(); - Object w = this.methodGetWorld.of(c).call(); - ((Collection) this.tileEntityListTick.of(w).get()).clear(); - } - super.regenerateChunk(worldname, loc); - } - /** * This should be overridden by any specialized queues * @param plotChunk diff --git a/Core/src/main/java/com/intellectualcrafters/plot/PS.java b/Core/src/main/java/com/intellectualcrafters/plot/PS.java index f3ff33533..c7c6a5722 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/PS.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/PS.java @@ -171,10 +171,16 @@ public class PS { if (Settings.KILL_ROAD_MOBS || Settings.KILL_ROAD_VEHICLES) { this.IMP.runEntityTask(); } - if (this.IMP.initWorldEdit()) { - this.worldedit = WorldEdit.getInstance(); - WorldEdit.getInstance().getEventBus().register(new WESubscriber()); - new WE_Anywhere(); + try { + if (this.IMP.initWorldEdit()) { + this.worldedit = WorldEdit.getInstance(); + WorldEdit.getInstance().getEventBus().register(new WESubscriber()); + new WE_Anywhere(); + + } + } catch (Throwable e) { + e.printStackTrace(); + PS.debug("Incompatible version of WorldEdit, please upgrade: http://builds.enginehub.org/job/worldedit?branch=master"); } // Events diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java index 154a214aa..e87650144 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/MainCommand.java @@ -134,7 +134,7 @@ public class MainCommand extends Command { @Override public void run(final Command cmd, final Runnable success, final Runnable failure) { if (cmd.hasConfirmation(player) ) { - CmdConfirm.addPending(player, "/plot area create pos2 (Creates world)", new Runnable() { + CmdConfirm.addPending(player, cmd.getUsage(), new Runnable() { @Override public void run() { if (EconHandler.manager != null) { diff --git a/Core/src/main/java/com/intellectualcrafters/plot/config/C.java b/Core/src/main/java/com/intellectualcrafters/plot/config/C.java index a33cb177f..c3abd620e 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/config/C.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/config/C.java @@ -290,7 +290,6 @@ public enum C { TASK_START("Starting task...", "Core"), PREFIX("$3[$1P2$3] $2", "Core"), ENABLED("$1PlotSquared is now enabled", "Core"), - EXAMPLE_MESSAGE("$2This is an example message &k!!!", "Core"), /* * Reload */ diff --git a/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java b/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java index bafbc6e67..79130e18b 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/object/Plot.java @@ -1635,7 +1635,7 @@ public class Plot { public boolean removeDenied(UUID uuid) { if (uuid == DBFunc.everyone) { boolean result = false; - for (UUID other : getDenied()) { + for (UUID other : new HashSet<>(getDenied())) { result = result || rmvDenied(other); } return result; @@ -1662,7 +1662,7 @@ public class Plot { public boolean removeTrusted(UUID uuid) { if (uuid == DBFunc.everyone) { boolean result = false; - for (UUID other : getTrusted()) { + for (UUID other : new HashSet<>(getTrusted())) { result = result || rmvTrusted(other); } return result; diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java b/Core/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java index d494b8cdd..f3774963f 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java @@ -721,7 +721,7 @@ public class MainUtil { expires = String.format("%d days", TimeUnit.MILLISECONDS.toDays(l)); } } - } else { + } else if (ExpireManager.IMP != null) { long timestamp = ExpireManager.IMP.getTimestamp(plot.owner); long compared = System.currentTimeMillis() - timestamp; long l = Settings.AUTO_CLEAR_DAYS - TimeUnit.MILLISECONDS.toDays(compared);