Class SquaremapOnlinePlayer

java.lang.Object
io.github.emcw.common.Entity
io.github.emcw.squaremap.entities.SquaremapOnlinePlayer
All Implemented Interfaces:
IGsonSerializable, ILocatable<SquaremapOnlinePlayer>
Direct Known Subclasses:
SquaremapOnlineResident

public class SquaremapOnlinePlayer extends Entity implements ILocatable<SquaremapOnlinePlayer>, IGsonSerializable
  • Constructor Details

    • SquaremapOnlinePlayer

      public SquaremapOnlinePlayer(SquaremapOnlinePlayer op)
      Copy constructor.

      Use when a class extends this class and other data needs to be merged. For example, SquaremapOnlineResident calls super (this constructor) then merges SquaremapResident.
      Parameters:
      op - The existing online player.
    • SquaremapOnlinePlayer

      public SquaremapOnlinePlayer(com.google.gson.JsonObject opInfo)
      Use when we need to create a new online player from raw data.
      Parameters:
      opInfo - The JSON data containing info about an online player.
  • Method Details

    • hasCustomName

      public boolean hasCustomName()
      If this player has set a nickname.
      Returns:
      true/false if displayName is same as their account Entity.name.
    • isInOverworld

      public boolean isInOverworld()
      If this player is visible on the map.
      Returns:
      true/false if world is "earth" and player is not under a block.
    • facingDirection

      public Direction facingDirection() throws IllegalArgumentException
      Throws:
      IllegalArgumentException