Class TimedItemAPI

java.lang.Object
dev.tezvn.timeditem.api.TimedItemAPI

public class TimedItemAPI
extends java.lang.Object
Access TimedItem API
  • Constructor Summary

    Constructors 
    Constructor Description
    TimedItemAPI​(dev.tezvn.timeditem.TimedItem plugin)  
  • Method Summary

    Modifier and Type Method Description
    static org.bukkit.inventory.ItemStack addTime​(org.bukkit.inventory.ItemStack item, TimeUnits unit, int amount)
    Add expire time for item
    static org.bukkit.inventory.ItemStack clearTime​(org.bukkit.inventory.ItemStack item)
    Clear expire time of item
    static java.util.List<ExpiredItem> getExpiredItems​(java.util.UUID uuid)
    Get all expired items of player
    static java.util.List<org.bukkit.inventory.ItemStack> getTimedItems​(org.bukkit.entity.Player player)
    Get all timed items in player's inventory
    static java.util.List<org.bukkit.inventory.ItemStack> getTimedItems​(org.bukkit.Location location, double radius)
    Get timed item in specific location within radius
    static TimedUser getUser​(java.util.UUID uuid)
    Get player's userdata
    static java.util.Map<java.lang.Integer,​org.bukkit.inventory.ItemStack> getUserInventory​(java.util.UUID uuid)
    Get offline inventory of player.
    java.util.List<TimedUser> getUsers()
    Get all userdata in server
    static boolean isTimedItem​(org.bukkit.inventory.ItemStack item)
    Check if item is TimedItem
    static org.bukkit.inventory.ItemStack removeTime​(org.bukkit.inventory.ItemStack item, TimeUnits unit, int amount)
    Subtract expire time of item
    static org.bukkit.inventory.ItemStack setTime​(org.bukkit.inventory.ItemStack item, java.lang.String format)
    Set expire time for item

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TimedItemAPI

      public TimedItemAPI​(dev.tezvn.timeditem.TimedItem plugin)
  • Method Details

    • getUserInventory

      public static java.util.Map<java.lang.Integer,​org.bukkit.inventory.ItemStack> getUserInventory​(java.util.UUID uuid)
      Get offline inventory of player.
      Parameters:
      uuid - Player's UUID
      Returns:
      Map that contains slot and items of their inventory
    • getExpiredItems

      public static java.util.List<ExpiredItem> getExpiredItems​(java.util.UUID uuid)
      Get all expired items of player
      Parameters:
      uuid - Player's UUID
      Returns:
      List of expired items
    • getUser

      public static TimedUser getUser​(java.util.UUID uuid)
      Get player's userdata
      Parameters:
      uuid - Player's UUID
      Returns:
      The found userdata
    • isTimedItem

      public static boolean isTimedItem​(org.bukkit.inventory.ItemStack item)
      Check if item is TimedItem
      Parameters:
      item - ItemStack to check
      Returns:
      Is timed item if true, otherwise not
    • getTimedItems

      public static java.util.List<org.bukkit.inventory.ItemStack> getTimedItems​(org.bukkit.entity.Player player)
      Get all timed items in player's inventory
      Parameters:
      player - Player to check
      Returns:
      List that contains timed items
    • getTimedItems

      public static java.util.List<org.bukkit.inventory.ItemStack> getTimedItems​(org.bukkit.Location location, double radius)
      Get timed item in specific location within radius
      Parameters:
      location - Where to find
      radius - The found range
      Returns:
      List that contains timed items
    • addTime

      public static org.bukkit.inventory.ItemStack addTime​(org.bukkit.inventory.ItemStack item, TimeUnits unit, int amount)
      Add expire time for item
      Parameters:
      item - ItemStack to add
      unit - Time unit to add
      amount - Amount of time will be added
      Returns:
      Return timed item if success, otherwise return null
    • removeTime

      public static org.bukkit.inventory.ItemStack removeTime​(org.bukkit.inventory.ItemStack item, TimeUnits unit, int amount)
      Subtract expire time of item
      Parameters:
      item - ItemStack to remove
      unit - Time unit to remove
      amount - Amount of time will be added
      Returns:
      Return timed item if success, otherwise return null
    • setTime

      public static org.bukkit.inventory.ItemStack setTime​(org.bukkit.inventory.ItemStack item, java.lang.String format)
      Set expire time for item
      Parameters:
      item - ItemStack to set
      format - Format will be 'dd/MM/yyyy HH:mm:ss'
      Returns:
      Return timed item if success, otherwise return null
    • clearTime

      public static org.bukkit.inventory.ItemStack clearTime​(org.bukkit.inventory.ItemStack item)
      Clear expire time of item
      Parameters:
      item - ItemStack to clear
      Returns:
      Return normal ItemStack without expire time
    • getUsers

      public java.util.List<TimedUser> getUsers()
      Get all userdata in server
      Returns:
      List that contains timed user