Class PlayerBackpack
java.lang.Object
city.norain.slimefun4.holder.SlimefunInventoryHolder
io.github.thebusybiscuit.slimefun4.api.player.PlayerBackpack
- All Implemented Interfaces:
org.bukkit.inventory.InventoryHolder
This class represents the instance of a
SlimefunBackpack
that is ready to
be opened.
It holds an actual Inventory
and represents the backpack on the
level of an individual ItemStack
as opposed to the class SlimefunBackpack
.- Author:
- TheBusyBiscuit
- See Also:
-
Field Summary
FieldsFields inherited from class city.norain.slimefun4.holder.SlimefunInventoryHolder
inventory
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerBackpack
(org.bukkit.OfflinePlayer owner, UUID uuid, String name, int id, int size, org.bukkit.inventory.ItemStack[] contents) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
bindItem
(org.bukkit.inventory.ItemStack item, PlayerBackpack bp) static void
getAsync
(org.bukkit.inventory.ItemStack item, Consumer<PlayerBackpack> callback, boolean runCbOnMainThread) static OptionalInt
getBackpackID
(org.bukkit.inventory.meta.ItemMeta meta) getBackpackUUID
(org.bukkit.inventory.meta.ItemMeta meta) int
getId()
This returns the id of thisPlayerBackpack
org.bukkit.inventory.Inventory
This method returns theInventory
of thisPlayerBackpack
getName()
org.bukkit.OfflinePlayer
getOwner()
This method returns thePlayerProfile
thisPlayerBackpack
belongs togetOwnerUUID
(org.bukkit.inventory.meta.ItemMeta meta) int
getSize()
This returns the size of thisPlayerBackpack
.boolean
static boolean
isOwnerOnline
(org.bukkit.inventory.meta.ItemMeta meta) void
void
open
(org.bukkit.entity.Player p) This will open theInventory
of this backpack to everyPlayer
that was passed onto this method.static void
setItemDisplayInfo
(org.bukkit.inventory.ItemStack item, PlayerBackpack bp) static void
setItemPdc
(org.bukkit.inventory.ItemStack item, String bpUuid, String ownerUuid) void
void
setSize
(int size) This will change the current size of this Backpack to the specified size.
-
Field Details
-
LORE_OWNER
- See Also:
-
-
Constructor Details
-
PlayerBackpack
-
-
Method Details
-
getAsync
public static void getAsync(org.bukkit.inventory.ItemStack item, Consumer<PlayerBackpack> callback, boolean runCbOnMainThread) -
getBackpackUUID
-
getOwnerUUID
-
getBackpackID
-
setItemPdc
-
bindItem
-
setItemDisplayInfo
-
isOwnerOnline
public static boolean isOwnerOnline(org.bukkit.inventory.meta.ItemMeta meta) -
getId
public int getId()This returns the id of thisPlayerBackpack
- Returns:
- The id of this
PlayerBackpack
-
getOwner
@Nonnull public org.bukkit.OfflinePlayer getOwner()This method returns thePlayerProfile
thisPlayerBackpack
belongs to- Returns:
- The owning
PlayerProfile
-
getSize
public int getSize()This returns the size of thisPlayerBackpack
.- Returns:
- The size of this
PlayerBackpack
-
getInventory
@Nonnull public org.bukkit.inventory.Inventory getInventory()This method returns theInventory
of thisPlayerBackpack
- Returns:
- The
Inventory
of thisPlayerBackpack
-
open
public void open(org.bukkit.entity.Player p) This will open theInventory
of this backpack to everyPlayer
that was passed onto this method.二进制兼容
- Parameters:
p
- The player who this Backpack will be shown to
-
setSize
public void setSize(int size) This will change the current size of this Backpack to the specified size.- Parameters:
size
- The new size for this Backpack
-
getUniqueId
-
setName
-
getName
-
markInvalid
public void markInvalid() -
isInvalid
public boolean isInvalid()
-