Initial Inventory stuff, read only, no hooks. Only implemented for the StorageMinecart

By: Erik Broes <erikbroes@ripe.net>
This commit is contained in:
Bukkit/Spigot
2011-01-05 01:00:06 +01:00
parent f7d795843a
commit 2c72e8e9d5
4 changed files with 108 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
package org.bukkit;
/**
* Represents a slot in an inventory
*/
public class Slot {
private Inventory inventory;
private int index;
public Slot(Inventory inventory, int index) {
this.inventory = inventory;
this.index = index;
}
/**
* Gets the inventory this slot belongs to
*
* @return The inventory
*/
public Inventory getInventory() {
return inventory;
}
/**
* Get the index this slot belongs to
*
* @return Index of the slot
*/
public int getIndex() {
return index;
}
/**
* Get the item from the slot.
*
* @return ItemStack in the slot.
*/
public ItemStack getItem() {
return inventory.getItem(index);
}
}