Class WorldBridge

java.lang.Object
net.winmister332.libs.world.WorldBridge

public final class WorldBridge extends Object
This class is a wrapper for worlds.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.World[]
    Get all the worlds associated with the server.
    static org.bukkit.World
    Get the first world which is configured by the server as the main world.
    static org.bukkit.World
    getWorld(String worldName)
    Get a world by the specified name if the world exists.
    static boolean
    isPlayerChunkLoaded(org.bukkit.World world, org.bukkit.entity.Player player)
    Checks if the world chunk that the player is in is loaded.
    static boolean
    isSpawnChunkLoaded(org.bukkit.World world)
    Checks if the world spawn chunks are loaded.
    static boolean
    isWorldLoaded(org.bukkit.World world, org.bukkit.entity.Player player)
    Checks if the world spawn chunks and the player chunks are loaded.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • WorldBridge

      public WorldBridge()
  • Method Details

    • getAllWorlds

      public static org.bukkit.World[] getAllWorlds()
      Get all the worlds associated with the server.
      Returns:
      A collection of worlds on the server.
    • getMainWorld

      public static org.bukkit.World getMainWorld()
      Get the first world which is configured by the server as the main world.
      Returns:
      The main world.
    • getWorld

      public static org.bukkit.World getWorld(String worldName)
      Get a world by the specified name if the world exists.
      Parameters:
      worldName - The name of the world to check.
      Returns:
      The world with the specified name.
    • isPlayerChunkLoaded

      public static boolean isPlayerChunkLoaded(org.bukkit.World world, org.bukkit.entity.Player player)
      Checks if the world chunk that the player is in is loaded.
      Parameters:
      world - The world to check.
      player - The player within the world to check.
      Returns:
      True if the chunk is loaded.
    • isSpawnChunkLoaded

      public static boolean isSpawnChunkLoaded(org.bukkit.World world)
      Checks if the world spawn chunks are loaded.
      Parameters:
      world - The world to check.
      Returns:
      True if the spawn chunks are loaded.
    • isWorldLoaded

      public static boolean isWorldLoaded(org.bukkit.World world, org.bukkit.entity.Player player)
      Checks if the world spawn chunks and the player chunks are loaded.
      Parameters:
      world - The world to check.
      player - The player to check.
      Returns:
      True if the world is loaded.