public class HumanEntityCache extends Object
Constructor and Description |
---|
HumanEntityCache() |
Modifier and Type | Method and Description |
---|---|
protected int |
add(@NotNull org.bukkit.entity.HumanEntity humanEntity,
@NotNull org.bukkit.inventory.ItemStack item)
Adds the given item stack to the human entity's cached inventory.
|
void |
restoreAndForget(@NotNull org.bukkit.entity.HumanEntity humanEntity)
Restores the contents of the specified human entity, clearing the cache afterwards.
|
void |
restoreAndForgetAll()
Restores all players' contents into their inventory, clearing the cache afterwards.
|
void |
storeAndClear(@NotNull org.bukkit.entity.HumanEntity humanEntity)
Stores this player's inventory in the cache.
|
public void storeAndClear(@NotNull @NotNull org.bukkit.entity.HumanEntity humanEntity)
humanEntity
- the human entity to keep in the cachepublic void restoreAndForget(@NotNull @NotNull org.bukkit.entity.HumanEntity humanEntity)
humanEntity
- the human entity to restore its cache forpublic void restoreAndForgetAll()
protected int add(@NotNull @NotNull org.bukkit.entity.HumanEntity humanEntity, @NotNull @NotNull org.bukkit.inventory.ItemStack item)
IllegalStateException
. The items will be added to the inventory in the same way as the
items are stored. The items may be added to an already existing item stack, but the item stack's amount will
never go over the maximum stack size.humanEntity
- the human entity to add the item toitem
- the item to add to the cached inventoryIllegalStateException
- if the human entity's inventory is not cachedCopyright © 2020. All rights reserved.