From b074a34ee3b1882f123fbee87d0a0c69d9a01f98 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sun, 14 Apr 2013 06:39:48 -0500 Subject: [PATCH] Release 1.7.1; for real this time, without a nasty bug, and with wrapping value properly retained after running other commands such as radius or wshape --- src/com/wimbli/WorldBorder/BorderData.java | 2 +- src/com/wimbli/WorldBorder/Config.java | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/com/wimbli/WorldBorder/BorderData.java b/src/com/wimbli/WorldBorder/BorderData.java index 11f5bb9..4cbb36c 100644 --- a/src/com/wimbli/WorldBorder/BorderData.java +++ b/src/com/wimbli/WorldBorder/BorderData.java @@ -61,7 +61,7 @@ public class BorderData } public final void setData(double x, double z, int radiusX, int radiusZ, Boolean shapeRound) { - setData(x, z, radiusZ, radiusZ, shapeRound, false); + setData(x, z, radiusX, radiusZ, shapeRound, false); } public final void setData(double x, double z, int radius, Boolean shapeRound) { diff --git a/src/com/wimbli/WorldBorder/Config.java b/src/com/wimbli/WorldBorder/Config.java index 28e900a..096178a 100644 --- a/src/com/wimbli/WorldBorder/Config.java +++ b/src/com/wimbli/WorldBorder/Config.java @@ -61,13 +61,16 @@ public class Config public static void setBorder(String world, int radiusX, int radiusZ, double x, double z, Boolean shapeRound) { - setBorder(world, new BorderData(x, z, radiusX, radiusZ, shapeRound)); + BorderData old = Border(world); + boolean oldWrap = (old == null) ? false : old.getWrapping(); + setBorder(world, new BorderData(x, z, radiusX, radiusZ, shapeRound, oldWrap)); } public static void setBorder(String world, int radiusX, int radiusZ, double x, double z) { BorderData old = Border(world); Boolean oldShape = (old == null) ? null : old.getShape(); - setBorder(world, new BorderData(x, z, radiusX, radiusZ, oldShape)); + boolean oldWrap = (old == null) ? false : old.getWrapping(); + setBorder(world, new BorderData(x, z, radiusX, radiusZ, oldShape, oldWrap)); } @@ -83,19 +86,24 @@ public class Config // set border based on corner coordinates - public static void setBorderCorners(String world, double x1, double z1, double x2, double z2, Boolean shapeRound) + public static void setBorderCorners(String world, double x1, double z1, double x2, double z2, Boolean shapeRound, boolean wrap) { double radiusX = Math.abs(x1 - x2) / 2; double radiusZ = Math.abs(z1 - z2) / 2; double x = ((x1 < x2) ? x1 : x2) + radiusX; double z = ((z1 < z2) ? z1 : z2) + radiusZ; - setBorder(world, new BorderData(x, z, (int)Math.round(radiusX), (int)Math.round(radiusZ), shapeRound)); + setBorder(world, new BorderData(x, z, (int)Math.round(radiusX), (int)Math.round(radiusZ), shapeRound, wrap)); + } + public static void setBorderCorners(String world, double x1, double z1, double x2, double z2, Boolean shapeRound) + { + setBorderCorners(world, x1, z1, x2, z2, shapeRound, false); } public static void setBorderCorners(String world, double x1, double z1, double x2, double z2) { BorderData old = Border(world); Boolean oldShape = (old == null) ? null : old.getShape(); - setBorderCorners(world, x1, z1, x2, z2, oldShape); + boolean oldWrap = (old == null) ? false : old.getWrapping(); + setBorderCorners(world, x1, z1, x2, z2, oldShape, oldWrap); }