From 7b8d78ec122ea536e005ef59982d1714e0a5361f Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sun, 4 Nov 2012 15:14:12 -0600 Subject: [PATCH] Fix for command to enable/disable Dynmap border display not reporting correctly whether it's now enabled or disabled when run Also added variables for Dynmap border color/thickness/opacity, just for internal clarity... will also simplify things if I or someone else ever gets around to adding settings for those values, to allow them to be changed --- src/com/wimbli/WorldBorder/DynMapFeatures.java | 5 ++++- src/com/wimbli/WorldBorder/WBCommand.java | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/wimbli/WorldBorder/DynMapFeatures.java b/src/com/wimbli/WorldBorder/DynMapFeatures.java index ef9ce81..16f1b25 100644 --- a/src/com/wimbli/WorldBorder/DynMapFeatures.java +++ b/src/com/wimbli/WorldBorder/DynMapFeatures.java @@ -22,6 +22,9 @@ public class DynMapFeatures private static DynmapAPI api; private static MarkerAPI markApi; private static MarkerSet markSet; + private static int lineWeight = 3; + private static double lineOpacity = 1.0; + private static int lineColor = 0xFF0000; // Whether re-rendering functionality is available public static boolean renderEnabled() @@ -176,7 +179,7 @@ public class DynMapFeatures if (marker == null) { marker = markSet.createCircleMarker("worldborder_"+worldName, Config.DynmapMessage(), false, worldName, border.getX(), 64.0, border.getZ(), border.getRadius(), border.getRadius(), true); - marker.setLineStyle(3, 1.0, 0xFF0000); + marker.setLineStyle(lineWeight, lineOpacity, lineColor); marker.setFillStyle(0.0, 0x000000); roundBorders.put(worldName, marker); } diff --git a/src/com/wimbli/WorldBorder/WBCommand.java b/src/com/wimbli/WorldBorder/WBCommand.java index 6d06c75..998999a 100644 --- a/src/com/wimbli/WorldBorder/WBCommand.java +++ b/src/com/wimbli/WorldBorder/WBCommand.java @@ -563,11 +563,10 @@ public class WBCommand implements CommandExecutor Config.setDynmapBorderEnabled(strAsBool(split[1])); - if (player != null) - Config.Log((Config.Debug() ? "Enabling" : "Disabling") + " DynMap border display at the command of player \"" + player.getName() + "\"."); + sender.sendMessage("DynMap border display " + (Config.Debug() ? "enabled" : "disabled") + "."); if (player != null) - sender.sendMessage("DynMap border display " + (Config.Debug() ? "enabled" : "disabled") + "."); + Config.Log((Config.DynmapBorderEnabled() ? "Enabled" : "Disabled") + " DynMap border display at the command of player \"" + player.getName() + "\"."); } // "dynmapmsg" command from player or console