Class WorldLoader
java.lang.Object
com.gamersafer.minecraft.auth.paper.onboarding.world.WorldLoader
Loads a world, either one that already exists, or from a zip inside the plugin.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NonNull WorldConfigurationLoaderReturns the world's config loader.voidcreate()Creates the world and registers it with the server.voiddisable()Disables the onboarding room world.Returns this world's hologram service.booleanisLoaded()voidload()Loads the world file from the plugins resource folder, and extracts it to the server's directory.voidopenBook(com.gamersafer.minecraft.auth.common.abstraction.IPlayer player) Opens this world's onboarding book forplayer.voidsetup()Sets up post-creation features, such as holograms.@NonNull org.bukkit.LocationReturns a newLocationcontaining coordinates for this world's spawn.org.bukkit.Worldworld()Returns the world.
-
Constructor Details
-
WorldLoader
ConstructsWorldLoader.- 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 afterload(). -
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 newLocationcontaining coordinates for this world's spawn.- Returns:
- the spawn location
-
hologramService
Returns this world's hologram service.- Returns:
- the hologram service; null if ProtocolLib is not present
-
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 forplayer.- Parameters:
player- the player
-