From 41912f9e172b974e4ba090c6171e140e758f61e5 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sat, 22 Feb 2014 08:10:13 -0600 Subject: [PATCH] a bit of cleanup for denypearl functionality, and made setting enable itself for people updating from older versions of the plugin where it defaulted to false (as it now defaults to true); this is done since the changed functionality should now be desirable for most people --- src/main/java/com/wimbli/WorldBorder/Config.java | 6 +++++- src/main/java/com/wimbli/WorldBorder/WBCommand.java | 2 +- src/main/java/com/wimbli/WorldBorder/WBListener.java | 1 - src/main/java/com/wimbli/WorldBorder/WorldFillTask.java | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/wimbli/WorldBorder/Config.java b/src/main/java/com/wimbli/WorldBorder/Config.java index 340b06c..dc852b7 100644 --- a/src/main/java/com/wimbli/WorldBorder/Config.java +++ b/src/main/java/com/wimbli/WorldBorder/Config.java @@ -518,7 +518,7 @@ public class Config } - private static final int currentCfgVersion = 9; + private static final int currentCfgVersion = 10; public static void load(WorldBorder master, boolean logIt) { // load config from file @@ -567,6 +567,10 @@ public class Config else updateMessage(msg); + // this option defaulted to false previously, but what it actually does has changed to something that almost everyone should now want by default + if (cfgVersion < 10) + denyEnderpearl = true; + ConfigurationSection worlds = cfg.getConfigurationSection("worlds"); if (worlds != null) { diff --git a/src/main/java/com/wimbli/WorldBorder/WBCommand.java b/src/main/java/com/wimbli/WorldBorder/WBCommand.java index 52018ce..61b6857 100644 --- a/src/main/java/com/wimbli/WorldBorder/WBCommand.java +++ b/src/main/java/com/wimbli/WorldBorder/WBCommand.java @@ -901,7 +901,7 @@ public class WBCommand implements CommandExecutor sender.sendMessage(cmd+" bypasslist " + clrDesc + " - list players with border bypass enabled."); sender.sendMessage(cmd+" fillautosave " + clrReq + "" + clrDesc + " - world save interval for Fill."); sender.sendMessage(cmd+" portal " + clrReq + "" + clrDesc + " - turn portal redirection on or off."); - sender.sendMessage(cmd+" denypearl " + clrReq + "" + clrDesc + " - stop ender pearls thrown past the border."); + sender.sendMessage(cmd+" denypearl " + clrReq + "" + clrDesc + " - stop ender pearls past the border."); sender.sendMessage(cmd+" reload" + clrDesc + " - re-load data from config.yml."); sender.sendMessage(cmd+" debug " + clrReq + "" + clrDesc + " - turn console debug output on or off."); if (page == 4) diff --git a/src/main/java/com/wimbli/WorldBorder/WBListener.java b/src/main/java/com/wimbli/WorldBorder/WBListener.java index b843fb0..dba5cfe 100644 --- a/src/main/java/com/wimbli/WorldBorder/WBListener.java +++ b/src/main/java/com/wimbli/WorldBorder/WBListener.java @@ -27,7 +27,6 @@ public class WBListener implements Listener { if(event.getCause() == PlayerTeleportEvent.TeleportCause.ENDER_PEARL && Config.getDenyEnderpearl()) { - event.getPlayer().sendMessage(Config.Message()); event.setCancelled(true); return; } diff --git a/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java b/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java index 4c4732a..040e26f 100644 --- a/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java +++ b/src/main/java/com/wimbli/WorldBorder/WorldFillTask.java @@ -98,7 +98,7 @@ public class WorldFillTask implements Runnable int chunkWidthX = (int) Math.ceil((double)((border.getRadiusX() + 16) * 2) / 16); int chunkWidthZ = (int) Math.ceil((double)((border.getRadiusZ() + 16) * 2) / 16); - int biggerWidth = (chunkWidthX > chunkWidthZ) ? chunkWidthX : chunkWidthZ; //We need to calculate the reportTarget with the bigger with, since the spiral will only stop if it has a size of biggerWidth x biggerWidth + int biggerWidth = (chunkWidthX > chunkWidthZ) ? chunkWidthX : chunkWidthZ; //We need to calculate the reportTarget with the bigger width, since the spiral will only stop if it has a size of biggerWidth x biggerWidth this.reportTarget = (biggerWidth * biggerWidth) + biggerWidth + 1; //This would be another way to calculate reportTarget, it assumes that we don't need time to check if the chunk is outside and then skip it (it calculates the area of the rectangle/ellipse)