Class ServerPlaceholderImpl

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

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

    • ServerPlaceholderImpl

      public ServerPlaceholderImpl(String identifier, int refresh, Supplier<Object> supplier)
      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
      supplier - supplier returning fresh output on request
  • Method Details

    • update

      public boolean update()
      Updates placeholder, saves it and returns true if value changed, false if not
      Returns:
      true if value changed, false if not
    • updateValue

      public void updateValue(Object value)
      Specified by:
      updateValue in interface me.neznamy.tab.api.placeholder.ServerPlaceholder
    • 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 class TabPlaceholder
      Parameters:
      p - player to get value of
      Returns:
      last known value for specified player
    • getLastValue

      public String getLastValue()
      Specified by:
      getLastValue in interface me.neznamy.tab.api.placeholder.ServerPlaceholder
    • request

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