Package de.jeff_media.angelchest
Interface AngelChest
public interface AngelChest
Represents an instance of an AngelChest
-
Method Summary
Modifier and TypeMethodDescription@NotNull ItemStack[]
Gets the items the player had equipped in the armor slots@NotNull Block
getBlock()
Gets the block where the chest was spawnedlong
Gets the java.lang.System.currentTimeMillis() when this chest has been createdint
Gets the amount of experience stored in the chest@Nullable ItemStack
Gets the offhand item@NotNull List<OfflinePlayer>
Gets a list of all players who have opened this chest@NotNull OfflinePlayer
Gets the player who owns the chestint
Gets the amount of seconds that are left until the chest expires@NotNull ItemStack[]
Gets the items the player had stored in his regular inventoryint
Gets the amount of seconds left until the chest will automatically unlock@NotNull World
getWorld()
Gets the world where the chest was spawnedboolean
isEmpty()
Checks whether this chest is completely emptyboolean
Checks whether this chest will expire sometimeboolean
Checks whether the chest is protected from other playersvoid
setArmorInv(@NotNull ItemStack[] armorInv)
Sets the items the player had equipped in the armor slotsvoid
setExperience(int experience)
Sets the amount of experience stored in the chestvoid
setInfinite(boolean isInfinite)
Set whether this chest will expire sometimevoid
setOffhandItem(@Nullable ItemStack offhandItem)
Sets the offhand itemvoid
setProtected(boolean isProtected)
Sets whether the chest is protected from other playersvoid
setSecondsLeft(int secondsLeft)
Sets the amount of seconds left until the chest expiresvoid
setStorageInv(@NotNull ItemStack[] storageInv)
Sets the items the player had stored in his regular inventoryvoid
setUnlockIn(int unlockIn)
Sets the amount of seconds left until the chest will automatically unlock
-
Method Details
-
getArmorInv
Gets the items the player had equipped in the armor slots- Returns:
- Stored armor items
-
setArmorInv
Sets the items the player had equipped in the armor slots- Parameters:
armorInv
- New armor items. Must be an array of 4 ItemStacks
-
getStorageInv
Gets the items the player had stored in his regular inventory- Returns:
- Stored items
-
setStorageInv
Sets the items the player had stored in his regular inventory- Parameters:
storageInv
- New items. Must be an array of 36 ItemStacks
-
getOffhandItem
Gets the offhand item- Returns:
- Offhand item
-
setOffhandItem
Sets the offhand item- Parameters:
offhandItem
-
-
isProtected
boolean isProtected()Checks whether the chest is protected from other players- Returns:
- true when protected, otherwise false
-
setProtected
void setProtected(boolean isProtected)Sets whether the chest is protected from other players- Parameters:
isProtected
-
-
getSecondsLeft
int getSecondsLeft()Gets the amount of seconds that are left until the chest expires- Returns:
- Seconds left
-
setSecondsLeft
void setSecondsLeft(int secondsLeft)Sets the amount of seconds left until the chest expires- Parameters:
secondsLeft
-
-
getUnlockIn
int getUnlockIn()Gets the amount of seconds left until the chest will automatically unlock- Returns:
- Amount of seconds left, or -1 if the chest will not automatically unlock
-
setUnlockIn
void setUnlockIn(int unlockIn)Sets the amount of seconds left until the chest will automatically unlock- Parameters:
unlockIn
- Amount of seconds left, or -1 if the chest shall not automatically unlock
-
getExperience
int getExperience()Gets the amount of experience stored in the chest- Returns:
- Amount of experience
-
setExperience
void setExperience(int experience)Sets the amount of experience stored in the chest- Parameters:
experience
-
-
getPlayer
Gets the player who owns the chest- Returns:
-
getBlock
Gets the block where the chest was spawned- Returns:
-
getWorld
Gets the world where the chest was spawned- Returns:
-
isEmpty
boolean isEmpty()Checks whether this chest is completely empty- Returns:
- true if the chest contains neither experience nor any items, otherwise false
-
isInfinite
boolean isInfinite()Checks whether this chest will expire sometime- Returns:
- true if the chest is infinite, otherwise false
-
setInfinite
void setInfinite(boolean isInfinite)Set whether this chest will expire sometime- Parameters:
isInfinite
- true if the chest shall never expire, otherwise false
-
getOpenedBy
Gets a list of all players who have opened this chest- Returns:
-
getCreated
long getCreated()Gets the java.lang.System.currentTimeMillis() when this chest has been created- Returns:
-