Cleaned up documentation, added lacking Java annotations.

This commit is contained in:
sk89q 2011-02-18 15:49:50 -08:00
parent e5a25496b2
commit e94c1d4874
49 changed files with 269 additions and 140 deletions

View File

@ -37,6 +37,7 @@ public class PermissionsResolverServerListener extends ServerListener {
*
* @param event Relevant event details
*/
@Override
public void onPluginEnabled(PluginEvent event) {
String name = event.getPlugin().getDescription().getName();
@ -50,6 +51,7 @@ public class PermissionsResolverServerListener extends ServerListener {
*
* @param event Relevant event details
*/
@Override
public void onPluginDisabled(PluginEvent event) {
String name = event.getPlugin().getDescription().getName();

View File

@ -204,6 +204,7 @@ public class CommandsManager {
* @param player
* @param methodArgs
* @return
* @throws Throwable
*/
public boolean execute(String[] args, CommandsPlayer player,
Object[] methodArgs) throws Throwable {
@ -219,6 +220,7 @@ public class CommandsManager {
* @param methodArgs
* @param level
* @return
* @throws Throwable
*/
public boolean executeMethod(Method parent, String[] args,
CommandsPlayer player, Object[] methodArgs, int level)

View File

@ -67,6 +67,7 @@ public class StringUtil {
* @param str
* @param delimiter
* @param initialIndex
* @param quote
* @return
*/
public static String joinQuotedString(String[] str, String delimiter,
@ -89,7 +90,6 @@ public class StringUtil {
*
* @param str
* @param delimiter
* @param initialIndex
* @return
*/
public static String joinString(String[] str, String delimiter) {

View File

@ -37,7 +37,9 @@ public class BlockVector extends Vector {
/**
* Construct the Vector object.
*
* @param pt
* @param x
* @param y
* @param z
*/
public BlockVector(int x, int y, int z) {
super(x, y, z);
@ -46,7 +48,10 @@ public class BlockVector extends Vector {
/**
* Construct the Vector object.
*
* @param pt
*
* @param x
* @param y
* @param z
*/
public BlockVector(float x, float y, float z) {
super(x, y, z);
@ -55,7 +60,10 @@ public class BlockVector extends Vector {
/**
* Construct the Vector object.
*
* @param pt
*
* @param x
* @param y
* @param z
*/
public BlockVector(double x, double y, double z) {
super(x, y, z);

View File

@ -37,7 +37,8 @@ public class BlockVector2D extends Vector2D {
/**
* Construct the Vector object.
*
* @param pt
* @param x
* @param z
*/
public BlockVector2D(int x, int z) {
super(x, z);
@ -46,7 +47,8 @@ public class BlockVector2D extends Vector2D {
/**
* Construct the Vector object.
*
* @param pt
* @param x
* @param z
*/
public BlockVector2D(float x, float z) {
super(x, z);
@ -55,7 +57,8 @@ public class BlockVector2D extends Vector2D {
/**
* Construct the Vector object.
*
* @param pt
* @param x
* @param z
*/
public BlockVector2D(double x, double z) {
super(x, z);

View File

@ -36,6 +36,7 @@ public class BlockWorldVector extends WorldVector {
/**
* Construct the Vector object.
* @param world
*
* @param pt
*/
@ -46,7 +47,10 @@ public class BlockWorldVector extends WorldVector {
/**
* Construct the Vector object.
*
* @param pt
* @param world
* @param x
* @param y
* @param z
*/
public BlockWorldVector(LocalWorld world, int x, int y, int z) {
super(world, x, y, z);
@ -55,7 +59,10 @@ public class BlockWorldVector extends WorldVector {
/**
* Construct the Vector object.
*
* @param pt
* @param world
* @param x
* @param y
* @param z
*/
public BlockWorldVector(LocalWorld world, float x, float y, float z) {
super(world, x, y, z);
@ -64,7 +71,10 @@ public class BlockWorldVector extends WorldVector {
/**
* Construct the Vector object.
*
* @param pt
* @param world
* @param x
* @param y
* @param z
*/
public BlockWorldVector(LocalWorld world, double x, double y, double z) {
super(world, x, y, z);

View File

@ -22,6 +22,7 @@ package com.sk89q.worldedit;
/**
*
* @author sk89q
* @param <T>
*/
public class Countable<T> implements Comparable<Countable<T>> {
/**

View File

@ -78,6 +78,7 @@ public class CuboidClipboard {
*
* @param size
* @param origin
* @param offset
*/
public CuboidClipboard(Vector size, Vector origin, Vector offset) {
this.size = size;
@ -373,7 +374,6 @@ public class CuboidClipboard {
* Load a .schematic file into a clipboard.
*
* @param path
* @param origin
* @return clipboard
* @throws DataException
* @throws IOException
@ -556,7 +556,7 @@ public class CuboidClipboard {
}
/**
* @param origin the offset to set
* @param offset
*/
public void setOffset(Vector offset) {
this.offset = offset;

View File

@ -30,6 +30,8 @@ import java.util.NoSuchElementException;
* Double array lists to work like a Map, but not really.
*
* @author sk89q
* @param <A>
* @param <B>
*/
public class DoubleArrayList<A,B> implements Iterable<Map.Entry<A,B>> {
/**
@ -101,8 +103,7 @@ public class DoubleArrayList<A,B> implements Iterable<Map.Entry<A,B>> {
/**
* Entry iterator.
*
* @param <A>
* @param <B>
* @param <T>
*/
public class ForwardEntryIterator<T extends Map.Entry<A,B>>
implements Iterator<Map.Entry<A,B>> {
@ -131,8 +132,7 @@ public class DoubleArrayList<A,B> implements Iterable<Map.Entry<A,B>> {
/**
* Entry iterator.
*
* @param <A>
* @param <B>
* @param <T>
*/
public class ReverseEntryIterator<T extends Map.Entry<A,B>>
implements Iterator<Map.Entry<A,B>> {
@ -161,8 +161,8 @@ public class DoubleArrayList<A,B> implements Iterable<Map.Entry<A,B>> {
/**
* Class to masquerade as Map.Entry.
*
* @param <A>
* @param <B>
* @param <C>
* @param <D>
*/
public class Entry<C,D> implements Map.Entry<A,B> {
private A key;

View File

@ -393,6 +393,8 @@ public class EditSession {
/**
* Restores all blocks to their initial state.
*
* @param sess
*/
public void undo(EditSession sess) {
for (Map.Entry<BlockVector, BaseBlock> entry : original) {
@ -404,6 +406,8 @@ public class EditSession {
/**
* Sets to new state.
*
* @param sess
*/
public void redo(EditSession sess) {
for (Map.Entry<BlockVector, BaseBlock> entry : current) {
@ -416,6 +420,7 @@ public class EditSession {
/**
* Get the number of changed blocks.
*
* @return
*/
public int size() {
return original.size();
@ -505,6 +510,7 @@ public class EditSession {
* @param depth
* @param recursive
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
public int fillXZ(Vector origin, BaseBlock block, int radius, int depth,
boolean recursive) throws MaxChangedBlocksException {
@ -609,6 +615,7 @@ public class EditSession {
* @param depth
* @param recursive
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
public int fillXZ(Vector origin, Pattern pattern, int radius, int depth,
boolean recursive) throws MaxChangedBlocksException {
@ -711,6 +718,7 @@ public class EditSession {
* @param size
* @param height
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
public int removeAbove(Vector pos, int size, int height)
throws MaxChangedBlocksException {
@ -745,6 +753,7 @@ public class EditSession {
* @param size
* @param height
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
public int removeBelow(Vector pos, int size, int height)
throws MaxChangedBlocksException {
@ -779,6 +788,7 @@ public class EditSession {
* @param blockType
* @param size
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
public int removeNear(Vector pos, int blockType, int size)
throws MaxChangedBlocksException {
@ -859,7 +869,7 @@ public class EditSession {
* Sets all the blocks inside a region to a certain block type.
*
* @param region
* @param block
* @param pattern
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
@ -905,9 +915,8 @@ public class EditSession {
* Replaces all the blocks of a type inside a region to another block type.
*
* @param region
* @param fromBlockType
* -1 for non-air
* @param toBlockType
* @param fromBlockTypes -1 for non-air
* @param toBlock
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
@ -963,8 +972,7 @@ public class EditSession {
* Replaces all the blocks of a type inside a region to another block type.
*
* @param region
* @param fromBlockType
* -1 for non-air
* @param fromBlockTypes -1 for non-air
* @param pattern
* @return number of blocks affected
* @throws MaxChangedBlocksException
@ -1395,6 +1403,8 @@ public class EditSession {
*
* @param pos
* @param radius
* @param moving
* @param stationary
* @return number of blocks affected
* @throws MaxChangedBlocksException
*/
@ -1826,9 +1836,9 @@ public class EditSession {
*
* @param pos
* @param block
* @param c
* 0-1 chance
* @param c 0-1 chance
* @return whether a block was changed
* @throws MaxChangedBlocksException
*/
public boolean setChanceBlockIfAir(Vector pos, BaseBlock block, double c)
throws MaxChangedBlocksException {
@ -1917,6 +1927,7 @@ public class EditSession {
* @param basePos
* @param size
* @return number of trees created
* @throws MaxChangedBlocksException
*/
public int makePumpkinPatches(Vector basePos, int size)
throws MaxChangedBlocksException {
@ -1959,6 +1970,7 @@ public class EditSession {
* @param density
* @param treeGenerator
* @return number of trees created
* @throws MaxChangedBlocksException
*/
public int makeForest(Vector basePos, int size, double density,
TreeGenerator treeGenerator) throws MaxChangedBlocksException {

View File

@ -15,7 +15,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
*/
package com.sk89q.worldedit;
@ -56,7 +56,6 @@ public abstract class LocalWorld {
*
* @param pt
* @param data
* @return
*/
public abstract void setBlockData(Vector pt, int data);
@ -90,14 +89,17 @@ public abstract class LocalWorld {
* Clear a chest's contents.
*
* @param pt
* @return
*/
public abstract boolean clearContainerBlockContents(Vector pt);
/**
* Generate a tree at a location.
*
* @param editSession
* @param pt
* @return
* @throws MaxChangedBlocksException
*/
public abstract boolean generateTree(EditSession editSession, Vector pt)
throws MaxChangedBlocksException;
@ -105,8 +107,10 @@ public abstract class LocalWorld {
/**
* Generate a big tree at a location.
*
* @param editSession
* @param pt
* @return
* @throws MaxChangedBlocksException
*/
public abstract boolean generateBigTree(EditSession editSession, Vector pt)
throws MaxChangedBlocksException;
@ -114,8 +118,10 @@ public abstract class LocalWorld {
/**
* Generate a birch tree at a location.
*
* @param editSession
* @param pt
* @return
* @throws MaxChangedBlocksException
*/
public abstract boolean generateBirchTree(EditSession editSession, Vector pt)
throws MaxChangedBlocksException;
@ -123,30 +129,33 @@ public abstract class LocalWorld {
/**
* Generate a redwood tree at a location.
*
* @param editSession
* @param pt
* @return
* @throws MaxChangedBlocksException
*/
public abstract boolean generateRedwoodTree(EditSession editSession, Vector pt)
throws MaxChangedBlocksException;
public abstract boolean generateRedwoodTree(EditSession editSession,
Vector pt) throws MaxChangedBlocksException;
/**
* Generate a tall redwood tree at a location.
*
* @param editSession
* @param pt
* @return
* @throws MaxChangedBlocksException
*/
public abstract boolean generateTallRedwoodTree(EditSession editSession, Vector pt)
throws MaxChangedBlocksException;
public abstract boolean generateTallRedwoodTree(EditSession editSession,
Vector pt) throws MaxChangedBlocksException;
/**
* Drop an item.
*
* @param pt
* @param type
* @param count
* @param item
* @param times
*/
public void dropItem(Vector pt,BaseItemStack item, int times) {
public void dropItem(Vector pt, BaseItemStack item, int times) {
for (int i = 0; i < times; i++) {
dropItem(pt, item);
}
@ -157,8 +166,6 @@ public abstract class LocalWorld {
*
* @param pt
* @param item
* @param count
* @param times
*/
public abstract void dropItem(Vector pt, BaseItemStack item);
@ -169,56 +176,114 @@ public abstract class LocalWorld {
*/
public void simulateBlockMine(Vector pt) {
int type = getBlockType(pt);
//setBlockType(pt, 0);
// setBlockType(pt, 0);
if (type == 1) { dropItem(pt, new BaseItemStack(4)); } // Stone
else if (type == 2) { dropItem(pt, new BaseItemStack(3)); } // Grass
else if (type == 7) { } // Bedrock
else if (type == 8) { } // Water
else if (type == 9) { } // Water
else if (type == 10) { } // Lava
else if (type == 11) { } // Lava
if (type == 1) {
dropItem(pt, new BaseItemStack(4));
} // Stone
else if (type == 2) {
dropItem(pt, new BaseItemStack(3));
} // Grass
else if (type == 7) {
} // Bedrock
else if (type == 8) {
} // Water
else if (type == 9) {
} // Water
else if (type == 10) {
} // Lava
else if (type == 11) {
} // Lava
else if (type == 13) { // Gravel
dropItem(pt, new BaseItemStack(type));
if (random.nextDouble() >= 0.9) {
dropItem(pt, new BaseItemStack(318));
}
}
else if (type == 16) { dropItem(pt, new BaseItemStack(263)); } // Coal ore
else if (type == 17) { dropItem(pt, new BaseItemStack(17, 1, (short)getBlockData(pt))); } // Log
} else if (type == 16) {
dropItem(pt, new BaseItemStack(263));
} // Coal ore
else if (type == 17) {
dropItem(pt, new BaseItemStack(17, 1, (short) getBlockData(pt)));
} // Log
else if (type == 18) { // Leaves
if (random.nextDouble() > 0.95) {
dropItem(pt, new BaseItemStack(6));
}
}
else if (type == 20) { } // Glass
else if (type == 21) { dropItem(pt, new BaseItemStack(351, 1, (short)4), (random.nextInt(5)+4)); }
else if (type == 35) { dropItem(pt, new BaseItemStack(35, 1, (short)getBlockData(pt))); } // Cloth
else if (type == 43) { dropItem(pt, new BaseItemStack(44)); } // Double step
else if (type == 47) { } // Bookshelves
else if (type == 51) { } // Fire
else if (type == 52) { } // Mob spawner
else if (type == 53) { dropItem(pt, new BaseItemStack(5)); } // Wooden stairs
else if (type == 55) { dropItem(pt, new BaseItemStack(331)); } // Redstone wire
else if (type == 56) { dropItem(pt, new BaseItemStack(264)); } // Diamond ore
else if (type == 59) { dropItem(pt, new BaseItemStack(295)); } // Crops
else if (type == 60) { dropItem(pt, new BaseItemStack(3)); } // Soil
else if (type == 62) { dropItem(pt, new BaseItemStack(61)); } // Furnace
else if (type == 63) { dropItem(pt, new BaseItemStack(323)); } // Sign post
else if (type == 64) { dropItem(pt, new BaseItemStack(324)); } // Wood door
else if (type == 67) { dropItem(pt, new BaseItemStack(4)); } // Cobblestone stairs
else if (type == 68) { dropItem(pt, new BaseItemStack(323)); } // Wall sign
else if (type == 71) { dropItem(pt, new BaseItemStack(330)); } // Iron door
else if (type == 73) { dropItem(pt, new BaseItemStack(331), (random.nextInt(2)+4)); } // Redstone ore
else if (type == 74) { dropItem(pt, new BaseItemStack(331), (random.nextInt(2)+4)); } // Glowing redstone ore
else if (type == 75) { dropItem(pt, new BaseItemStack(76)); } // Redstone torch
else if (type == 78) { } // Snow
else if (type == 79) { } // Ice
else if (type == 82) { dropItem(pt, new BaseItemStack(337), 4); } // Clay
else if (type == 83) { dropItem(pt, new BaseItemStack(338)); } // Reed
else if (type == 89) { dropItem(pt, new BaseItemStack(348)); } // Lightstone
else if (type == 90) { } // Portal
} else if (type == 20) {
} // Glass
else if (type == 21) {
dropItem(pt, new BaseItemStack(351, 1, (short) 4),
(random.nextInt(5) + 4));
} else if (type == 35) {
dropItem(pt, new BaseItemStack(35, 1, (short) getBlockData(pt)));
} // Cloth
else if (type == 43) {
dropItem(pt, new BaseItemStack(44));
} // Double step
else if (type == 47) {
} // Bookshelves
else if (type == 51) {
} // Fire
else if (type == 52) {
} // Mob spawner
else if (type == 53) {
dropItem(pt, new BaseItemStack(5));
} // Wooden stairs
else if (type == 55) {
dropItem(pt, new BaseItemStack(331));
} // Redstone wire
else if (type == 56) {
dropItem(pt, new BaseItemStack(264));
} // Diamond ore
else if (type == 59) {
dropItem(pt, new BaseItemStack(295));
} // Crops
else if (type == 60) {
dropItem(pt, new BaseItemStack(3));
} // Soil
else if (type == 62) {
dropItem(pt, new BaseItemStack(61));
} // Furnace
else if (type == 63) {
dropItem(pt, new BaseItemStack(323));
} // Sign post
else if (type == 64) {
dropItem(pt, new BaseItemStack(324));
} // Wood door
else if (type == 67) {
dropItem(pt, new BaseItemStack(4));
} // Cobblestone stairs
else if (type == 68) {
dropItem(pt, new BaseItemStack(323));
} // Wall sign
else if (type == 71) {
dropItem(pt, new BaseItemStack(330));
} // Iron door
else if (type == 73) {
dropItem(pt, new BaseItemStack(331), (random.nextInt(2) + 4));
} // Redstone ore
else if (type == 74) {
dropItem(pt, new BaseItemStack(331), (random.nextInt(2) + 4));
} // Glowing redstone ore
else if (type == 75) {
dropItem(pt, new BaseItemStack(76));
} // Redstone torch
else if (type == 78) {
} // Snow
else if (type == 79) {
} // Ice
else if (type == 82) {
dropItem(pt, new BaseItemStack(337), 4);
} // Clay
else if (type == 83) {
dropItem(pt, new BaseItemStack(338));
} // Reed
else if (type == 89) {
dropItem(pt, new BaseItemStack(348));
} // Lightstone
else if (type == 90) {
} // Portal
else if (type != 0) {
dropItem(pt, new BaseItemStack(type));
}
@ -239,11 +304,14 @@ public abstract class LocalWorld {
* @param other
* @return
*/
@Override
public abstract boolean equals(Object other);
/**
* Hash code.
*
* @return
*/
@Override
public abstract int hashCode();
}

View File

@ -31,6 +31,7 @@ import java.io.StringWriter;
* @author sk89q
*/
public class LogFormat extends Formatter {
@Override
public String format(LogRecord record) {
StringBuilder text = new StringBuilder();
Level level = record.getLevel();

View File

@ -437,7 +437,6 @@ public class Vector {
/**
* Get the length of the vector.
*
* @param pt
* @return distance
*/
public double length() {
@ -473,7 +472,6 @@ public class Vector {
/**
* Get the normalized vector.
*
* @param pt
* @return vector
*/
public Vector normalize() {
@ -520,12 +518,11 @@ public class Vector {
/**
* 2D transformation.
*
* @param vec
* @param angle in degrees
* @param aboutX
* @param aboutY
* @param aboutZ
* @param translateX
* @param translateY
* @param translateZ
* @return
*/
public Vector transform2D(double angle,
@ -557,9 +554,6 @@ public class Vector {
/**
* Get a block point from a point.
*
* @param x
* @param y
* @param z
* @return point
*/
public BlockVector toBlockPoint() {

View File

@ -21,7 +21,7 @@ package com.sk89q.worldedit;
/**
*
* @author Albert
* @author sk89q
*/
public class Vector2D {
protected final double x, z;
@ -52,7 +52,6 @@ public class Vector2D {
* Construct the Vector2D object.
*
* @param x
* @param y
* @param z
*/
public Vector2D(float x, float z) {

View File

@ -33,6 +33,7 @@ public class WorldVector extends Vector {
/**
* Construct the Vector object.
*
* @param world
* @param x
* @param y
* @param z
@ -45,6 +46,7 @@ public class WorldVector extends Vector {
/**
* Construct the Vector object.
*
* @param world
* @param x
* @param y
* @param z
@ -57,6 +59,7 @@ public class WorldVector extends Vector {
/**
* Construct the Vector object.
*
* @param world
* @param x
* @param y
* @param z
@ -69,6 +72,7 @@ public class WorldVector extends Vector {
/**
* Construct the Vector object.
*
* @param world
* @param pt
*/
public WorldVector(LocalWorld world, Vector pt) {
@ -78,6 +82,8 @@ public class WorldVector extends Vector {
/**
* Construct the Vector object.
*
* @param world
*/
public WorldVector(LocalWorld world) {
super();
@ -96,6 +102,7 @@ public class WorldVector extends Vector {
/**
* Get a block point from a point.
*
* @param world
* @param x
* @param y
* @param z

View File

@ -105,6 +105,7 @@ public abstract class BlockBag {
* Get a block.
*
* @param id
* @throws BlockBagException
*/
public abstract void fetchBlock(int id) throws BlockBagException;
@ -112,6 +113,7 @@ public abstract class BlockBag {
* Store a block.
*
* @param id
* @throws BlockBagException
*/
public abstract void storeBlock(int id) throws BlockBagException;
@ -140,14 +142,12 @@ public abstract class BlockBag {
* Adds a position to be used a source.
*
* @param pos
* @return
*/
public abstract void addSourcePosition(Vector pos);
/**
* Adds a position to be used a source.
*
* @param pos
* @return
*/
public abstract void addSingleSourcePosition(Vector pos);
}

View File

@ -49,6 +49,7 @@ public class BaseBlock {
* Construct the block with its type and data.
*
* @param type
* @param data
*/
public BaseBlock(int type, int data) {
this.type = (short)type;

View File

@ -48,6 +48,7 @@ public class BaseItem {
* Construct the object.
*
* @param id
* @param damage
*/
public BaseItem(int id, short damage) {
this.id = id;

View File

@ -43,6 +43,7 @@ public class BaseItemStack extends BaseItem {
* Construct the object.
*
* @param id
* @param amount
*/
public BaseItemStack(int id, int amount) {
super(id);
@ -53,6 +54,8 @@ public class BaseItemStack extends BaseItem {
* Construct the object.
*
* @param id
* @param amount
* @param damage
*/
public BaseItemStack(int id, int amount, short damage) {
super(id, damage);

View File

@ -284,7 +284,6 @@ public enum BlockType {
/**
* Checks to see whether a block should be placed last.
*
* @param id
* @return
*/
public boolean shouldPlaceLast() {

View File

@ -77,8 +77,6 @@ public class ChestBlock extends BaseBlock implements TileEntityBlock, ContainerB
/**
* Set the list of items.
*
* @return
*/
public void setItems(BaseItemStack[] items) {
this.items = items;

View File

@ -35,7 +35,7 @@ public interface ContainerBlock {
/**
* Set the list of items.
*
* @return
* @param items
*/
public void setItems(BaseItemStack[] items);
}

View File

@ -77,8 +77,6 @@ public class DispenserBlock extends BaseBlock implements TileEntityBlock, Contai
/**
* Set the list of items.
*
* @return
*/
public void setItems(BaseItemStack[] items) {
this.items = items;

View File

@ -49,6 +49,8 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe
/**
* Construct the chest block.
*
* @param type
*/
public FurnaceBlock(int type) {
super(type);
@ -58,6 +60,7 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe
/**
* Construct the chest block.
*
* @param type
* @param data
*/
public FurnaceBlock(int type, int data) {
@ -68,6 +71,7 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe
/**
* Construct the chest block.
*
* @param type
* @param data
* @param items
*/
@ -87,8 +91,6 @@ public class FurnaceBlock extends BaseBlock implements TileEntityBlock, Containe
/**
* Set the list of items.
*
* @return
*/
public void setItems(BaseItemStack[] items) {
this.items = items;

View File

@ -90,7 +90,7 @@ public class MobSpawnerBlock extends BaseBlock implements TileEntityBlock {
/**
* Set the mob type.
*
* @return
* @param mobType
*/
public void setMobType(String mobType) {
this.mobType = mobType;

View File

@ -36,8 +36,6 @@ public class NoteBlock extends BaseBlock implements TileEntityBlock {
/**
* Construct the note block.
*
* @param data
*/
public NoteBlock() {
super(25);
@ -57,6 +55,7 @@ public class NoteBlock extends BaseBlock implements TileEntityBlock {
/**
* Construct the note block.
*
* @param data
* @param note
*/
public NoteBlock(int data, byte note) {

View File

@ -37,7 +37,8 @@ public class SignBlock extends BaseBlock implements TileEntityBlock {
/**
* Construct the sign without text.
*
* @param text
* @param type
* @param data
*/
public SignBlock(int type, int data) {
super(type, data);
@ -47,6 +48,8 @@ public class SignBlock extends BaseBlock implements TileEntityBlock {
/**
* Construct the sign with text.
*
* @param type
* @param data
* @param text
*/
public SignBlock(int type, int data, String[] text) {

View File

@ -66,6 +66,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
*
* @param id
*/
@Override
public void fetchBlock(int id) throws BlockBagException {
if (id == 0) {
throw new IllegalArgumentException("Can't fetch air block");
@ -111,6 +112,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
*
* @param id
*/
@Override
public void storeBlock(int id) throws BlockBagException {
if (id == 0) {
throw new IllegalArgumentException("Can't store air block");
@ -163,6 +165,7 @@ public class BukkitPlayerBlockBag extends BlockBag {
/**
* Flush any changes. This is called at the end.
*/
@Override
public void flushChanges() {
if (items != null) {
player.getInventory().setContents(items);
@ -174,16 +177,17 @@ public class BukkitPlayerBlockBag extends BlockBag {
* Adds a position to be used a source.
*
* @param pos
* @return
*/
@Override
public void addSourcePosition(Vector pos) {
}
/**
* Adds a position to be used a source.
*
* @param pos
* @return
*/
@Override
public void addSingleSourcePosition(Vector pos) {
}
}

View File

@ -46,6 +46,7 @@ public class WorldEditBlockListener extends BlockListener {
*
* @param event Relevant event details
*/
@Override
public void onBlockDamage(BlockDamageEvent event) {
LocalWorld world = new BukkitWorld(event.getBlock().getWorld());
WorldVector pos = new WorldVector(world, event.getBlock().getX(),
@ -62,6 +63,7 @@ public class WorldEditBlockListener extends BlockListener {
*
* @param event Relevant event details
*/
@Override
public void onBlockRightClick(BlockRightClickEvent event) {
LocalWorld world = new BukkitWorld(event.getBlock().getWorld());
WorldVector pos = new WorldVector(world, event.getBlock().getX(),

View File

@ -52,6 +52,7 @@ public class AlphaChunkStore extends NestedFileChunkStore {
* @throws DataException
* @throws IOException
*/
@Override
protected InputStream getInputStream(String f1, String f2, String name)
throws DataException, IOException {
String file = f1 + File.separator + f2 + File.separator + name;

View File

@ -38,12 +38,13 @@ public class Chunk {
private byte[] data;
private int rootX;
private int rootZ;
Map<BlockVector,Map<String,Tag>> tileEntities;
private Map<BlockVector,Map<String,Tag>> tileEntities;
/**
* Construct the chunk with a compound tag.
*
* @param rootTag
* @param tag
* @throws DataException
*/
public Chunk(CompoundTag tag) throws DataException {
rootTag = tag;

View File

@ -34,8 +34,6 @@ public abstract class ChunkStore {
*
* @param pos
* @return
* @throws ChunkStoreException
* @throws IOException
*/
public static BlockVector2D toChunk(Vector pos) {
int chunkX = (int)Math.floor(pos.getBlockX() / 16.0);
@ -58,8 +56,7 @@ public abstract class ChunkStore {
/**
* Get a chunk at a location.
*
* @param x
* @param z
* @param pos
* @return
* @throws ChunkStoreException
* @throws IOException

View File

@ -56,7 +56,6 @@ public abstract class NestedFileChunkStore extends ChunkStore {
* separator.
*
* @param pos
* @param separator
* @return
*/
public static String getFilename(Vector2D pos) {
@ -71,6 +70,7 @@ public abstract class NestedFileChunkStore extends ChunkStore {
* @throws DataException
* @throws IOException
*/
@Override
public CompoundTag getChunkTag(Vector2D pos)
throws DataException, IOException {
int x = pos.getBlockX();

View File

@ -89,6 +89,7 @@ public class TrueZipAlphaChunkStore extends NestedFileChunkStore {
* @throws DataException
* @throws IOException
*/
@Override
protected InputStream getInputStream(String f1, String f2, String name)
throws DataException, IOException {
String file = f1 + File.separator + f2 + File.separator + name;

View File

@ -54,7 +54,7 @@ public class TrueZipLegacyAlphaChunkStore extends NestedFileChunkStore {
* @param zipFile
* @param folder
* @throws IOException
* @throws ZIPException
* @throws ZipException
*/
public TrueZipLegacyAlphaChunkStore(File zipFile, String folder)
throws IOException, ZipException {
@ -69,9 +69,8 @@ public class TrueZipLegacyAlphaChunkStore extends NestedFileChunkStore {
* be detected.
*
* @param zipFile
* @param folder
* @throws IOException
* @throws ZIPException
* @throws ZipException
*/
public TrueZipLegacyAlphaChunkStore(File zipFile)
throws IOException, ZipException {
@ -90,6 +89,7 @@ public class TrueZipLegacyAlphaChunkStore extends NestedFileChunkStore {
* @throws IOException
* @throws DataException
*/
@Override
@SuppressWarnings("unchecked")
protected InputStream getInputStream(String f1, String f2, String name)
throws IOException, DataException {
@ -160,6 +160,7 @@ public class TrueZipLegacyAlphaChunkStore extends NestedFileChunkStore {
*
* @throws IOException
*/
@Override
public void close() throws IOException {
zip.close();
}

View File

@ -52,7 +52,7 @@ public class ZippedAlphaChunkStore extends NestedFileChunkStore {
* @param zipFile
* @param folder
* @throws IOException
* @throws ZIPException
* @throws ZipException
*/
public ZippedAlphaChunkStore(File zipFile, String folder)
throws IOException, ZipException {
@ -67,9 +67,8 @@ public class ZippedAlphaChunkStore extends NestedFileChunkStore {
* be detected.
*
* @param zipFile
* @param folder
* @throws IOException
* @throws ZIPException
* @throws ZipException
*/
public ZippedAlphaChunkStore(File zipFile)
throws IOException, ZipException {
@ -88,6 +87,7 @@ public class ZippedAlphaChunkStore extends NestedFileChunkStore {
* @throws IOException
* @throws DataException
*/
@Override
protected InputStream getInputStream(String f1, String f2, String name)
throws IOException, DataException {
String file = f1 + "/" + f2 + "/" + name;
@ -157,6 +157,7 @@ public class ZippedAlphaChunkStore extends NestedFileChunkStore {
*
* @throws IOException
*/
@Override
public void close() throws IOException {
zip.close();
}

View File

@ -35,6 +35,7 @@ public interface Mask {
* as getting a BaseBlock has unneeded overhead in most block querying
* situations (enumerating a chest's contents is a waste, for example).
*
* @param editSession
* @param pos
* @return
*/

View File

@ -40,7 +40,7 @@ public class ClipboardPattern implements Pattern {
/**
* Construct the object.
*
* @param blockType
* @param clipboard
*/
public ClipboardPattern(CuboidClipboard clipboard) {
this.clipboard = clipboard;

View File

@ -43,7 +43,7 @@ public class RandomFillPattern implements Pattern {
/**
* Construct the object.
*
* @param blockType
* @param blocks
*/
public RandomFillPattern(List<BlockChance> blocks) {
double max = 0;

View File

@ -36,7 +36,7 @@ public class SingleBlockPattern implements Pattern {
/**
* Construct the object.
*
* @param blockType
* @param block
*/
public SingleBlockPattern(BaseBlock block) {
this.block = block;

View File

@ -134,7 +134,6 @@ public class CraftScriptContext extends CraftScriptEnvironment {
/**
* Checks to make sure that there are enough but not too many arguments.
*
* @param args
* @param min
* @param max -1 for no maximum
* @param usage usage string
@ -179,6 +178,8 @@ public class CraftScriptContext extends CraftScriptEnvironment {
*
* @param list
* @return pattern
* @throws UnknownItemException
* @throws DisallowedItemException
*/
public Pattern getBlockPattern(String list)
throws UnknownItemException, DisallowedItemException {
@ -191,6 +192,8 @@ public class CraftScriptContext extends CraftScriptEnvironment {
* @param list
* @param allBlocksAllowed
* @return set
* @throws UnknownItemException
* @throws DisallowedItemException
*/
public Set<Integer> getBlockIDs(String list, boolean allBlocksAllowed)
throws UnknownItemException, DisallowedItemException {

View File

@ -28,12 +28,14 @@ public class RhinoContextFactory extends ContextFactory {
this.timeLimit = timeLimit;
}
@Override
protected Context makeContext() {
RhinoContext cx = new RhinoContext(this);
cx.setInstructionObserverThreshold(10000);
return cx;
}
@Override
protected void observeInstructionCount(Context cx, int instructionCount) {
RhinoContext mcx = (RhinoContext)cx;
long currentTime = System.currentTimeMillis();
@ -43,6 +45,7 @@ public class RhinoContextFactory extends ContextFactory {
}
}
@Override
protected Object doTopCall(Callable callable, Context cx, Scriptable scope,
Scriptable thisObj, Object[] args) {
RhinoContext mcx = (RhinoContext)cx;

View File

@ -39,8 +39,7 @@ public class Snapshot {
/**
* Construct a snapshot restoration operation.
*
* @param editSession
* @param dir
* @param repo
* @param snapshot
*/
public Snapshot(SnapshotRepository repo, String snapshot) {
@ -53,6 +52,7 @@ public class Snapshot {
*
* @return
* @throws IOException
* @throws DataException
*/
public ChunkStore getChunkStore() throws IOException, DataException {
if (file.getName().toLowerCase().endsWith(".zip")) {

View File

@ -102,7 +102,7 @@ public class SnapshotRepository {
/**
* Check to see if a snapshot is valid.
*
* @param dir
* @param snapshot
* @return whether it is a valid snapshot
*/
public boolean isValidSnapshotName(String snapshot) {

View File

@ -58,6 +58,7 @@ public class SnapshotRestore {
/**
* Construct the snapshot restore operation.
*
* @param chunkStore
* @param region
*/
public SnapshotRestore(ChunkStore chunkStore, Region region) {
@ -131,7 +132,7 @@ public class SnapshotRestore {
* Restores to world.
*
* @param editSession
* @param region
* @throws MaxChangedBlocksException
*/
public void restore(EditSession editSession)
throws MaxChangedBlocksException {

View File

@ -33,7 +33,7 @@ public interface BrushShape {
/**
* Build the object.
*
* @param build
* @param editSession
* @param pos
* @param mat
* @param size

View File

@ -70,6 +70,7 @@ public class FileDialogUtil {
desc = StringUtil.joinString(exts, ",");
}
@Override
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
@ -83,6 +84,7 @@ public class FileDialogUtil {
}
}
@Override
public String getDescription() {
return desc;
}

View File

@ -51,6 +51,7 @@ public class PropertiesConfiguration extends LocalConfiguration {
/**
* Load the configuration file.
*/
@Override
public void load() {
InputStream stream = null;
try {

View File

@ -107,7 +107,6 @@ public class TreeGenerator {
/**
* Generate a tree.
*
* @param world
* @param editSession
* @param pos
* @return