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 voidbindItem(org.bukkit.inventory.ItemStack item, PlayerBackpack bp) static CompletableFuture<PlayerBackpack> getAsync(org.bukkit.inventory.ItemStack item) static voidgetAsync(org.bukkit.inventory.ItemStack item, Consumer<PlayerBackpack> callback, boolean runCbOnMainThread) static OptionalIntgetBackpackID(org.bukkit.inventory.meta.ItemMeta meta) getBackpackUUID(org.bukkit.inventory.meta.ItemMeta meta) intgetId()This returns the id of thisPlayerBackpackorg.bukkit.inventory.InventoryThis method returns theInventoryof thisPlayerBackpackgetName()org.bukkit.OfflinePlayergetOwner()This method returns thePlayerProfilethisPlayerBackpackbelongs togetOwnerUUID(org.bukkit.inventory.meta.ItemMeta meta) intgetSize()This returns the size of thisPlayerBackpack.booleanstatic booleanisOwnerOnline(org.bukkit.inventory.meta.ItemMeta meta) voidvoidopen(org.bukkit.entity.Player p) This will open theInventoryof this backpack to everyPlayerthat was passed onto this method.voidThis refreshes the internal snapshot, It should be called after every database writing task It should not be called elsewherestatic voidsetItemDisplayInfo(org.bukkit.inventory.ItemStack item, PlayerBackpack bp) static voidsetItemPdc(org.bukkit.inventory.ItemStack item, String bpUuid, String ownerUuid) voidvoidsetSize(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) -
getAsync
-
getBackpackUUID
-
getOwnerUUID
-
getBackpackID
-
setItemPdc
-
bindItem
-
setItemDisplayInfo
-
isOwnerOnline
public static boolean isOwnerOnline(org.bukkit.inventory.meta.ItemMeta meta) -
refreshSnapshot
public void refreshSnapshot()This refreshes the internal snapshot, It should be called after every database writing task It should not be called elsewhere -
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 thePlayerProfilethisPlayerBackpackbelongs 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 theInventoryof thisPlayerBackpack- Returns:
- The
Inventoryof thisPlayerBackpack
-
open
public void open(org.bukkit.entity.Player p) This will open theInventoryof this backpack to everyPlayerthat 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()
-