Pulling all pending Bukkit-JavaDoc changes

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot
2013-09-10 21:02:53 -05:00
parent f60d6710d5
commit 67439804f4
61 changed files with 219 additions and 43 deletions

View File

@@ -1,6 +1,7 @@
package org.bukkit.event;
public interface Cancellable {
/**
* Gets the cancellation state of this event. A cancelled event will not
* be executed in the server, but will still pass to other plugins

View File

@@ -4,6 +4,7 @@ package org.bukkit.event;
* Represents an event's priority in execution
*/
public enum EventPriority {
/**
* Event call is of very low importance and should be ran first, to allow
* other plugins to further customise the outcome

View File

@@ -10,6 +10,7 @@ import java.util.Map.Entry;
* A list of event handlers, stored per-event. Based on lahwran's fevents.
*/
public class HandlerList {
/**
* Handler array. This field being an array is the key to this system's speed.
*/

View File

@@ -3,6 +3,9 @@ package org.bukkit.event.entity;
import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
/**
* Called when a block causes an entity to combust.
*/
public class EntityCombustByBlockEvent extends EntityCombustEvent {
private final Block combuster;

View File

@@ -2,6 +2,9 @@ package org.bukkit.event.entity;
import org.bukkit.entity.Entity;
/**
* Called when an entity causes another entity to combust.
*/
public class EntityCombustByEntityEvent extends EntityCombustEvent {
private final Entity combuster;

View File

@@ -6,9 +6,10 @@ import org.bukkit.entity.Entity;
import org.bukkit.event.HandlerList;
/**
* Called when a non-player entity is about to teleport because it is in contact with a portal
* Called when a non-player entity is about to teleport because it is in
* contact with a portal.
* <p>
* For players see {@link org.bukkit.event.player.PlayerPortalEvent PlayerPortalEvent}
* For players see {@link org.bukkit.event.player.PlayerPortalEvent}
*/
public class EntityPortalEvent extends EntityTeleportEvent {
private static final HandlerList handlers = new HandlerList();
@@ -20,18 +21,52 @@ public class EntityPortalEvent extends EntityTeleportEvent {
this.travelAgent = pta;
}
/**
* Sets whether or not the Travel Agent will be used.
* <p>
* If this is set to true, the TravelAgent will try to find a Portal at
* the {@link #getTo()} Location, and will try to create one if there is
* none.
* <p>
* If this is set to false, the {@link #getEntity()} will only be
* teleported to the {@link #getTo()} Location.
*
* @param useTravelAgent whether to use the Travel Agent
*/
public void useTravelAgent(boolean useTravelAgent) {
this.useTravelAgent = useTravelAgent;
}
/**
* Gets whether or not the Travel Agent will be used.
* <p>
* If this is set to true, the TravelAgent will try to find a Portal at
* the {@link #getTo()} Location, and will try to create one if there is
* none.
* <p>
* If this is set to false, the {@link #getEntity()} will only be
* teleported to the {@link #getTo()} Location.
*
* @return whether to use the Travel Agent
*/
public boolean useTravelAgent() {
return useTravelAgent;
}
/**
* Gets the Travel Agent used (or not) in this event.
*
* @return the Travel Agent used (or not) in this event
*/
public TravelAgent getPortalTravelAgent() {
return this.travelAgent;
}
/**
* Sets the Travel Agent used (or not) in this event.
*
* @param travelAgent the Travel Agent used (or not) in this event
*/
public void setPortalTravelAgent(TravelAgent travelAgent) {
this.travelAgent = travelAgent;
}

View File

@@ -5,6 +5,13 @@ import org.bukkit.entity.Item;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
/**
* This event is called when a {@link org.bukkit.entity.Item} is removed from
* the world because it has existed for 5 minutes.
* <p>
* Cancelling the event results in the item being allowed to exist for 5 more
* minutes. This behavior is not guaranteed and may change in future versions.
*/
public class ItemDespawnEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean canceled;

View File

@@ -4,6 +4,7 @@ package org.bukkit.event.inventory;
* What the client did to trigger this action (not the result).
*/
public enum ClickType {
/**
* The left (or primary) mouse button.
*/

View File

@@ -5,6 +5,9 @@ import org.bukkit.inventory.CraftingInventory;
import org.bukkit.inventory.InventoryView;
import org.bukkit.inventory.Recipe;
/**
* Called when the recipe of an Item is completed inside a crafting matrix.
*/
public class CraftItemEvent extends InventoryClickEvent {
private Recipe recipe;

View File

@@ -4,8 +4,10 @@ package org.bukkit.event.inventory;
* An estimation of what the result will be.
*/
public enum InventoryAction {
/**
* Nothing will happen from the click.
* <p>
* There may be cases where nothing will happen and this is value is
* not provided, but it is guaranteed that this value is accurate
* when given.

View File

@@ -1,6 +1,7 @@
package org.bukkit.event.inventory;
public enum InventoryType {
/**
* A chest inventory, with 0, 9, 18, 27, 36, 45, or 54 slots of type CONTAINER.
*/

View File

@@ -7,6 +7,9 @@ import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.inventory.ItemStack;
/**
* Called when a player interacts with a Bucket
*/
public abstract class PlayerBucketEvent extends PlayerEvent implements Cancellable {
private ItemStack itemStack;
private boolean cancelled = false;

View File

@@ -77,7 +77,7 @@ public class PlayerEditBookEvent extends PlayerEvent implements Cancellable {
/**
* Sets the book meta that will actually be added to the book.
*
* @param bookMeta new book meta
* @param newBookMeta new book meta
* @throws IllegalArgumentException if the new book meta is null
*/
public void setNewBookMeta(BookMeta newBookMeta) throws IllegalArgumentException {

View File

@@ -6,7 +6,10 @@ import org.bukkit.entity.Player;
import org.bukkit.event.HandlerList;
/**
* Called when a player is about to teleport because it is in contact with a portal
* Called when a player is about to teleport because it is in contact with a
* portal.
* <p>
* For other entities see {@link org.bukkit.event.entity.EntityPortalEvent}
*/
public class PlayerPortalEvent extends PlayerTeleportEvent {
private static final HandlerList handlers = new HandlerList();
@@ -23,18 +26,52 @@ public class PlayerPortalEvent extends PlayerTeleportEvent {
this.travelAgent = pta;
}
/**
* Sets whether or not the Travel Agent will be used.
* <p>
* If this is set to true, the TravelAgent will try to find a Portal at
* the {@link #getTo()} Location, and will try to create one if there is
* none.
* <p>
* If this is set to false, the {@link #getPlayer()} will only be
* teleported to the {@link #getTo()} Location.
*
* @param useTravelAgent whether to use the Travel Agent
*/
public void useTravelAgent(boolean useTravelAgent) {
this.useTravelAgent = useTravelAgent;
}
/**
* Gets whether or not the Travel Agent will be used.
* <p>
* If this is set to true, the TravelAgent will try to find a Portal at
* the {@link #getTo()} Location, and will try to create one if there is
* none.
* <p>
* If this is set to false, the {@link #getPlayer()}} will only be
* teleported to the {@link #getTo()} Location.
*
* @return whether to use the Travel Agent
*/
public boolean useTravelAgent() {
return useTravelAgent && travelAgent != null;
}
/**
* Gets the Travel Agent used (or not) in this event.
*
* @return the Travel Agent used (or not) in this event
*/
public TravelAgent getPortalTravelAgent() {
return this.travelAgent;
}
/**
* Sets the Travel Agent used (or not) in this event.
*
* @param travelAgent the Travel Agent used (or not) in this event
*/
public void setPortalTravelAgent(TravelAgent travelAgent) {
this.travelAgent = travelAgent;
}

View File

@@ -3,6 +3,9 @@ package org.bukkit.event.vehicle;
import org.bukkit.entity.Vehicle;
import org.bukkit.event.HandlerList;
/**
* Called when a vehicle updates
*/
public class VehicleUpdateEvent extends VehicleEvent {
private static final HandlerList handlers = new HandlerList();