From 373e4b90c99aac53c32dcfce1f0d2763ebbc6ca7 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Thu, 1 Mar 2012 20:47:19 -0800 Subject: [PATCH] Clean up some stray 128 values and update the defaults --- pom.xml | 2 +- .../java/com/sk89q/worldedit/LocalPlayer.java | 6 +- .../java/com/sk89q/worldedit/LocalWorld.java | 78 +++++++++---------- .../sk89q/worldedit/regions/CuboidRegion.java | 8 +- .../worldedit/regions/Polygonal2DRegion.java | 54 ++++++------- 5 files changed, 74 insertions(+), 74 deletions(-) diff --git a/pom.xml b/pom.xml index df203b871..ac33b95cd 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ org.bukkit bukkit - 1.1-R5-SNAPSHOT + 1.1-R6 diff --git a/src/main/java/com/sk89q/worldedit/LocalPlayer.java b/src/main/java/com/sk89q/worldedit/LocalPlayer.java index adba059f5..298aaffe0 100644 --- a/src/main/java/com/sk89q/worldedit/LocalPlayer.java +++ b/src/main/java/com/sk89q/worldedit/LocalPlayer.java @@ -77,7 +77,7 @@ public abstract class LocalPlayer { byte free = 0; - while (y <= 129) { + while (y <= world.getMaxY() + 2) { if (BlockType.canPassThrough(world.getBlockType(new Vector(x, y, z)))) { ++free; } else { @@ -142,7 +142,7 @@ public abstract class LocalPlayer { byte free = 0; byte spots = 0; - while (y <= 129) { + while (y <= world.getMaxY() + 2) { if (BlockType.canPassThrough(world.getBlockType(new Vector(x, y, z)))) { ++free; } else { @@ -266,7 +266,7 @@ public abstract class LocalPlayer { int maxY = Math.min(getWorld().getMaxY() + 1, initialY + distance); LocalWorld world = getPosition().getWorld(); - while (y <= 129) { + while (y <= world.getMaxY() + 2) { if (!BlockType.canPassThrough(world.getBlockType(new Vector(x, y, z)))) { break; // Hit something } else if (y > maxY + 1) { diff --git a/src/main/java/com/sk89q/worldedit/LocalWorld.java b/src/main/java/com/sk89q/worldedit/LocalWorld.java index b226c525c..6e65cf1f6 100644 --- a/src/main/java/com/sk89q/worldedit/LocalWorld.java +++ b/src/main/java/com/sk89q/worldedit/LocalWorld.java @@ -28,7 +28,7 @@ import com.sk89q.worldedit.regions.Region; /** * Represents a world. - * + * * @author sk89q */ public abstract class LocalWorld { @@ -49,14 +49,14 @@ public abstract class LocalWorld { /** * Get the name of the world. - * + * * @return */ public abstract String getName(); /** * Set block type. - * + * * @param pt * @param type * @return @@ -65,7 +65,7 @@ public abstract class LocalWorld { /** * Set block type. - * + * * @param pt * @param type * @return @@ -76,7 +76,7 @@ public abstract class LocalWorld { /** * Get block type. - * + * * @param pt * @return */ @@ -84,7 +84,7 @@ public abstract class LocalWorld { /** * Set block data. - * + * * @param pt * @param data */ @@ -93,7 +93,7 @@ public abstract class LocalWorld { /** * Set block data. - * + * * @param pt * @param data */ @@ -117,7 +117,7 @@ public abstract class LocalWorld { * @param pt * @param type * @param data - * @return + * @return */ public boolean setTypeIdAndDataFast(Vector pt, int type, int data) { boolean ret = setBlockTypeFast(pt, type); @@ -127,7 +127,7 @@ public abstract class LocalWorld { /** * Get block data. - * + * * @param pt * @return */ @@ -135,7 +135,7 @@ public abstract class LocalWorld { /** * Get block light level. - * + * * @param pt * @return */ @@ -143,7 +143,7 @@ public abstract class LocalWorld { /** * Regenerate an area. - * + * * @param region * @param editSession * @return @@ -152,7 +152,7 @@ public abstract class LocalWorld { /** * Attempts to accurately copy a BaseBlock's extra data to the world. - * + * * @param pt * @param block * @return @@ -161,7 +161,7 @@ public abstract class LocalWorld { /** * Attempts to read a BaseBlock's extra data from the world. - * + * * @param pt * @param block * @return @@ -170,7 +170,7 @@ public abstract class LocalWorld { /** * Clear a chest's contents. - * + * * @param pt * @return */ @@ -178,7 +178,7 @@ public abstract class LocalWorld { /** * Generate a tree at a location. - * + * * @param editSession * @param pt * @return @@ -189,7 +189,7 @@ public abstract class LocalWorld { /** * Generate a big tree at a location. - * + * * @param editSession * @param pt * @return @@ -200,7 +200,7 @@ public abstract class LocalWorld { /** * Generate a birch tree at a location. - * + * * @param editSession * @param pt * @return @@ -211,7 +211,7 @@ public abstract class LocalWorld { /** * Generate a redwood tree at a location. - * + * * @param editSession * @param pt * @return @@ -222,20 +222,20 @@ public abstract class LocalWorld { /** * Generate a tall redwood tree at a location. - * - * @param editSession + * + * @param editSession * @param pt * @return - * @throws MaxChangedBlocksException + * @throws MaxChangedBlocksException */ public abstract boolean generateTallRedwoodTree(EditSession editSession, Vector pt) throws MaxChangedBlocksException; /** * Drop an item. - * + * * @param pt - * @param item + * @param item * @param times */ public void dropItem(Vector pt, BaseItemStack item, int times) { @@ -246,7 +246,7 @@ public abstract class LocalWorld { /** * Drop an item. - * + * * @param pt * @param item */ @@ -254,7 +254,7 @@ public abstract class LocalWorld { /** * Simulate a block being mined. - * + * * @param pt */ public void simulateBlockMine(Vector pt) { @@ -273,7 +273,7 @@ public abstract class LocalWorld { /** * Kill mobs in an area, excluding pet wolves. - * + * * @param origin * @param radius * @return @@ -285,7 +285,7 @@ public abstract class LocalWorld { /** * Kill mobs in an area. - * + * * @param origin * @param radius -1 for all mobs * @param flags various flags that determine what to kill @@ -298,7 +298,7 @@ public abstract class LocalWorld { /** * Kill mobs in an area. - * + * * @param origin * @param radius * @param killflags @@ -310,8 +310,8 @@ public abstract class LocalWorld { /** * Remove entities in an area. - * - * @param type + * + * @param type * @param origin * @param radius * @return @@ -320,17 +320,17 @@ public abstract class LocalWorld { /** * Returns whether a block has a valid ID. - * + * * @param type * @return */ public boolean isValidBlockType(int type) { return BlockType.fromID(type) != null; } - + /** * Returns whether a block uses its data value. - * + * * @param type block ID type * @return true if the block uses data value */ @@ -349,7 +349,7 @@ public abstract class LocalWorld { /** * Compare if the other world is equal. - * + * * @param other * @return */ @@ -358,7 +358,7 @@ public abstract class LocalWorld { /** * Hash code. - * + * * @return */ @Override @@ -366,16 +366,16 @@ public abstract class LocalWorld { /** * Get the world's height - * + * * @return */ public int getMaxY() { - return 127; + return 255; } /** * Does some post-processing. Should be called after using fast mode - * + * * @param chunks the chunks to fix */ public void fixAfterFastMode(Iterable chunks) { @@ -419,7 +419,7 @@ public abstract class LocalWorld { private int taskId = -1; public boolean queueBlockBreakEffect(ServerInterface server, Vector position, int blockId, double priority) { if (taskId == -1) { - taskId = server.schedule(0, 1, new Runnable() { + taskId = server.schedule(0, 1, new Runnable() { public void run() { int max = Math.max(1, Math.min(30, effectQueue.size() / 3)); for (int i = 0; i < max; ++i) { diff --git a/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java b/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java index 2c7e3936a..58f10a563 100644 --- a/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java +++ b/src/main/java/com/sk89q/worldedit/regions/CuboidRegion.java @@ -50,10 +50,10 @@ public class CuboidRegion extends AbstractRegion { public CuboidRegion(Vector pos1, Vector pos2) { this(null, pos1, pos2); } - + /** * Construct a new instance of this cuboid region. - * + * * @param world * @param pos1 * @param pos2 @@ -239,8 +239,8 @@ public class CuboidRegion extends AbstractRegion { } private void recalculate() { - pos1 = pos1.clampY(0, world == null ? 127 : world.getMaxY()); - pos2 = pos2.clampY(0, world == null ? 127 : world.getMaxY()); + pos1 = pos1.clampY(0, world == null ? 255 : world.getMaxY()); + pos2 = pos2.clampY(0, world == null ? 255 : world.getMaxY()); } @Override diff --git a/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java b/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java index f4164bb01..d9f49cd8d 100644 --- a/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java +++ b/src/main/java/com/sk89q/worldedit/regions/Polygonal2DRegion.java @@ -54,7 +54,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Construct the region. - * + * * @param world */ public Polygonal2DRegion(LocalWorld world) { @@ -64,7 +64,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Construct the region. - * + * * @param world * @param points * @param minY @@ -86,7 +86,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Get the list of points. - * + * * @return */ public List getPoints() { @@ -123,8 +123,8 @@ public class Polygonal2DRegion extends AbstractRegion { minY = Math.min(oldMinY, oldMaxY); maxY = Math.max(oldMinY, oldMaxY); - minY = Math.min(Math.max(0, minY), world == null ? 127 : world.getMaxY()); - maxY = Math.min(Math.max(0, maxY), world == null ? 127 : world.getMaxY()); + minY = Math.min(Math.max(0, minY), world == null ? 255 : world.getMaxY()); + maxY = Math.min(Math.max(0, maxY), world == null ? 255 : world.getMaxY()); min = new BlockVector(minX, minY, minZ); max = new BlockVector(maxX, maxY, maxZ); @@ -132,7 +132,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Add a point to the list. - * + * * @param pt */ public void addPoint(Vector2D pt) { @@ -142,7 +142,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Add a point to the list. - * + * * @param pt */ public void addPoint(BlockVector2D pt) { @@ -152,7 +152,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Add a point to the list. - * + * * @param pt */ public void addPoint(Vector pt) { @@ -162,7 +162,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Get the minimum Y. - * + * * @return min y */ public int getMininumY() { @@ -171,7 +171,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Set the minimum Y. - * + * * @param y */ public void setMinimumY(int y) { @@ -182,7 +182,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Get the maximum Y. - * + * * @return max y */ public int getMaximumY() { @@ -191,7 +191,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Set the maximum Y. - * + * * @param y */ public void setMaximumY(int y) { @@ -202,7 +202,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Get the lower point of a region. - * + * * @return min. point */ public Vector getMinimumPoint() { @@ -211,7 +211,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Get the upper point of a region. - * + * * @return max. point */ public Vector getMaximumPoint() { @@ -220,7 +220,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Get the number of blocks in the region. - * + * * @return number of blocks */ public int getArea() { @@ -328,12 +328,12 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Checks to see if a point is inside a region. - * - * @param points - * @param minY - * @param maxY - * @param pt - * @return + * + * @param points + * @param minY + * @param maxY + * @param pt + * @return */ public static boolean contains(List points, int minY, int maxY, Vector pt) { @@ -396,7 +396,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Get a list of chunks. - * + * * @return */ public Set getChunks() { @@ -421,7 +421,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Return the number of points. - * + * * @return */ public int size() { @@ -430,8 +430,8 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Expand the height of the polygon to fit the specified Y. - * - * @param y + * + * @param y * @return true if the area was expanded */ public boolean expandY(int y) { @@ -453,7 +453,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Get the iterator. - * + * * @return iterator of points inside the region */ @Override @@ -464,7 +464,7 @@ public class Polygonal2DRegion extends AbstractRegion { /** * Returns string representation in the format * "(x1, z1) - ... - (xN, zN) * (minY - maxY)" - * + * * @return string */ @Override