public class GlowPlayerInventory extends GlowInventory implements org.bukkit.inventory.PlayerInventory, org.bukkit.inventory.EntityEquipment
| Constructor and Description |
|---|
GlowPlayerInventory(GlowHumanEntity owner)
Creates the instance for the given player's inventory.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canEquipInHelmetSlot(org.bukkit.Material material) |
int |
clear(int id,
int data)
Deprecated.
|
int |
clear(org.bukkit.Material type,
org.bukkit.material.MaterialData data)
Remove all matching items from the inventory.
|
int |
consumeItemInHand(org.bukkit.inventory.EquipmentSlot slot)
Consumes an item in a hand slot.
|
int |
consumeItemInHand(org.bukkit.inventory.EquipmentSlot slot,
boolean wholeStack)
Consumes an item in a hand slot.
|
int |
consumeItemInMainHand()
Consumes an item in the main hand slot.
|
int |
consumeItemInMainHand(boolean wholeStack)
Consumes an item or the full stack in the main hand slot.
|
org.bukkit.inventory.ItemStack[] |
getArmorContents() |
org.bukkit.inventory.ItemStack |
getBoots() |
float |
getBootsDropChance() |
org.bukkit.inventory.ItemStack |
getChestplate() |
float |
getChestplateDropChance() |
GlowCraftingInventory |
getCraftingInventory()
The crafting inventory.
|
DragTracker |
getDragTracker()
Tracker for inventory drags by this player.
|
org.bukkit.inventory.ItemStack[] |
getExtraContents() |
int |
getHeldItemSlot()
The current held item slot.
|
org.bukkit.inventory.ItemStack |
getHelmet() |
float |
getHelmetDropChance() |
org.bukkit.entity.HumanEntity |
getHolder()
The owner of this inventory.
|
org.bukkit.inventory.ItemStack |
getItem(org.bukkit.inventory.EquipmentSlot slot) |
org.bukkit.inventory.ItemStack |
getItemInHand()
Deprecated.
|
float |
getItemInHandDropChance() |
org.bukkit.inventory.ItemStack |
getItemInMainHand() |
float |
getItemInMainHandDropChance() |
org.bukkit.inventory.ItemStack |
getItemInOffHand() |
float |
getItemInOffHandDropChance() |
org.bukkit.inventory.ItemStack |
getLeggings() |
float |
getLeggingsDropChance() |
org.bukkit.Location |
getLocation() |
org.bukkit.inventory.ItemStack[] |
getStorageContents() |
void |
handleShiftClick(GlowPlayer player,
org.bukkit.inventory.InventoryView view,
int clickedSlot,
org.bukkit.inventory.ItemStack clickedItem)
Handle a shift click in this inventory by the specified player.
|
boolean |
itemPlaceAllowed(int slot,
org.bukkit.inventory.ItemStack stack)
Check whether it is allowed for a player to insert the given ItemStack at the slot,
regardless of the slot's current contents.
|
void |
setArmorContents(org.bukkit.inventory.ItemStack[] items) |
void |
setBoots(org.bukkit.inventory.ItemStack boots) |
void |
setBootsDropChance(float chance) |
void |
setChestplate(org.bukkit.inventory.ItemStack chestplate) |
void |
setChestplateDropChance(float chance) |
void |
setExtraContents(org.bukkit.inventory.ItemStack[] items) |
void |
setHeldItemSlot(int slot) |
void |
setHelmet(org.bukkit.inventory.ItemStack helmet) |
void |
setHelmetDropChance(float chance) |
void |
setItem(org.bukkit.inventory.EquipmentSlot slot,
org.bukkit.inventory.ItemStack item) |
void |
setItemInHand(org.bukkit.inventory.ItemStack item)
Deprecated.
|
void |
setItemInHandDropChance(float chance) |
void |
setItemInMainHand(org.bukkit.inventory.ItemStack item) |
void |
setItemInMainHandDropChance(float chance) |
void |
setItemInOffHand(org.bukkit.inventory.ItemStack item) |
void |
setItemInOffHandDropChance(float chance) |
void |
setLeggings(org.bukkit.inventory.ItemStack leggings) |
void |
setLeggingsDropChance(float chance) |
void |
setRawHeldItemSlot(int slot)
Sets which hotbar slot is the main-hand item.
|
void |
setStorageContents(org.bukkit.inventory.ItemStack[] items) |
addItem, addItemStack, addViewer, all, all, all, clear, clear, consumeItem, consumeItem, contains, contains, contains, contains, contains, contains, containsAtLeast, first, first, first, firstEmpty, getContents, getItem, getMaxStackSize, getName, getRawSlots, getSize, getSlot, getSlots, getSlotType, getTitle, getType, getViewers, getViewersSet, initialize, itemShiftClickAllowed, iterator, iterator, remove, remove, remove, removeItem, removeItemStack, removeViewer, setContents, setItem, setMaxStackSize, setTitle, toString, tryToFillSlotsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddItem, all, all, all, clear, clear, contains, contains, contains, contains, contains, contains, containsAtLeast, first, first, first, firstEmpty, getContents, getItem, getMaxStackSize, getName, getSize, getTitle, getType, getViewers, iterator, iterator, remove, remove, remove, removeItem, setContents, setMaxStackSizeforEach, spliteratorpublic GlowPlayerInventory(GlowHumanEntity owner)
owner - the player who owns this inventorypublic static boolean canEquipInHelmetSlot(org.bukkit.Material material)
public void setRawHeldItemSlot(int slot)
slot - the slot number, starting with 0 (1 less than the default keyboard shortcut)public boolean itemPlaceAllowed(int slot,
org.bukkit.inventory.ItemStack stack)
GlowInventoryShould return false for crafting output slots or armor slots which cannot accept the given item.
itemPlaceAllowed in class GlowInventoryslot - The slot number.stack - The stack to add.public void handleShiftClick(GlowPlayer player, org.bukkit.inventory.InventoryView view, int clickedSlot, org.bukkit.inventory.ItemStack clickedItem)
GlowInventoryThe default implementation distributes items from the right to the left and from the bottom to the top.
handleShiftClick in class GlowInventoryplayer - The player who clickedview - The inventory view in which was clickedclickedSlot - The slot in the viewclickedItem - The item at which was clickedpublic org.bukkit.entity.HumanEntity getHolder()
GlowInventorygetHolder in interface org.bukkit.inventory.EntityEquipmentgetHolder in interface org.bukkit.inventory.InventorygetHolder in interface org.bukkit.inventory.PlayerInventorygetHolder in class GlowInventorypublic org.bukkit.inventory.ItemStack getItem(org.bukkit.inventory.EquipmentSlot slot)
getItem in interface org.bukkit.inventory.PlayerInventorypublic void setItem(org.bukkit.inventory.EquipmentSlot slot,
org.bukkit.inventory.ItemStack item)
setItem in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack[] getStorageContents()
getStorageContents in interface org.bukkit.inventory.InventorygetStorageContents in class GlowInventorypublic void setStorageContents(org.bukkit.inventory.ItemStack[] items)
throws IllegalArgumentException
setStorageContents in interface org.bukkit.inventory.InventorysetStorageContents in class GlowInventoryIllegalArgumentExceptionpublic org.bukkit.inventory.ItemStack[] getArmorContents()
getArmorContents in interface org.bukkit.inventory.EntityEquipmentgetArmorContents in interface org.bukkit.inventory.PlayerInventorypublic void setArmorContents(org.bukkit.inventory.ItemStack[] items)
setArmorContents in interface org.bukkit.inventory.EntityEquipmentsetArmorContents in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack[] getExtraContents()
getExtraContents in interface org.bukkit.inventory.PlayerInventorypublic void setExtraContents(org.bukkit.inventory.ItemStack[] items)
setExtraContents in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getHelmet()
getHelmet in interface org.bukkit.inventory.EntityEquipmentgetHelmet in interface org.bukkit.inventory.PlayerInventorypublic void setHelmet(org.bukkit.inventory.ItemStack helmet)
setHelmet in interface org.bukkit.inventory.EntityEquipmentsetHelmet in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getChestplate()
getChestplate in interface org.bukkit.inventory.EntityEquipmentgetChestplate in interface org.bukkit.inventory.PlayerInventorypublic void setChestplate(org.bukkit.inventory.ItemStack chestplate)
setChestplate in interface org.bukkit.inventory.EntityEquipmentsetChestplate in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getLeggings()
getLeggings in interface org.bukkit.inventory.EntityEquipmentgetLeggings in interface org.bukkit.inventory.PlayerInventorypublic void setLeggings(org.bukkit.inventory.ItemStack leggings)
setLeggings in interface org.bukkit.inventory.EntityEquipmentsetLeggings in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getBoots()
getBoots in interface org.bukkit.inventory.EntityEquipmentgetBoots in interface org.bukkit.inventory.PlayerInventorypublic void setBoots(org.bukkit.inventory.ItemStack boots)
setBoots in interface org.bukkit.inventory.EntityEquipmentsetBoots in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getItemInMainHand()
getItemInMainHand in interface org.bukkit.inventory.EntityEquipmentgetItemInMainHand in interface org.bukkit.inventory.PlayerInventorypublic void setItemInMainHand(org.bukkit.inventory.ItemStack item)
setItemInMainHand in interface org.bukkit.inventory.EntityEquipmentsetItemInMainHand in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.inventory.ItemStack getItemInOffHand()
getItemInOffHand in interface org.bukkit.inventory.EntityEquipmentgetItemInOffHand in interface org.bukkit.inventory.PlayerInventorypublic void setItemInOffHand(org.bukkit.inventory.ItemStack item)
setItemInOffHand in interface org.bukkit.inventory.EntityEquipmentsetItemInOffHand in interface org.bukkit.inventory.PlayerInventory@Deprecated public org.bukkit.inventory.ItemStack getItemInHand()
getItemInHand in interface org.bukkit.inventory.EntityEquipmentgetItemInHand in interface org.bukkit.inventory.PlayerInventory@Deprecated public void setItemInHand(org.bukkit.inventory.ItemStack item)
setItemInHand in interface org.bukkit.inventory.EntityEquipmentsetItemInHand in interface org.bukkit.inventory.PlayerInventorypublic void setHeldItemSlot(int slot)
setHeldItemSlot in interface org.bukkit.inventory.PlayerInventorypublic org.bukkit.Location getLocation()
getLocation in interface org.bukkit.inventory.InventorygetLocation in class GlowInventorypublic int clear(org.bukkit.Material type,
org.bukkit.material.MaterialData data)
type - the item to remove, or null to remove everythingdata - the data value to match on, or null to match all data values@Deprecated public int clear(int id, int data)
clear in interface org.bukkit.inventory.PlayerInventorypublic float getItemInHandDropChance()
getItemInHandDropChance in interface org.bukkit.inventory.EntityEquipmentpublic void setItemInHandDropChance(float chance)
setItemInHandDropChance in interface org.bukkit.inventory.EntityEquipmentpublic float getItemInMainHandDropChance()
getItemInMainHandDropChance in interface org.bukkit.inventory.EntityEquipmentpublic void setItemInMainHandDropChance(float chance)
setItemInMainHandDropChance in interface org.bukkit.inventory.EntityEquipmentpublic float getItemInOffHandDropChance()
getItemInOffHandDropChance in interface org.bukkit.inventory.EntityEquipmentpublic void setItemInOffHandDropChance(float chance)
setItemInOffHandDropChance in interface org.bukkit.inventory.EntityEquipmentpublic float getHelmetDropChance()
getHelmetDropChance in interface org.bukkit.inventory.EntityEquipmentpublic void setHelmetDropChance(float chance)
setHelmetDropChance in interface org.bukkit.inventory.EntityEquipmentpublic float getChestplateDropChance()
getChestplateDropChance in interface org.bukkit.inventory.EntityEquipmentpublic void setChestplateDropChance(float chance)
setChestplateDropChance in interface org.bukkit.inventory.EntityEquipmentpublic float getLeggingsDropChance()
getLeggingsDropChance in interface org.bukkit.inventory.EntityEquipmentpublic void setLeggingsDropChance(float chance)
setLeggingsDropChance in interface org.bukkit.inventory.EntityEquipmentpublic float getBootsDropChance()
getBootsDropChance in interface org.bukkit.inventory.EntityEquipmentpublic void setBootsDropChance(float chance)
setBootsDropChance in interface org.bukkit.inventory.EntityEquipmentpublic int consumeItemInMainHand(boolean wholeStack)
wholeStack - True if we should remove the complete stack.public int consumeItemInMainHand()
public int consumeItemInHand(org.bukkit.inventory.EquipmentSlot slot)
slot - The hand slot to consume, which must be either
EquipmentSlot.HAND or EquipmentSlot.OFF_HAND.public int consumeItemInHand(org.bukkit.inventory.EquipmentSlot slot,
boolean wholeStack)
slot - The hand slot to consume, which must be either
EquipmentSlot.HAND or EquipmentSlot.OFF_HAND.wholeStack - True if we should remove the complete stack.public GlowCraftingInventory getCraftingInventory()
public DragTracker getDragTracker()
public int getHeldItemSlot()
getHeldItemSlot in interface org.bukkit.inventory.PlayerInventoryCopyright © 2021. All rights reserved.