Class PlayerPlaceholderImpl

java.lang.Object
me.neznamy.tab.shared.placeholders.TabPlaceholder
me.neznamy.tab.shared.placeholders.PlayerPlaceholderImpl
All Implemented Interfaces:
me.neznamy.tab.api.placeholder.Placeholder, me.neznamy.tab.api.placeholder.PlayerPlaceholder

public class PlayerPlaceholderImpl extends TabPlaceholder implements me.neznamy.tab.api.placeholder.PlayerPlaceholder
Implementation of the PlayerPlaceholder interface
  • Constructor Details

    • PlayerPlaceholderImpl

      public PlayerPlaceholderImpl(String identifier, int refresh, Function<me.neznamy.tab.api.TabPlayer,Object> function)
      Constructs new instance with given parameters
      Parameters:
      identifier - placeholder's identifier, must start and end with %
      refresh - refresh interval in milliseconds, must be divisible by 50 or equal to -1 for trigger placeholders
      function - refresh function which returns new up-to-date output on request
  • Method Details

    • update

      public boolean update(me.neznamy.tab.api.TabPlayer p)
      Gets new value of the placeholder, saves it to map and returns true if value changed, false if not
      Parameters:
      p - player to update placeholder for
      Returns:
      true if value changed since last time, false if not
    • updateValue

      public void updateValue(me.neznamy.tab.api.TabPlayer player, Object value)
      Specified by:
      updateValue in interface me.neznamy.tab.api.placeholder.PlayerPlaceholder
    • updateFromNested

      public void updateFromNested(me.neznamy.tab.api.TabPlayer player)
      Description copied from class: TabPlaceholder
      Updates the placeholder with force mark for requested player
      Specified by:
      updateFromNested in class TabPlaceholder
      Parameters:
      player - player to update placeholder for
    • getLastValue

      public String getLastValue(me.neznamy.tab.api.TabPlayer p)
      Description copied from class: TabPlaceholder
      Returns last known value of defined player
      Specified by:
      getLastValue in interface me.neznamy.tab.api.placeholder.PlayerPlaceholder
      Specified by:
      getLastValue in class TabPlaceholder
      Parameters:
      p - player to get value of
      Returns:
      last known value for specified player
    • request

      public Object request(me.neznamy.tab.api.TabPlayer p)
      Specified by:
      request in interface me.neznamy.tab.api.placeholder.PlayerPlaceholder