Class LocationMaskedPlayerWrapper

All Implemented Interfaces:
MapMetadatable, Metadatable, Entity, Player, Actor, Locatable, SessionOwner, Subject, Faceted, Identifiable, Cloneable

public class LocationMaskedPlayerWrapper extends AsyncPlayer
  • Constructor Details

    • LocationMaskedPlayerWrapper

      public LocationMaskedPlayerWrapper(Player parent, Location position)
    • LocationMaskedPlayerWrapper

      public LocationMaskedPlayerWrapper(Player parent, Location position, boolean allowTeleport)
  • Method Details

    • getLocation

      public Location getLocation()
      Description copied from interface: Locatable
      Get the location of this actor.
      Specified by:
      getLocation in interface Locatable
      Overrides:
      getLocation in class PlayerProxy
      Returns:
      the location of the actor
    • setPosition

      public void setPosition(Vector3 pos)
      Description copied from interface: Locatable
      Sets the position of this actor.
      Parameters:
      pos - where to move them
    • setPosition

      public void setPosition(Vector3 pos, float pitch, float yaw)
      Description copied from interface: Player
      Move the player.
      Specified by:
      setPosition in interface Player
      Overrides:
      setPosition in class AsyncPlayer
      Parameters:
      pos - where to move them
      pitch - the pitch (up/down) of the player's view in degrees
      yaw - the yaw (left/right) of the player's view in degrees
    • findFreePosition

      public void findFreePosition(Location searchPos)
      Description copied from interface: Player
      Find a position for the actor to stand that is not inside a block. Blocks above the player will be iteratively tested until there is a series of two free blocks. The actor will be teleported to that free position.
      Specified by:
      findFreePosition in interface Player
      Overrides:
      findFreePosition in class AsyncPlayer
      Parameters:
      searchPos - search position
    • setOnGround

      public void setOnGround(Location searchPos)
      Description copied from interface: Player
      Set the actor on the ground.
      Specified by:
      setOnGround in interface Player
      Overrides:
      setOnGround in class AsyncPlayer
      Parameters:
      searchPos - The location to start searching from
    • findFreePosition

      public void findFreePosition()
      Description copied from interface: Player
      Find a position for the player to stand that is not inside a block. Blocks above the player will be iteratively tested until there is a series of two free blocks. The player will be teleported to that free position.
      Specified by:
      findFreePosition in interface Player
      Overrides:
      findFreePosition in class AsyncPlayer
    • ascendLevel

      public boolean ascendLevel()
      Description copied from interface: Player
      Go up one level to the next free space above.
      Specified by:
      ascendLevel in interface Player
      Overrides:
      ascendLevel in class AsyncPlayer
      Returns:
      true if a spot was found
    • descendLevel

      public boolean descendLevel()
      Description copied from interface: Player
      Go up one level to the next free space above.
      Specified by:
      descendLevel in interface Player
      Overrides:
      descendLevel in class AsyncPlayer
      Returns:
      true if a spot was found
    • ascendToCeiling

      public boolean ascendToCeiling(int clearance)
      Description copied from interface: Player
      Ascend to the ceiling above.
      Specified by:
      ascendToCeiling in interface Player
      Overrides:
      ascendToCeiling in class AsyncPlayer
      Parameters:
      clearance - How many blocks to leave above the player's head
      Returns:
      whether the player was moved
    • ascendToCeiling

      public boolean ascendToCeiling(int clearance, boolean alwaysGlass)
      Description copied from interface: Player
      Ascend to the ceiling above.
      Specified by:
      ascendToCeiling in interface Player
      Overrides:
      ascendToCeiling in class AsyncPlayer
      Parameters:
      clearance - How many blocks to leave above the player's head
      alwaysGlass - Always put glass under the player
      Returns:
      whether the player was moved
    • ascendUpwards

      public boolean ascendUpwards(int distance)
      Description copied from interface: Player
      Just go up.
      Specified by:
      ascendUpwards in interface Player
      Overrides:
      ascendUpwards in class AsyncPlayer
      Parameters:
      distance - How far up to teleport
      Returns:
      whether the player was moved
    • ascendUpwards

      public boolean ascendUpwards(int distance, boolean alwaysGlass)
      Description copied from interface: Player
      Just go up.
      Specified by:
      ascendUpwards in interface Player
      Overrides:
      ascendUpwards in class AsyncPlayer
      Parameters:
      distance - How far up to teleport
      alwaysGlass - Always put glass under the player
      Returns:
      whether the player was moved
    • floatAt

      public void floatAt(int x, int y, int z, boolean alwaysGlass)
      Description copied from interface: Player
      Make the player float in the given blocks.
      Specified by:
      floatAt in interface Player
      Overrides:
      floatAt in class AsyncPlayer
      Parameters:
      x - The X coordinate of the block to float in
      y - The Y coordinate of the block to float in
      z - The Z coordinate of the block to float in