From b05a72fea1e8c584b4d2bf107ecfab7671052b52 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Tue, 3 Jan 2012 03:20:19 +0100 Subject: [PATCH] Made the fields in Polygonal2DRegion private. --- .../worldedit/regions/Polygonal2DRegion.java | 24 ++++++++++++------- .../regions/Polygonal2DRegionSelector.java | 8 +++---- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java b/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java index 561c3f200..f3a4cbca0 100644 --- a/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java +++ b/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java @@ -38,13 +38,13 @@ import com.sk89q.worldedit.data.ChunkStore; * @author sk89q */ public class Polygonal2DRegion implements Region { - protected List points; - protected BlockVector min; - protected BlockVector max; - protected int minY; - protected int maxY; - protected boolean hasY = false; - protected LocalWorld world; + private List points; + private BlockVector min; + private BlockVector max; + private int minY; + private int maxY; + private boolean hasY = false; + private LocalWorld world; /** * Construct the region @@ -52,7 +52,7 @@ public class Polygonal2DRegion implements Region { public Polygonal2DRegion() { this((LocalWorld) null); } - + /** * Construct the region. * @@ -597,4 +597,12 @@ public class Polygonal2DRegion implements Region { public void setWorld(LocalWorld world) { this.world = world; } + + public int getMinY() { + return minY; + } + + public int getMaxY() { + return maxY; + } } diff --git a/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java b/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java index e15be5961..2811c58de 100644 --- a/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java +++ b/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegionSelector.java @@ -124,18 +124,18 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion { session.dispatchCUIEvent(player, new SelectionShapeEvent(getTypeID())); session.dispatchCUIEvent(player, new SelectionPoint2DEvent(0, pos, getArea())); - session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.minY, region.maxY)); + session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinY(), region.getMaxY())); } public void explainSecondarySelection(LocalPlayer player, LocalSession session, Vector pos) { player.print("Added point #" + region.size() + " at " + pos + "."); session.dispatchCUIEvent(player, new SelectionPoint2DEvent(region.size() - 1, pos, getArea())); - session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.minY, region.maxY)); + session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinY(), region.getMaxY())); } public void explainRegionAdjust(LocalPlayer player, LocalSession session) { - session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.minY, region.maxY)); + session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinY(), region.getMaxY())); } public BlockVector getPrimaryPosition() throws IncompleteRegionException { @@ -194,7 +194,7 @@ public class Polygonal2DRegionSelector implements RegionSelector, CUIRegion { session.dispatchCUIEvent(player, new SelectionPoint2DEvent(id, points.get(id), getArea())); } - session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.minY, region.maxY)); + session.dispatchCUIEvent(player, new SelectionMinMaxEvent(region.getMinY(), region.getMaxY())); } public void describeLegacyCUI(LocalSession session, LocalPlayer player) {