Class RelationalPlaceholderImpl

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

public class RelationalPlaceholderImpl extends TabPlaceholder implements me.neznamy.tab.api.placeholder.RelationalPlaceholder
Implementation of RelationalPlaceholder interface
  • Constructor Details

    • RelationalPlaceholderImpl

      public RelationalPlaceholderImpl(String identifier, int refresh, BiFunction<me.neznamy.tab.api.TabPlayer,me.neznamy.tab.api.TabPlayer,Object> function)
      Constructs new instance with given parameters
      Parameters:
      identifier - placeholder identifier, must start with %rel_ 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 viewer, me.neznamy.tab.api.TabPlayer target)
      Updates value for given players and returns true if value changed, false if not
      Parameters:
      viewer - viewer of the placeholder
      target - target who is the text displayed on
      Returns:
      true if value changed, false if not
    • updateValue

      public void updateValue(me.neznamy.tab.api.TabPlayer viewer, me.neznamy.tab.api.TabPlayer target, Object value)
      Specified by:
      updateValue in interface me.neznamy.tab.api.placeholder.RelationalPlaceholder
    • getLastValue

      public String getLastValue(me.neznamy.tab.api.TabPlayer viewer, me.neznamy.tab.api.TabPlayer target)
      Specified by:
      getLastValue in interface me.neznamy.tab.api.placeholder.RelationalPlaceholder
    • 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 class TabPlaceholder
      Parameters:
      p - player to get value of
      Returns:
      last known value for specified player
    • 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
    • request

      public Object request(me.neznamy.tab.api.TabPlayer viewer, me.neznamy.tab.api.TabPlayer target)
      Specified by:
      request in interface me.neznamy.tab.api.placeholder.RelationalPlaceholder