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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?> @Nullable []Returns the types of changes that this property supports.voidchange(org.bukkit.entity.Player player, Object @Nullable [] delta, Changer.ChangeMode mode) Changes the property value of the given object.net.kyori.adventure.text.Componentconvert(org.bukkit.entity.Player player) Converts the given object to the property value.@NotNull Class<net.kyori.adventure.text.Component> The return type of this property.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.skriptlang.skript.lang.properties.handlers.base.ExpressionPropertyHandler
convert, possibleReturnTypes, requiresSourceExprChangeMethods inherited from interface org.skriptlang.skript.lang.properties.handlers.base.PropertyHandler
init, newInstance
-
Constructor Details
-
PlayerDisplayNameHandler
public PlayerDisplayNameHandler()
-
-
Method Details
-
convert
public net.kyori.adventure.text.Component convert(org.bukkit.entity.Player player) Description copied from interface:ExpressionPropertyHandlerConverts the given object to the property value. This method may return arrays if the property is multi-valued. Callers should always preferExpressionPropertyHandler.convert(Event, Object).- Specified by:
convertin interfaceExpressionPropertyHandler<org.bukkit.entity.Player,net.kyori.adventure.text.Component> - Parameters:
player- The object to convert.- Returns:
- The property value.
-
acceptChange
Description copied from interface:ExpressionPropertyHandlerReturns the types of changes that this property supports. If the property does not support any changes, this method should returnnull. If the property supports changes, it should return the classes that are accepted for each change mode.Changer.ChangeMode.RESETandChanger.ChangeMode.DELETEdo not require any specific types, so they can return an empty or non-empty array.
The default implementation returnsnull, indicating that the property is read-only.- Specified by:
acceptChangein interfaceExpressionPropertyHandler<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
nullif 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:ExpressionPropertyHandlerChanges the property value of the given object. This method is only called ifExpressionPropertyHandler.acceptChange(Changer.ChangeMode)returns a non-null value for the given change mode.- Specified by:
changein interfaceExpressionPropertyHandler<org.bukkit.entity.Player,net.kyori.adventure.text.Component> - Parameters:
player- The object to change.delta- The new value(s) to set. This isnullforChanger.ChangeMode.RESETandChanger.ChangeMode.DELETE.mode- The change mode to apply.
-
returnType
Description copied from interface:ExpressionPropertyHandlerThe 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:
returnTypein interfaceExpressionPropertyHandler<org.bukkit.entity.Player,net.kyori.adventure.text.Component> - Returns:
- The return type of this property.
-