Class PlayerClassInfo.PlayerDisplayNameHandler

java.lang.Object
org.skriptlang.skript.bukkit.types.PlayerClassInfo.PlayerDisplayNameHandler
All Implemented Interfaces:
ExpressionPropertyHandler<org.bukkit.entity.Player,net.kyori.adventure.text.Component>, PropertyHandler<org.bukkit.entity.Player>
Enclosing class:
PlayerClassInfo

public static class PlayerClassInfo.PlayerDisplayNameHandler extends Object implements ExpressionPropertyHandler<org.bukkit.entity.Player,net.kyori.adventure.text.Component>
  • Constructor Details

    • PlayerDisplayNameHandler

      public PlayerDisplayNameHandler()
  • Method Details

    • convert

      public net.kyori.adventure.text.Component convert(org.bukkit.entity.Player player)
      Description copied from interface: ExpressionPropertyHandler
      Converts the given object to the property value. This method may return arrays if the property is multi-valued. Callers should always prefer ExpressionPropertyHandler.convert(Event, Object).
      Specified by:
      convert in interface ExpressionPropertyHandler<org.bukkit.entity.Player,net.kyori.adventure.text.Component>
      Parameters:
      player - The object to convert.
      Returns:
      The property value.
    • acceptChange

      public Class<?> @Nullable [] acceptChange(Changer.ChangeMode mode)
      Description copied from interface: ExpressionPropertyHandler
      Returns the types of changes that this property supports. If the property does not support any changes, this method should return null. If the property supports changes, it should return the classes that are accepted for each change mode. Changer.ChangeMode.RESET and Changer.ChangeMode.DELETE do not require any specific types, so they can return an empty or non-empty array.
      The default implementation returns null, indicating that the property is read-only.
      Specified by:
      acceptChange in interface ExpressionPropertyHandler<org.bukkit.entity.Player,net.kyori.adventure.text.Component>
      Parameters:
      mode - The change mode to check.
      Returns:
      The types supported by this property for the given change mode, or null if the property is read-only.
      See Also:
    • change

      public void change(org.bukkit.entity.Player player, Object @Nullable [] delta, Changer.ChangeMode mode)
      Description copied from interface: ExpressionPropertyHandler
      Changes the property value of the given object. This method is only called if ExpressionPropertyHandler.acceptChange(Changer.ChangeMode) returns a non-null value for the given change mode.
      Specified by:
      change in interface ExpressionPropertyHandler<org.bukkit.entity.Player,net.kyori.adventure.text.Component>
      Parameters:
      player - The object to change.
      delta - The new value(s) to set. This is null for Changer.ChangeMode.RESET and Changer.ChangeMode.DELETE.
      mode - The change mode to apply.
    • returnType

      @NotNull public @NotNull Class<net.kyori.adventure.text.Component> returnType()
      Description copied from interface: ExpressionPropertyHandler
      The return type of this property. This is used for type checking and auto-completion. If the property can return multiple types, it should return the most general type that encompasses all possible return types.
      Specified by:
      returnType in interface ExpressionPropertyHandler<org.bukkit.entity.Player,net.kyori.adventure.text.Component>
      Returns:
      The return type of this property.