Class ExprMiddleOfLocation

All Implemented Interfaces:
Converter<org.bukkit.Location,​org.bukkit.Location>, Debuggable, Expression<org.bukkit.Location>, SyntaxElement

@Name("Middle of Location") @Description("Returns the middle/center of a location. In other words, returns the middle of the X, Z coordinates and the floor value of the Y coordinate of a location.") @Examples({"command /stuck:","\texecutable by: players","\ttrigger:","\t\tteleport player to the center of player\'s location","\t\tsend \"You\'re no longer stuck.\""}) @Since("2.6.1") public class ExprMiddleOfLocation extends SimplePropertyExpression<org.bukkit.Location,​org.bukkit.Location>
  • Constructor Details

    • ExprMiddleOfLocation

      public ExprMiddleOfLocation()
  • Method Details

    • convert

      public @Nullable org.bukkit.Location convert(org.bukkit.Location loc)
      Description copied from interface: Converter
      Converts an object from the given to the desired type.
      Specified by:
      convert in interface Converter<org.bukkit.Location,​org.bukkit.Location>
      Specified by:
      convert in class SimplePropertyExpression<org.bukkit.Location,​org.bukkit.Location>
      Parameters:
      loc - The object to convert.
      Returns:
      the converted object
    • getReturnType

      public Class<? extends org.bukkit.Location> getReturnType()
      Description copied from interface: Expression
      Gets the return type of this expression.
      Returns:
      A supertype of any objects returned by Expression.getSingle(Event) and the component type of any arrays returned by Expression.getArray(Event)
    • getPropertyName

      protected String getPropertyName()
      Specified by:
      getPropertyName in class SimplePropertyExpression<org.bukkit.Location,​org.bukkit.Location>