Class PlayerClassInfo.PlayerDisplayNameHandler
java.lang.Object
org.skriptlang.skript.bukkit.base.types.PlayerClassInfo.PlayerDisplayNameHandler
- All Implemented Interfaces:
PropertyHandler<org.bukkit.entity.Player>,PropertyHandler.ExpressionPropertyHandler<org.bukkit.entity.Player,String>
- Enclosing class:
PlayerClassInfo
public static class PlayerClassInfo.PlayerDisplayNameHandler
extends Object
implements PropertyHandler.ExpressionPropertyHandler<org.bukkit.entity.Player,String>
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.skriptlang.skript.lang.properties.PropertyHandler
PropertyHandler.ConditionPropertyHandler<Type>, PropertyHandler.ContainsHandler<Container,Element>, PropertyHandler.ExpressionPropertyHandler<Type, ReturnType>, PropertyHandler.TypedValuePropertyHandler<Type, ValueType> -
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.convert(org.bukkit.entity.Player named) Converts the given object to the property value.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.PropertyHandler
init, newInstanceMethods inherited from interface org.skriptlang.skript.lang.properties.PropertyHandler.ExpressionPropertyHandler
possibleReturnTypes, requiresSourceExprChange
-
Constructor Details
-
PlayerDisplayNameHandler
public PlayerDisplayNameHandler()
-
-
Method Details
-
convert
Description copied from interface:PropertyHandler.ExpressionPropertyHandlerConverts the given object to the property value. This method may return arrays if the property is multi-valued.- Specified by:
convertin interfacePropertyHandler.ExpressionPropertyHandler<org.bukkit.entity.Player,String> - Parameters:
named- The object to convert.- Returns:
- The property value.
-
acceptChange
Description copied from interface:PropertyHandler.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 interfacePropertyHandler.ExpressionPropertyHandler<org.bukkit.entity.Player,String> - 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:PropertyHandler.ExpressionPropertyHandlerChanges the property value of the given object. This method is only called ifPropertyHandler.ExpressionPropertyHandler.acceptChange(ChangeMode)returns a non-null value for the given change mode.- Specified by:
changein interfacePropertyHandler.ExpressionPropertyHandler<org.bukkit.entity.Player,String> - 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:PropertyHandler.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 interfacePropertyHandler.ExpressionPropertyHandler<org.bukkit.entity.Player,String> - Returns:
- The return type of this property.
-