Class PlayerClassInfo.PlayerParser

java.lang.Object
ch.njol.skript.classes.Parser<org.bukkit.entity.Player>
org.skriptlang.skript.bukkit.base.types.PlayerClassInfo.PlayerParser
Enclosing class:
PlayerClassInfo

public static class PlayerClassInfo.PlayerParser extends Parser<org.bukkit.entity.Player>
  • Constructor Details

    • PlayerParser

      public PlayerParser()
  • Method Details

    • parse

      @Nullable public @Nullable org.bukkit.entity.Player parse(String string, ParseContext context)
      Description copied from class: Parser
      Parses the input. This method may print an error prior to returning null if the input couldn't be parsed.

      Remember to override Parser.canParse(ParseContext) if this parser doesn't parse at all (i.e. you only use it's toString methods) or only parses for certain contexts.

      Note that this method will be called very frequently during script parsing, so try to avoid computationally expensive operations in this method when possible.

      Overrides:
      parse in class Parser<org.bukkit.entity.Player>
      Parameters:
      string - The String to parse. This string is already trim()med.
      context - Context of parsing, may not be null
      Returns:
      The parsed input or null if the input is invalid for this parser.
    • canParse

      public boolean canParse(ParseContext context)
      Overrides:
      canParse in class Parser<org.bukkit.entity.Player>
      Returns:
      Whether Parser.parse(String, ParseContext) can actually return something other that null for the given context
    • toString

      public String toString(org.bukkit.entity.Player player, int flags)
      Description copied from class: Parser
      Returns a string representation of the given object to be used in messages.
      Specified by:
      toString in class Parser<org.bukkit.entity.Player>
      Parameters:
      player - The object. This will never be null.
      Returns:
      The String representation of the object.
      See Also:
    • toVariableNameString

      public String toVariableNameString(org.bukkit.entity.Player player)
      Description copied from class: Parser
      Returns an object's string representation in a variable name.
      Specified by:
      toVariableNameString in class Parser<org.bukkit.entity.Player>
      Parameters:
      player -
      Returns:
      The given object's representation in a variable name.
    • getDebugMessage

      public String getDebugMessage(org.bukkit.entity.Player player)
      Description copied from class: Parser
      Returns a string representation of the given object to be used for debugging.
      The Parser of 'Block' for example returns the block's type in toString, while this method also returns the coordinates of the block.
      The default implementation of this method returns toString(o, 0).
      Overrides:
      getDebugMessage in class Parser<org.bukkit.entity.Player>
      Parameters:
      player -
      Returns:
      A message containing debug information about the given object