Class Player

java.lang.Object
net.zenoc.gallium.api.world.entity.Entity
net.zenoc.gallium.api.world.entity.Player

public class Player extends Entity
  • Constructor Details

    • Player

      public Player(net.minecraft.server.level.ServerPlayer nmsPlayer)
  • Method Details

    • getUUID

      public String getUUID()
      Get the player's UUID
      Returns:
      the uuid
    • hasPermission

      public boolean hasPermission(String permission)
      Whether the player has a permission
      Parameters:
      permission - the permission
      Returns:
      whether the player has the permission
    • getPermissions

      public ArrayList<String> getPermissions()
      Get the players permissions
      Returns:
      ArrayList of permissions
    • sendMessage

      public void sendMessage(ChatMessage message)
      Send a message to the player
      Parameters:
      message - a ChatMessage
    • disconnect

      public void disconnect(ChatMessage reason)
      Disconnect the player
      Parameters:
      reason - the reason for disconnecting them
    • disconnect

      public void disconnect()
      Disconnect the player
    • fromName

      public static Optional<Player> fromName(String username)
      Get a player by their username
      Parameters:
      username - the username of the desired player
      Returns:
      the Player
    • getPrefix

      public String getPrefix()
      Get the player's prefix
      Returns:
      the prefix
    • getGroup

      public Optional<Group> getGroup()
      Get the player's group
      Returns:
      the Group
    • setGroup

      public void setGroup(Group group) throws SQLException
      Set a player's group
      Parameters:
      group - the Group
      Throws:
      SQLException
    • addPermission

      public void addPermission(String permission) throws SQLException
      Add a permission to the player
      Parameters:
      permission - the permission node
      Throws:
      SQLException
    • removePermission

      public void removePermission(String permission) throws SQLException
      Remove a permission from the player
      Parameters:
      permission - the permission node
      Throws:
      SQLException
    • ungroup

      public void ungroup() throws SQLException
      Ungroup the player
      Throws:
      SQLException
    • setPrefix

      public void setPrefix(String prefix) throws SQLException
      Set the player's prefix
      Parameters:
      prefix - the prefix
      Throws:
      SQLException
    • teleport

      public void teleport(double x, double y, double z)
      Teleport the player
      Parameters:
      x - The X coordinate
      y - The Y coordinate
      z - The Z coordinate
    • setGamemode

      public void setGamemode(Gamemode gamemode)
      Set the player's Gamemode
      Parameters:
      gamemode - The Gamemode