|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.quartercode.quarterbukkit.api.SelectInventory
public abstract class SelectInventory
Nested Class Summary | |
---|---|
static class |
SelectInventory.ClickType
This enum defines four different click types. |
Constructor Summary | |
---|---|
SelectInventory(org.bukkit.plugin.Plugin plugin,
org.bukkit.entity.Player player,
java.lang.String title,
int slots)
Creates an empty inventory for the final Player `player`, the final title `"Title"` and `9` slots. |
Method Summary | |
---|---|
SelectInventory |
add(java.lang.String value,
org.bukkit.inventory.ItemStack itemStack)
Adds a new item option to the inventory and sets the ItemStack directly. |
SelectInventory |
add(java.lang.String value,
org.bukkit.inventory.ItemStack itemStack,
java.lang.String name,
java.util.List<java.lang.String> descriptions)
Adds a new item option to the inventory and sets the ItemStack directly. |
SelectInventory |
add(java.lang.String value,
org.bukkit.inventory.ItemStack itemStack,
java.lang.String name,
java.lang.String... descriptions)
Adds a new item option to the inventory and sets the ItemStack directly. |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material)
Adds a new item option to the inventory and sets the Material . |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
int amount)
Adds a new item option to the inventory and sets the Material and the amount. |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
int amount,
short data)
Adds a new item option to the inventory and sets the Material , the amount and the data/damage. |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
int amount,
short data,
java.lang.String name,
java.util.List<java.lang.String> descriptions)
Adds a new item option to the inventory and sets the Material , the amount, the data/damage, the name and the descriptions as String -List . |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
int amount,
short data,
java.lang.String name,
java.lang.String... descriptions)
Adds a new item option to the inventory and sets the Material , the amount, the data/damage, the name and the descriptions as String -array. |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
int amount,
java.lang.String name,
java.util.List<java.lang.String> descriptions)
Adds a new item option to the inventory and sets the Material , the amount, the name and the descriptions as String -List . |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
int amount,
java.lang.String name,
java.lang.String... descriptions)
Adds a new item option to the inventory and sets the Material , the amount, the name and the descriptions as String -array. |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
short data)
Adds a new item option to the inventory and sets the Material and the data/damage. |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
short data,
java.lang.String name,
java.util.List<java.lang.String> descriptions)
Adds a new item option to the inventory and sets the Material , the data/damage, the name and the descriptions as String -List . |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
short data,
java.lang.String name,
java.lang.String... descriptions)
Adds a new item option to the inventory and sets the Material , the data/damage, the name and the descriptions as String -array. |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
java.lang.String name,
java.util.List<java.lang.String> descriptions)
Adds a new item option to the inventory and sets the Material , the name and the descriptions as String -List . |
SelectInventory |
add(java.lang.String value,
org.bukkit.Material material,
java.lang.String name,
java.lang.String... descriptions)
Adds a new item option to the inventory and sets the Material , the name and the descriptions as String -array. |
SelectInventory |
closeInventoryView()
Closes the inventory for the holder. |
org.bukkit.inventory.Inventory |
getInventory()
Returns the Inventory (don't modify the slots, it will break this class). |
org.bukkit.inventory.InventoryView |
getInventoryView()
Returns the InventoryView if the inventory is open, else it is null. |
org.bukkit.entity.Player |
getPlayer()
Returns the holder of the inventory as a Player . |
int |
getSlots()
Returns the amount of slots of the inventory. |
java.lang.String |
getTitle()
Returns the title of the inventory. |
protected abstract void |
onClick(java.lang.String value,
SelectInventory.ClickType clickType)
Gets called if the holder clicks on a registered option. |
void |
onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event)
|
void |
onInventoryClose(org.bukkit.event.inventory.InventoryCloseEvent event)
|
void |
onPluginDisable(org.bukkit.event.server.PluginDisableEvent event)
|
SelectInventory |
openInventoryView()
Opens the inventory for the holder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectInventory(org.bukkit.plugin.Plugin plugin, org.bukkit.entity.Player player, java.lang.String title, int slots)
Player
`player`, the final title `"Title"` and `9` slots.
Of course you can define your own values, e.g. you can read the title from a language or message-config system. You can also colorize the title with ChatColor
s.
Keep in mind the you can only define multiples of 9 as slots.
plugin
- The binding plugin.player
- The holding player.title
- The visible title, maybe colored with ChatColor
s.slots
- The amount of slots.Method Detail |
---|
public SelectInventory openInventoryView()
public SelectInventory closeInventoryView()
public SelectInventory add(java.lang.String value, org.bukkit.Material material)
Material
.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, int amount)
Material
and the amount.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.amount
- The amount of items.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, short data)
Material
and the data/damage.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.data
- The data for non-damageable items and damage for damageable ones.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, int amount, short data)
Material
, the amount and the data/damage.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.amount
- The amount of items.data
- The data for non-damageable items and damage for damageable ones.
public SelectInventory add(java.lang.String value, org.bukkit.inventory.ItemStack itemStack)
ItemStack
directly.
value
- The identifier value as String
(maybe with information).itemStack
- The ItemStack
.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, java.lang.String name, java.lang.String... descriptions)
Material
, the name and the descriptions as String
-array.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-array.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, int amount, java.lang.String name, java.lang.String... descriptions)
Material
, the amount, the name and the descriptions as String
-array.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.amount
- The amount of items.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-array.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, short data, java.lang.String name, java.lang.String... descriptions)
Material
, the data/damage, the name and the descriptions as String
-array.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.data
- The data for non-damageable items and damage for damageable ones.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-array.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, int amount, short data, java.lang.String name, java.lang.String... descriptions)
Material
, the amount, the data/damage, the name and the descriptions as String
-array.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.amount
- The amount of items.data
- The data for non-damageable items and damage for damageable ones.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-array.
public SelectInventory add(java.lang.String value, org.bukkit.inventory.ItemStack itemStack, java.lang.String name, java.lang.String... descriptions)
ItemStack
directly. Furthemore, it sets the name and the descriptions as String
-array.
value
- The identifier value as String
(maybe with information).itemStack
- The ItemStack
.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-array.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, java.lang.String name, java.util.List<java.lang.String> descriptions)
Material
, the name and the descriptions as String
-List
.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-List
.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, int amount, java.lang.String name, java.util.List<java.lang.String> descriptions)
Material
, the amount, the name and the descriptions as String
-List
.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.amount
- The amount of items.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-List
.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, short data, java.lang.String name, java.util.List<java.lang.String> descriptions)
Material
, the data/damage, the name and the descriptions as String
-List
.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.data
- The data for non-damageable items and damage for damageable ones.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-List
.
public SelectInventory add(java.lang.String value, org.bukkit.Material material, int amount, short data, java.lang.String name, java.util.List<java.lang.String> descriptions)
Material
, the amount, the data/damage, the name and the descriptions as String
-List
.
value
- The identifier value as String
(maybe with information).material
- The Material
for the item.amount
- The amount of items.data
- The data for non-damageable items and damage for damageable ones.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-List
.
public SelectInventory add(java.lang.String value, org.bukkit.inventory.ItemStack itemStack, java.lang.String name, java.util.List<java.lang.String> descriptions)
ItemStack
directly. Furthemore, it sets the name and the descriptions as String
-List
.
value
- The identifier value as String
(maybe with information).itemStack
- The ItemStack
.name
- The name of the item as String
.descriptions
- The descriptions for the item as String
-List
.
public org.bukkit.entity.Player getPlayer()
Player
.
public java.lang.String getTitle()
public int getSlots()
public org.bukkit.inventory.Inventory getInventory()
Inventory
(don't modify the slots, it will break this class).
Inventory
.public org.bukkit.inventory.InventoryView getInventoryView()
InventoryView
if the inventory is open, else it is null.
InventoryView
if the inventory is open.public void onInventoryClick(org.bukkit.event.inventory.InventoryClickEvent event)
protected abstract void onClick(java.lang.String value, SelectInventory.ClickType clickType)
value
- The identifier (maybe with information).clickType
- The SelectInventory.ClickType
of the click.public void onInventoryClose(org.bukkit.event.inventory.InventoryCloseEvent event)
public void onPluginDisable(org.bukkit.event.server.PluginDisableEvent event)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |