Pulling all pending Bukkit-JavaDoc changes

By: Edmond Poon <sagaciouszzzz@gmail.com>
This commit is contained in:
Bukkit/Spigot
2013-08-03 21:46:30 -04:00
parent b9642786eb
commit 599ec05858
80 changed files with 259 additions and 43 deletions

View File

@@ -3,11 +3,13 @@ package org.bukkit.inventory;
public interface BeaconInventory extends Inventory {
/**
* Set the item powering the beacon.
*
* @param item The new item
*/
void setItem(ItemStack item);
/**
* Get the item powering the beacon.
*
* @return The current item.
*/
ItemStack getItem();

View File

@@ -5,11 +5,13 @@ import org.bukkit.block.BrewingStand;
public interface BrewerInventory extends Inventory {
/**
* Get the current ingredient for brewing.
*
* @return The ingredient.
*/
ItemStack getIngredient();
/**
* Set the current ingredient for brewing.
*
* @param ingredient The ingredient
*/
void setIngredient(ItemStack ingredient);

View File

@@ -6,27 +6,32 @@ package org.bukkit.inventory;
public interface CraftingInventory extends Inventory {
/**
* Check what item is in the result slot of this crafting inventory.
*
* @return The result item.
*/
ItemStack getResult();
/**
* Get the contents of the crafting matrix.
*
* @return The contents.
*/
ItemStack[] getMatrix();
/**
* Set the item in the result slot of the crafting inventory.
*
* @param newResult The new result item.
*/
void setResult(ItemStack newResult);
/**
* Replace the contents of the crafting matrix
*
* @param contents The new contents.
* @throws IllegalArgumentException if the length of contents is greater than the size of the crafting matrix.
*/
void setMatrix(ItemStack[] contents);
/**
* Get the current recipe formed on the crafting inventory, if any.
*
* @return The recipe, or null if the current contents don't match any recipe.
*/
Recipe getRecipe();

View File

@@ -5,12 +5,14 @@ import org.bukkit.block.DoubleChest;
public interface DoubleChestInventory extends Inventory {
/**
* Get the left half of this double chest.
*
* @return The left side inventory
*/
Inventory getLeftSide();
/**
* Get the right side of this double chest.
*
* @return The right side inventory
*/
Inventory getRightSide();

View File

@@ -3,11 +3,13 @@ package org.bukkit.inventory;
public interface EnchantingInventory extends Inventory {
/**
* Set the item being enchanted.
*
* @param item The new item
*/
void setItem(ItemStack item);
/**
* Get the item being enchanted.
*
* @return The current item.
*/
ItemStack getItem();

View File

@@ -5,36 +5,42 @@ import org.bukkit.block.Furnace;
public interface FurnaceInventory extends Inventory {
/**
* Get the current item in the result slot.
*
* @return The item
*/
ItemStack getResult();
/**
* Get the current fuel.
*
* @return The item
*/
ItemStack getFuel();
/**
* Get the item currently smelting.
*
* @return The item
*/
ItemStack getSmelting();
/**
* Set the current fuel.
*
* @param stack The item
*/
void setFuel(ItemStack stack);
/**
* Set the current item in the result slot.
*
* @param stack The item
*/
void setResult(ItemStack stack);
/**
* Set the item currently smelting.
*
* @param stack The item
*/
void setSmelting(ItemStack stack);

View File

@@ -38,6 +38,7 @@ public interface Inventory extends Iterable<ItemStack> {
* <li>Stacks larger than the default max size for this type of inventory may not display
* correctly in the client.
* </ul>
*
* @param size The new maximum stack size for items in this inventory.
*/
public void setMaxStackSize(int size);

View File

@@ -6,7 +6,7 @@ import org.bukkit.event.inventory.InventoryType;
/**
* Represents a view linking two inventories and a single player
* (whose inventory may or may not be one of the two)
*
* <p>
* Note: If you implement this interface but fail to satisfy the expected
* contracts of certain methods, there's no guarantee that the game
* will work as it should.
@@ -62,18 +62,21 @@ public abstract class InventoryView {
}
/**
* Get the upper inventory involved in this transaction.
*
* @return the inventory
*/
public abstract Inventory getTopInventory();
/**
* Get the lower inventory involved in this transaction.
*
* @return the inventory
*/
public abstract Inventory getBottomInventory();
/**
* Get the player viewing.
*
* @return the player
*/
public abstract HumanEntity getPlayer();
@@ -82,6 +85,7 @@ public abstract class InventoryView {
* Determine the type of inventory involved in the transaction. This indicates
* the window style being shown. It will never return PLAYER, since that is
* common to all windows.
*
* @return the inventory type
*/
public abstract InventoryType getType();
@@ -91,6 +95,7 @@ public abstract class InventoryView {
* <p>
* Note: If slot ID -999 is chosen, it may be expected that the item is
* dropped on the ground. This is not required behaviour, however.
*
* @param slot The ID as returned by InventoryClickEvent.getRawSlot()
* @param item The new item to put in the slot, or null to clear it.
*/
@@ -108,6 +113,7 @@ public abstract class InventoryView {
/**
* Gets one item in this inventory view by its raw slot ID.
*
* @param slot The ID as returned by InventoryClickEvent.getRawSlot()
* @return The item currently in the slot.
*/
@@ -124,6 +130,7 @@ public abstract class InventoryView {
/**
* Sets the item on the cursor of one of the viewing players.
*
* @param item The item to put on the cursor, or null to remove the item on their cursor.
*/
public final void setCursor(ItemStack item) {
@@ -132,6 +139,7 @@ public abstract class InventoryView {
/**
* Get the item on the cursor of one of the viewing players.
*
* @return The item on the player's cursor, or null if they aren't holding one.
*/
public final ItemStack getCursor() {
@@ -144,6 +152,7 @@ public abstract class InventoryView {
* unchanged and thus be suitable for getTopInventory().getItem(); if it refers to the
* lower inventory, the output will differ from the input and be suitable for
* getBottomInventory().getItem().
*
* @param rawSlot The raw slot ID.
* @return The converted slot ID.
*/
@@ -173,18 +182,29 @@ public abstract class InventoryView {
* Check the total number of slots in this view, combining the upper and lower inventories.
* Note though that it's possible for this to be greater than the sum of the two inventories
* if for example some slots are not being used.
*
* @return The total size
*/
public final int countSlots() {
return getTopInventory().getSize() + getBottomInventory().getSize();
}
/**
* Sets an extra property of this inventory if supported by that
* inventory, for example the state of a progress bar.
*
* @param prop the window property to update
* @param value the new value for the window property
* @return true if the property was updated successfully, false if the
* property is not supported by that inventory
*/
public final boolean setProperty(Property prop, int value) {
return getPlayer().setWindowProperty(prop, value);
}
/**
* Get the title of this inventory window.
*
* @return The title.
*/
public final String getTitle() {

View File

@@ -15,6 +15,7 @@ public interface ItemFactory {
/**
* This creates a new item meta for the material.
*
* @param material The material to consider as base for the meta
* @return a new ItemMeta that could be applied to an item stack of the specified material
*/
@@ -23,6 +24,7 @@ public interface ItemFactory {
/**
* This method checks the item meta to confirm that it is applicable (no data lost if applied) to the specified ItemStack.
* A {@link SkullMeta} would not be valid for a sword, but a normal {@link ItemMeta} from an enchanted dirt block would.
*
* @param meta Meta to check
* @param stack Item that meta will be applied to
* @return true if the meta can be applied without losing data, false otherwise
@@ -33,6 +35,7 @@ public interface ItemFactory {
/**
* This method checks the item meta to confirm that it is applicable (no data lost if applied) to the specified Material.
* A {@link SkullMeta} would not be valid for a sword, but a normal {@link ItemMeta} from an enchanted dirt block would.
*
* @param meta Meta to check
* @param material Material that meta will be applied to
* @return true if the meta can be applied without losing data, false otherwise
@@ -42,6 +45,7 @@ public interface ItemFactory {
/**
* This method is used to compare two item meta data objects.
*
* @param meta1 First meta to compare, and may be null to indicate no data
* @param meta2 Second meta to compare, and may be null to indicate no data
* @return false if one of the meta has data the other does not, otherwise true
@@ -51,6 +55,7 @@ public interface ItemFactory {
/**
* Returns an appropriate item meta for the specified stack.
*
* The item meta returned will always be a valid meta for a given item stack of the specified material.
* It may be a more or less specific meta, and could also be the same meta or meta type as the parameter.
* The item meta returned will also always be the most appropriate meta. <br>

View File

@@ -118,7 +118,6 @@ public interface PlayerInventory extends Inventory {
*
* @param id the id of the item you want to clear from the inventory
* @param data the data of the item you want to clear from the inventory
*
* @return The number of items cleared
*/
public int clear(int id, int data);