Cleaned up Javadoc comments.

This commit is contained in:
sk89q 2010-10-11 08:56:19 -07:00
parent eb70ac391a
commit 10703082ed
9 changed files with 81 additions and 68 deletions

View File

@ -54,7 +54,7 @@ public class CuboidClipboard {
/** /**
* Get the width (X-direction) of the clipboard. * Get the width (X-direction) of the clipboard.
* *
* @return * @return width
*/ */
public int getWidth() { public int getWidth() {
return (int)(max.getX() - min.getX() + 1); return (int)(max.getX() - min.getX() + 1);
@ -63,7 +63,7 @@ public class CuboidClipboard {
/** /**
* Get the length (Z-direction) of the clipboard. * Get the length (Z-direction) of the clipboard.
* *
* @return * @return length
*/ */
public int getLength() { public int getLength() {
return (int)(max.getZ() - min.getZ() + 1); return (int)(max.getZ() - min.getZ() + 1);
@ -72,7 +72,7 @@ public class CuboidClipboard {
/** /**
* Get the height (Y-direction) of the clipboard. * Get the height (Y-direction) of the clipboard.
* *
* @return * @return height
*/ */
public int getHeight() { public int getHeight() {
return (int)(max.getY() - min.getY() + 1); return (int)(max.getY() - min.getY() + 1);
@ -98,7 +98,7 @@ public class CuboidClipboard {
* Paste from the clipboard. * Paste from the clipboard.
* *
* @param editSession * @param editSession
* @param origin Position to paste it from * @param newOrigin Position to paste it from
* @param noAir True to not paste air * @param noAir True to not paste air
* @throws MaxChangedBlocksException * @throws MaxChangedBlocksException
*/ */
@ -148,7 +148,7 @@ public class CuboidClipboard {
* @param xm * @param xm
* @param ym * @param ym
* @param zm * @param zm
* @short count * @param count
* @param noAir * @param noAir
* @param moveOrigin move the origin * @param moveOrigin move the origin
* @throws MaxChangedBlocksException * @throws MaxChangedBlocksException
@ -234,7 +234,7 @@ public class CuboidClipboard {
* *
* @param path * @param path
* @param origin * @param origin
* @return * @return clipboard
* @throws SchematicException * @throws SchematicException
* @throws IOException * @throws IOException
*/ */

View File

@ -237,7 +237,7 @@ public class EditSession {
* Get the maximum number of blocks that can be changed. -1 will be * Get the maximum number of blocks that can be changed. -1 will be
* returned if disabled. * returned if disabled.
* *
* @return * @return block change limit
*/ */
public int getBlockChangeLimit() { public int getBlockChangeLimit() {
return maxBlocks; return maxBlocks;
@ -258,7 +258,7 @@ public class EditSession {
/** /**
* Returns queue status. * Returns queue status.
* *
* @return * @return whether the queue is enabled
*/ */
public boolean isQueueEnabled() { public boolean isQueueEnabled() {
return queued; return queued;
@ -302,7 +302,7 @@ public class EditSession {
* @param blockType * @param blockType
* @param radius * @param radius
* @param depth * @param depth
* @return * @return number of blocks affected
*/ */
public int fillXZ(int x, int z, Point origin, int blockType, int radius, int depth) public int fillXZ(int x, int z, Point origin, int blockType, int radius, int depth)
throws MaxChangedBlocksException { throws MaxChangedBlocksException {
@ -361,9 +361,9 @@ public class EditSession {
* Remove blocks above. * Remove blocks above.
* *
* @param pos * @param pos
* @param size, * @param size
* @param height * @param height
* @return * @return number of blocks affected
*/ */
public int removeAbove(Point pos, int size, int height) throws public int removeAbove(Point pos, int size, int height) throws
MaxChangedBlocksException { MaxChangedBlocksException {
@ -391,9 +391,9 @@ public class EditSession {
* Remove blocks below. * Remove blocks below.
* *
* @param pos * @param pos
* @param size, * @param size
* @param height * @param height
* @return * @return number of blocks affected
*/ */
public int removeBelow(Point pos, int size, int height) throws public int removeBelow(Point pos, int size, int height) throws
MaxChangedBlocksException { MaxChangedBlocksException {
@ -422,7 +422,7 @@ public class EditSession {
* *
* @param region * @param region
* @param blockType * @param blockType
* @return * @return number of blocks affected
* @throws MaxChangedBlocksException * @throws MaxChangedBlocksException
*/ */
public int setBlocks(Region region, int blockType) public int setBlocks(Region region, int blockType)
@ -462,7 +462,7 @@ public class EditSession {
* @param region * @param region
* @param fromBlockType -1 for non-air * @param fromBlockType -1 for non-air
* @param toBlockType * @param toBlockType
* @return * @return number of blocks affected
* @throws MaxChangedBlocksException * @throws MaxChangedBlocksException
*/ */
public int replaceBlocks(Region region, int fromBlockType, int toBlockType) public int replaceBlocks(Region region, int fromBlockType, int toBlockType)
@ -510,7 +510,7 @@ public class EditSession {
* *
* @param region * @param region
* @param blockType * @param blockType
* @return * @return number of blocks affected
* @throws MaxChangedBlocksException * @throws MaxChangedBlocksException
*/ */
public int makeCuboidFaces(Region region, int blockType) public int makeCuboidFaces(Region region, int blockType)
@ -549,10 +549,8 @@ public class EditSession {
* Overlays a layer of blocks over a cuboid area. * Overlays a layer of blocks over a cuboid area.
* *
* @param region * @param region
* @param upperY
* @param lowerY
* @param blockType * @param blockType
* @return * @return number of blocks affected
* @throws MaxChangedBlocksException * @throws MaxChangedBlocksException
*/ */
public int overlayCuboidBlocks(Region region, int blockType) public int overlayCuboidBlocks(Region region, int blockType)

View File

@ -44,7 +44,7 @@ public class ScriptMinecraftContext {
* @param z * @param z
* @param blockType * @param blockType
* @throws MaxChangedBlocksException * @throws MaxChangedBlocksException
* @return * @return whether the block was changed
*/ */
public boolean setBlock(int x, int y, int z, int blockType) public boolean setBlock(int x, int y, int z, int blockType)
throws MaxChangedBlocksException { throws MaxChangedBlocksException {
@ -57,7 +57,7 @@ public class ScriptMinecraftContext {
* @param x * @param x
* @param y * @param y
* @param z * @param z
* @return * @return block type ID
*/ */
public int getBlock(int x, int y, int z) { public int getBlock(int x, int y, int z) {
return editSession.getBlock(x, y, z); return editSession.getBlock(x, y, z);

View File

@ -212,7 +212,7 @@ public class WorldEdit extends Plugin {
/** /**
* Called on right click. * Called on right click.
* *
* @param player * @param modPlayer
* @param blockPlaced * @param blockPlaced
* @param blockClicked * @param blockClicked
* @param itemInHand * @param itemInHand
@ -264,9 +264,9 @@ public class WorldEdit extends Plugin {
/** /**
* *
* @param player * @param modPlayer
* @param split * @param split
* @return * @return whether the command was processed
*/ */
@Override @Override
public boolean onCommand(Player modPlayer, String[] split) { public boolean onCommand(Player modPlayer, String[] split) {

View File

@ -47,7 +47,7 @@ public class WorldEditPlayer {
/** /**
* Get the point of the block that is being stood upon. * Get the point of the block that is being stood upon.
* *
* @return * @return point
*/ */
public Point getBlockOn() { public Point getBlockOn() {
return Point.toBlockPoint(player.getX(), player.getY() - 1, player.getZ()); return Point.toBlockPoint(player.getX(), player.getY() - 1, player.getZ());
@ -56,7 +56,7 @@ public class WorldEditPlayer {
/** /**
* Get the point of the block that is being stood in. * Get the point of the block that is being stood in.
* *
* @return * @return point
*/ */
public Point getBlockIn() { public Point getBlockIn() {
return Point.toBlockPoint(player.getX(), player.getY(), player.getZ()); return Point.toBlockPoint(player.getX(), player.getY(), player.getZ());
@ -65,7 +65,7 @@ public class WorldEditPlayer {
/** /**
* Get the player's position. * Get the player's position.
* *
* @return * @return point
*/ */
public Point getPosition() { public Point getPosition() {
return new Point(player.getX(), player.getY(), player.getZ()); return new Point(player.getX(), player.getY(), player.getZ());
@ -74,7 +74,7 @@ public class WorldEditPlayer {
/** /**
* Get the player's view pitch. * Get the player's view pitch.
* *
* @return * @return pitch
*/ */
public double getPitch() { public double getPitch() {
return player.getPitch(); return player.getPitch();
@ -83,7 +83,7 @@ public class WorldEditPlayer {
/** /**
* Get the player's view yaw. * Get the player's view yaw.
* *
* @return * @return yaw
*/ */
public double getYaw() { public double getYaw() {
return player.getRotation(); return player.getRotation();
@ -176,7 +176,7 @@ public class WorldEditPlayer {
* Returns true if equal. * Returns true if equal.
* *
* @param other * @param other
* @return * @return whether the other object is equivalent
*/ */
@Override @Override
public boolean equals(Object other) { public boolean equals(Object other) {
@ -190,7 +190,7 @@ public class WorldEditPlayer {
/** /**
* Gets the hash code. * Gets the hash code.
* *
* @return * @return hash code
*/ */
@Override @Override
public int hashCode() { public int hashCode() {

View File

@ -45,8 +45,6 @@ public class WorldEditSession {
/** /**
* Get the edit session. * Get the edit session.
*
* @return
*/ */
public void remember(EditSession editSession) { public void remember(EditSession editSession) {
// Don't store anything if no changes were made // Don't store anything if no changes were made
@ -119,7 +117,7 @@ public class WorldEditSession {
/** /**
* Gets defined position 1. * Gets defined position 1.
* *
* @return * @return position 1
* @throws IncompleteRegionException * @throws IncompleteRegionException
*/ */
public Point getPos1() throws IncompleteRegionException { public Point getPos1() throws IncompleteRegionException {
@ -139,7 +137,7 @@ public class WorldEditSession {
/** /**
* Gets position 2. * Gets position 2.
* *
* @return * @return position 2
* @throws IncompleteRegionException * @throws IncompleteRegionException
*/ */
public Point getPos2() throws IncompleteRegionException { public Point getPos2() throws IncompleteRegionException {
@ -159,7 +157,7 @@ public class WorldEditSession {
/** /**
* Get the region. * Get the region.
* *
* @return * @return region
* @throws IncompleteRegionException * @throws IncompleteRegionException
*/ */
public Region getRegion() throws IncompleteRegionException { public Region getRegion() throws IncompleteRegionException {
@ -172,7 +170,7 @@ public class WorldEditSession {
/** /**
* Gets the clipboard. * Gets the clipboard.
* *
* @return * @return clipboard, may be null
*/ */
public CuboidClipboard getClipboard() { public CuboidClipboard getClipboard() {
return clipboard; return clipboard;
@ -190,7 +188,7 @@ public class WorldEditSession {
/** /**
* See if tool control is enabled. * See if tool control is enabled.
* *
* @return * @return true if enabled
*/ */
public boolean isToolControlEnabled() { public boolean isToolControlEnabled() {
return toolControl; return toolControl;
@ -199,7 +197,7 @@ public class WorldEditSession {
/** /**
* Change tool control setting. * Change tool control setting.
* *
* @param * @param toolControl
*/ */
public void setToolControl(boolean toolControl) { public void setToolControl(boolean toolControl) {
this.toolControl = toolControl; this.toolControl = toolControl;
@ -222,7 +220,7 @@ public class WorldEditSession {
/** /**
* Returns true if the tool has been double clicked. * Returns true if the tool has been double clicked.
* *
* @return * @return true if double clicked
*/ */
public boolean hasToolBeenDoubleClicked() { public boolean hasToolBeenDoubleClicked() {
return System.currentTimeMillis() - lastToolClick < 500; return System.currentTimeMillis() - lastToolClick < 500;
@ -237,7 +235,8 @@ public class WorldEditSession {
/** /**
* Get the maximum number of blocks that can be changed in an edit session. * Get the maximum number of blocks that can be changed in an edit session.
* @return *
* @return block change limit
*/ */
public int getBlockChangeLimit() { public int getBlockChangeLimit() {
return maxBlocksChanged; return maxBlocksChanged;

View File

@ -49,7 +49,7 @@ public class CuboidRegion implements Region {
/** /**
* Get the lower point of the cuboid. * Get the lower point of the cuboid.
* *
* @return * @return min point
*/ */
@Override @Override
public Point getMinimumPoint() { public Point getMinimumPoint() {
@ -61,7 +61,7 @@ public class CuboidRegion implements Region {
/** /**
* Get the upper point of the cuboid. * Get the upper point of the cuboid.
* *
* @return * @return max point
*/ */
@Override @Override
public Point getMaximumPoint() { public Point getMaximumPoint() {
@ -73,7 +73,7 @@ public class CuboidRegion implements Region {
/** /**
* Get the number of blocks in the region. * Get the number of blocks in the region.
* *
* @return * @return number of blocks
*/ */
public int getSize() { public int getSize() {
Point min = getMinimumPoint(); Point min = getMinimumPoint();
@ -87,7 +87,7 @@ public class CuboidRegion implements Region {
/** /**
* Get X-size. * Get X-size.
* *
* @return * @return width
*/ */
public int getWidth() { public int getWidth() {
Point min = getMinimumPoint(); Point min = getMinimumPoint();
@ -99,7 +99,7 @@ public class CuboidRegion implements Region {
/** /**
* Get Y-size. * Get Y-size.
* *
* @return * @return height
*/ */
public int getHeight() { public int getHeight() {
Point min = getMinimumPoint(); Point min = getMinimumPoint();
@ -111,7 +111,7 @@ public class CuboidRegion implements Region {
/** /**
* Get Z-size. * Get Z-size.
* *
* @return * @return length
*/ */
public int getLength() { public int getLength() {
Point min = getMinimumPoint(); Point min = getMinimumPoint();
@ -123,7 +123,7 @@ public class CuboidRegion implements Region {
/** /**
* Get the iterator. * Get the iterator.
* *
* @return * @return iterator of Points
*/ */
public Iterator<Point> iterator() { public Iterator<Point> iterator() {
throw new UnsupportedOperationException("Not implemented"); throw new UnsupportedOperationException("Not implemented");

View File

@ -131,7 +131,9 @@ public final class Point {
/** /**
* Adds two points. * Adds two points.
* *
* @param other * @param x
* @param y
* @param z
* @return New point * @return New point
*/ */
public Point add(double x, double y, double z) { public Point add(double x, double y, double z) {
@ -141,7 +143,9 @@ public final class Point {
/** /**
* Adds two points. * Adds two points.
* *
* @param other * @param x
* @param y
* @param z
* @return New point * @return New point
*/ */
public Point add(int x, int y, int z) { public Point add(int x, int y, int z) {
@ -151,7 +155,7 @@ public final class Point {
/** /**
* Adds points. * Adds points.
* *
* @param other * @param others
* @return New point * @return New point
*/ */
public Point add(Point ... others) { public Point add(Point ... others) {
@ -178,7 +182,9 @@ public final class Point {
/** /**
* Subtract two points. * Subtract two points.
* *
* @param other * @param x
* @param y
* @param z
* @return New point * @return New point
*/ */
public Point subtract(double x, double y, double z) { public Point subtract(double x, double y, double z) {
@ -188,7 +194,9 @@ public final class Point {
/** /**
* Subtract two points. * Subtract two points.
* *
* @param other * @param x
* @param y
* @param z
* @return New point * @return New point
*/ */
public Point subtract(int x, int y, int z) { public Point subtract(int x, int y, int z) {
@ -198,7 +206,7 @@ public final class Point {
/** /**
* Subtract points. * Subtract points.
* *
* @param other * @param others
* @return New point * @return New point
*/ */
public Point subtract(Point ... others) { public Point subtract(Point ... others) {
@ -225,7 +233,9 @@ public final class Point {
/** /**
* Multiply two points. * Multiply two points.
* *
* @param other * @param x
* @param y
* @param z
* @return New point * @return New point
*/ */
public Point multiply(double x, double y, double z) { public Point multiply(double x, double y, double z) {
@ -235,7 +245,9 @@ public final class Point {
/** /**
* Multiply two points. * Multiply two points.
* *
* @param other * @param x
* @param y
* @param z
* @return New point * @return New point
*/ */
public Point multiply(int x, int y, int z) { public Point multiply(int x, int y, int z) {
@ -245,7 +257,7 @@ public final class Point {
/** /**
* Multiply points. * Multiply points.
* *
* @param other * @param others
* @return New point * @return New point
*/ */
public Point multiply(Point ... others) { public Point multiply(Point ... others) {
@ -272,7 +284,9 @@ public final class Point {
/** /**
* Divide two points. * Divide two points.
* *
* @param other * @param x
* @param y
* @param z
* @return New point * @return New point
*/ */
public Point divide(double x, double y, double z) { public Point divide(double x, double y, double z) {
@ -282,7 +296,9 @@ public final class Point {
/** /**
* Divide two points. * Divide two points.
* *
* @param other * @param x
* @param y
* @param z
* @return New point * @return New point
*/ */
public Point divide(int x, int y, int z) { public Point divide(int x, int y, int z) {
@ -295,7 +311,7 @@ public final class Point {
* @param x * @param x
* @param y * @param y
* @param z * @param z
* @return * @return point
*/ */
public static Point toBlockPoint(double x, double y, double z) { public static Point toBlockPoint(double x, double y, double z) {
return new Point((int)Math.floor(x), return new Point((int)Math.floor(x),
@ -307,7 +323,7 @@ public final class Point {
* Checks if another object is equivalent. * Checks if another object is equivalent.
* *
* @param obj * @param obj
* @return * @return whether the other object is equivalent
*/ */
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
@ -322,7 +338,7 @@ public final class Point {
/** /**
* Gets the hash code. * Gets the hash code.
* *
* @return * @return hash code
*/ */
@Override @Override
public int hashCode() { public int hashCode() {

View File

@ -27,37 +27,37 @@ public interface Region extends Iterable<Point> {
/** /**
* Get the lower point of a region. * Get the lower point of a region.
* *
* @return * @return min. point
*/ */
public Point getMinimumPoint(); public Point getMinimumPoint();
/** /**
* Get the upper point of a region. * Get the upper point of a region.
* *
* @return * @return max. point
*/ */
public Point getMaximumPoint(); public Point getMaximumPoint();
/** /**
* Get the number of blocks in the region. * Get the number of blocks in the region.
* *
* @return * @return number of blocks
*/ */
public int getSize(); public int getSize();
/** /**
* Get X-size. * Get X-size.
* *
* @return * @return width
*/ */
public int getWidth(); public int getWidth();
/** /**
* Get Y-size. * Get Y-size.
* *
* @return * @return height
*/ */
public int getHeight(); public int getHeight();
/** /**
* Get Z-size. * Get Z-size.
* *
* @return * @return length
*/ */
public int getLength(); public int getLength();
} }