Class Server

java.lang.Object
fr.hytale.loader.api.Server

public class Server extends Object
Server utility class for server-wide operations. Provides access to online players, broadcasting, and world management.
Since:
1.0.4
Version:
1.0.4
Author:
HytaleLoader
  • Method Details

    • getOnlinePlayers

      public static List<Player> getOnlinePlayers()
      Gets all online players on the server.
      Returns:
      List of all online Player instances
    • getPlayer

      public static Player getPlayer(UUID uuid)
      Gets a player by their UUID.
      Parameters:
      uuid - The UUID of the player to find
      Returns:
      The Player instance, or null if not found or offline
    • getPlayer

      public static Player getPlayer(String name)
      Gets a player by their username (case-insensitive).
      Parameters:
      name - The username of the player to find
      Returns:
      The Player instance, or null if not found
    • broadcast

      public static void broadcast(String message)
      Broadcasts a message to all online players.
      Parameters:
      message - The message to broadcast
    • broadcastPermission

      public static void broadcastPermission(String message, String permission)
      Broadcasts a message to all online players with a specific permission.
      Parameters:
      message - The message to broadcast
      permission - The permission required to receive the message
    • getOnlineCount

      public static int getOnlineCount()
      Gets the number of players currently online.
      Returns:
      The online player count
    • getWorlds

      public static List<World> getWorlds()
      Gets all loaded worlds on the server.
      Returns:
      List of all loaded World instances
    • getWorld

      public static World getWorld(String name)
      Gets a world by its name.
      Parameters:
      name - The name of the world
      Returns:
      The World instance, or null if not found
    • getDefaultWorld

      public static World getDefaultWorld()
      Gets the default world of the server.
      Returns:
      The default World instance
    • getPlayersInWorld

      public static List<Player> getPlayersInWorld(World world)
      Gets all players in a specific world.
      Parameters:
      world - The world to get players from
      Returns:
      List of players in the specified world
    • getPlayersInWorld

      public static List<Player> getPlayersInWorld(String worldName)
      Gets all players in a world by its name.
      Parameters:
      worldName - The name of the world
      Returns:
      List of players in the specified world