Pulling all pending Bukkit-JavaDoc changes

A special thanks goes to @aerouk for almost all of the changes found here.

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot
2013-12-15 01:07:43 -05:00
parent 800679913f
commit bb50f1a774
310 changed files with 4218 additions and 2904 deletions

View File

@@ -20,6 +20,14 @@ public enum Action {
RIGHT_CLICK_AIR,
/**
* Stepping onto or into a block (Ass-pressure)
*
* Examples:
* <ul>
* <li>Jumping on soil
* <li>Standing on pressure plate
* <li>Triggering redstone ore
* <li>Triggering tripwire
* </ul>
*/
PHYSICAL,
}

View File

@@ -8,20 +8,23 @@ import org.bukkit.event.HandlerList;
/**
* Called when a block is broken by a player.
* <p>
* If you wish to have the block drop experience, you must set the experience value above 0.
* By default, experience will be set in the event if:
* If you wish to have the block drop experience, you must set the experience
* value above 0. By default, experience will be set in the event if:
* <ol>
* <li />The player is not in creative or adventure mode
* <li />The player can loot the block (ie: does not destroy it completely, by using the correct tool)
* <li />The player does not have silk touch
* <li />The block drops experience in vanilla Minecraft
* <li>The player is not in creative or adventure mode
* <li>The player can loot the block (ie: does not destroy it completely, by
* using the correct tool)
* <li>The player does not have silk touch
* <li>The block drops experience in vanilla Minecraft
* </ol>
* <p>
* Note:
* Plugins wanting to simulate a traditional block drop should set the block to air and utilize their own methods for determining
* what the default drop for the block being broken is and what to do about it, if anything.
* Plugins wanting to simulate a traditional block drop should set the block
* to air and utilize their own methods for determining what the default drop
* for the block being broken is and what to do about it, if anything.
* <p>
* If a Block Break event is cancelled, the block will not break and experience will not drop.
* If a Block Break event is cancelled, the block will not break and
* experience will not drop.
*/
public class BlockBreakEvent extends BlockExpEvent implements Cancellable {
private final Player player;

View File

@@ -7,7 +7,8 @@ import org.bukkit.event.HandlerList;
/**
* Called when a block is destroyed as a result of being burnt by fire.
* <p>
* If a Block Burn event is cancelled, the block will not be destroyed as a result of being burnt by fire.
* If a Block Burn event is cancelled, the block will not be destroyed as a
* result of being burnt by fire.
*/
public class BlockBurnEvent extends BlockEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();

View File

@@ -9,13 +9,16 @@ import org.bukkit.event.HandlerList;
* <p>
* Note:
* <ul>
* <li>The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.</li>
* <li>If you want to figure out what is being placed, use {@link #getMaterial()} or {@link #getMaterialId()} instead.</li>
* <li>The Block returned by getBlock() is the block we are trying to place
* on, not the block we are trying to place.
* <li>If you want to figure out what is being placed, use {@link
* #getMaterial()} or {@link #getMaterialId()} instead.
* </ul>
*/
public class BlockCanBuildEvent extends BlockEvent {
private static final HandlerList handlers = new HandlerList();
protected boolean buildable;
/**
*
* @deprecated Magic value
@@ -36,7 +39,9 @@ public class BlockCanBuildEvent extends BlockEvent {
/**
* Gets whether or not the block can be built here.
* By default, returns Minecraft's answer on whether the block can be built here or not.
* <p>
* By default, returns Minecraft's answer on whether the block can be
* built here or not.
*
* @return boolean whether or not the block can be built
*/
@@ -47,7 +52,8 @@ public class BlockCanBuildEvent extends BlockEvent {
/**
* Sets whether the block can be built here or not.
*
* @param cancel true if you want to allow the block to be built here despite Minecraft's default behaviour
* @param cancel true if you want to allow the block to be built here
* despite Minecraft's default behaviour
*/
public void setBuildable(boolean cancel) {
this.buildable = cancel;

View File

@@ -38,7 +38,8 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable {
/**
* Gets if the block is set to instantly break when damaged by the player.
*
* @return true if the block should instantly break when damaged by the player
* @return true if the block should instantly break when damaged by the
* player
*/
public boolean getInstaBreak() {
return instaBreak;
@@ -47,7 +48,8 @@ public class BlockDamageEvent extends BlockEvent implements Cancellable {
/**
* Sets if the block should instantly break when damaged by the player.
*
* @param bool true if you want the block to instantly break when damaged by the player
* @param bool true if you want the block to instantly break when damaged
* by the player
*/
public void setInstaBreak(boolean bool) {
this.instaBreak = bool;

View File

@@ -9,7 +9,8 @@ import org.bukkit.util.Vector;
/**
* Called when an item is dispensed from a block.
* <p>
* If a Block Dispense event is cancelled, the block will not dispense the item.
* If a Block Dispense event is cancelled, the block will not dispense the
* item.
*/
public class BlockDispenseEvent extends BlockEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -24,8 +25,9 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
}
/**
* Gets the item that is being dispensed. Modifying the returned item
* will have no effect, you must use {@link #setItem(org.bukkit.inventory.ItemStack)} instead.
* Gets the item that is being dispensed. Modifying the returned item will
* have no effect, you must use {@link
* #setItem(org.bukkit.inventory.ItemStack)} instead.
*
* @return An ItemStack for the item being dispensed
*/
@@ -45,7 +47,8 @@ public class BlockDispenseEvent extends BlockEvent implements Cancellable {
/**
* Gets the velocity.
* <p>
* Note: Modifying the returned Vector will not change the velocity, you must use {@link #setVelocity(org.bukkit.util.Vector)} instead.
* Note: Modifying the returned Vector will not change the velocity, you
* must use {@link #setVelocity(org.bukkit.util.Vector)} instead.
*
* @return A Vector for the dispensed item's velocity
*/

View File

@@ -26,7 +26,8 @@ public class BlockExpEvent extends BlockEvent {
}
/**
* Set the amount of experience dropped by the block after the event has processed
* Set the amount of experience dropped by the block after the event has
* processed
*
* @param exp 1 or higher to drop experience, else nothing will drop
*/

View File

@@ -10,12 +10,13 @@ import org.bukkit.event.HandlerList;
* <p>
* Examples:
* <ul>
* <li>Snow melting due to being near a light source.</li>
* <li>Ice melting due to being near a light source.</li>
* <li>Fire burning out after time, without destroying fuel block.</li>
* <li>Snow melting due to being near a light source.
* <li>Ice melting due to being near a light source.
* <li>Fire burning out after time, without destroying fuel block.
* </ul>
* <p>
* If a Block Fade event is cancelled, the block will not fade, melt or disappear.
* If a Block Fade event is cancelled, the block will not fade, melt or
* disappear.
*/
public class BlockFadeEvent extends BlockEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@@ -29,9 +30,11 @@ public class BlockFadeEvent extends BlockEvent implements Cancellable {
}
/**
* Gets the state of the block that will be fading, melting or disappearing.
* Gets the state of the block that will be fading, melting or
* disappearing.
*
* @return The block state of the block that will be fading, melting or disappearing
* @return The block state of the block that will be fading, melting or
* disappearing
*/
public BlockState getNewState() {
return newState;

View File

@@ -7,12 +7,14 @@ import org.bukkit.event.HandlerList;
/**
* Called when a block is formed or spreads based on world conditions.
* Use {@link BlockSpreadEvent} to catch blocks that actually spread and don't just "randomly" form.
* <p>
* Use {@link BlockSpreadEvent} to catch blocks that actually spread and don't
* just "randomly" form.
* <p>
* Examples:
* <ul>
* <li>Snow forming due to a snow storm.</li>
* <li>Ice forming in a snowy Biome like Taiga or Tundra.</li>
* <li>Snow forming due to a snow storm.
* <li>Ice forming in a snowy Biome like Taiga or Tundra.
* </ul>
* <p>
* If a Block Form event is cancelled, the block will not be formed.

View File

@@ -6,10 +6,11 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Represents events with a source block and a destination block, currently only applies to liquid (lava and water)
* and teleporting dragon eggs.
* Represents events with a source block and a destination block, currently
* only applies to liquid (lava and water) and teleporting dragon eggs.
* <p>
* If a Block From To event is cancelled, the block will not move (the liquid will not flow).
* If a Block From To event is cancelled, the block will not move (the liquid
* will not flow).
*/
public class BlockFromToEvent extends BlockEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();

View File

@@ -10,11 +10,11 @@ import org.bukkit.event.HandlerList;
* <p>
* Examples:
* <ul>
* <li>Wheat</li>
* <li>Sugar Cane</li>
* <li>Cactus</li>
* <li>Watermelon</li>
* <li>Pumpkin</li>
* <li>Wheat
* <li>Sugar Cane
* <li>Cactus
* <li>Watermelon
* <li>Pumpkin
* </ul>
* <p>
* If a Block Grow event is cancelled, the block will not grow.

View File

@@ -7,7 +7,8 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Called when a block is ignited. If you want to catch when a Player places fire, you need to use {@link BlockPlaceEvent}.
* Called when a block is ignited. If you want to catch when a Player places
* fire, you need to use {@link BlockPlaceEvent}.
* <p>
* If a Block Ignite event is cancelled, the block will not be ignited.
*/
@@ -19,7 +20,8 @@ public class BlockIgniteEvent extends BlockEvent implements Cancellable {
private boolean cancel;
/**
* Deprecated. Use {@link BlockIgniteEvent#BlockIgniteEvent(Block, IgniteCause, Entity)} instead.
* @deprecated use {@link BlockIgniteEvent#BlockIgniteEvent(Block,
* IgniteCause, Entity)} instead.
*/
@Deprecated
public BlockIgniteEvent(final Block theBlock, final IgniteCause cause, final Player thePlayer) {

View File

@@ -5,6 +5,9 @@ import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.event.Cancellable;
/**
* Called when a piston block is triggered
*/
public abstract class BlockPistonEvent extends BlockEvent implements Cancellable {
private boolean cancelled;
private final BlockFace direction;

View File

@@ -8,6 +8,9 @@ import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.event.HandlerList;
/**
* Called when a piston extends
*/
public class BlockPistonExtendEvent extends BlockPistonEvent {
private static final HandlerList handlers = new HandlerList();
private final int length;
@@ -29,7 +32,8 @@ public class BlockPistonExtendEvent extends BlockPistonEvent {
}
/**
* Get an immutable list of the blocks which will be moved by the extending.
* Get an immutable list of the blocks which will be moved by the
* extending.
*
* @return Immutable list of the moved blocks.
*/

View File

@@ -5,6 +5,9 @@ import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.event.HandlerList;
/**
* Called when a piston retracts
*/
public class BlockPistonRetractEvent extends BlockPistonEvent {
private static final HandlerList handlers = new HandlerList();
public BlockPistonRetractEvent(final Block block, final BlockFace direction) {
@@ -12,8 +15,8 @@ public class BlockPistonRetractEvent extends BlockPistonEvent {
}
/**
* Gets the location where the possible moving block might be if the retracting
* piston is sticky.
* Gets the location where the possible moving block might be if the
* retracting piston is sticky.
*
* @return The possible location of the possibly moving block.
*/

View File

@@ -49,8 +49,8 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
}
/**
* Clarity method for getting the placed block. Not really needed
* except for reasons of clarity.
* Clarity method for getting the placed block. Not really needed except
* for reasons of clarity.
*
* @return The Block that was placed
*/
@@ -59,7 +59,8 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
}
/**
* Gets the BlockState for the block which was replaced. Material type air mostly.
* Gets the BlockState for the block which was replaced. Material type air
* mostly.
*
* @return The BlockState for the block which was replaced.
*/
@@ -79,7 +80,8 @@ public class BlockPlaceEvent extends BlockEvent implements Cancellable {
/**
* Gets the item in the player's hand when they placed the block.
*
* @return The ItemStack for the item in the player's hand when they placed the block
* @return The ItemStack for the item in the player's hand when they
* placed the block
*/
public ItemStack getItemInHand() {
return itemInHand;

View File

@@ -6,12 +6,14 @@ import org.bukkit.event.HandlerList;
/**
* Called when a block spreads based on world conditions.
* Use {@link BlockFormEvent} to catch blocks that "randomly" form instead of actually spread.
* <p>
* Use {@link BlockFormEvent} to catch blocks that "randomly" form instead of
* actually spread.
* <p>
* Examples:
* <ul>
* <li>Mushrooms spreading.</li>
* <li>Fire spreading.</li>
* <li>Mushrooms spreading.
* <li>Fire spreading.
* </ul>
* <p>
* If a Block Spread event is cancelled, the block will not spread.

View File

@@ -9,7 +9,7 @@ import org.bukkit.entity.Entity;
* <p>
* Examples:
* <ul>
* <li>Snow formed by a {@link org.bukkit.entity.Snowman}.</li>
* <li>Snow formed by a {@link org.bukkit.entity.Snowman}.
* </ul>
*/
public class EntityBlockFormEvent extends BlockFormEvent {

View File

@@ -7,7 +7,8 @@ import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* Called when a note block is being played through player interaction or a redstone current.
* Called when a note block is being played through player interaction or a
* redstone current.
*/
public class NotePlayEvent extends BlockEvent implements Cancellable {