java.lang.Object
com.gamersafer.minecraft.auth.paper.onboarding.world.WorldLoader

public class WorldLoader extends Object
Loads a world, either one that already exists, or from a zip inside the plugin.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WorldLoader(@NonNull GSAuthPaper plugin)
    Constructs WorldLoader.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the world's config loader.
    void
    Creates the world and registers it with the server.
    void
    Disables the onboarding room world.
    Returns this world's hologram service.
    boolean
     
    void
    Loads the world file from the plugins resource folder, and extracts it to the server's directory.
    void
    openBook(com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
    Opens this world's onboarding book for player.
    void
    Sets up post-creation features, such as holograms.
    @NonNull org.bukkit.Location
    Returns a new Location containing coordinates for this world's spawn.
    org.bukkit.World
    Returns the world.

    Methods inherited from class java.lang.Object

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

    • WorldLoader

      public WorldLoader(@NonNull GSAuthPaper plugin)
      Constructs WorldLoader.
      Parameters:
      plugin - the plugin
  • Method Details

    • load

      public void load()
      Loads the world file from the plugins resource folder, and extracts it to the server's directory.
    • isLoaded

      public boolean isLoaded()
      Returns:
      whether the world has been loaded
    • create

      public void create()
      Creates the world and registers it with the server. Must be called after load().
    • setup

      public void setup()
      Sets up post-creation features, such as holograms.
    • disable

      public void disable()
      Disables the onboarding room world.
    • world

      public org.bukkit.World world()
      Returns the world.
      Returns:
      the world or null if it was not created. See create()
      Throws:
      RuntimeException - if the world is not loaded yet
    • spawnLocation

      public @NonNull org.bukkit.Location spawnLocation()
      Returns a new Location containing coordinates for this world's spawn.
      Returns:
      the spawn location
    • hologramService

      public HologramService hologramService()
      Returns this world's hologram service.
      Returns:
      the hologram service; null if ProtocolLib is not present
    • configLoader

      public @NonNull WorldConfigurationLoader configLoader()
      Returns the world's config loader.
      Returns:
      the config loader
    • openBook

      public void openBook(com.gamersafer.minecraft.auth.common.abstraction.IPlayer player)
      Opens this world's onboarding book for player.
      Parameters:
      player - the player