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
-
Method Summary
Modifier and TypeMethodDescription@NonNull WorldConfigurationLoader
Returns the world's config loader.void
create()
Creates the world and registers it with the server.void
disable()
Disables the onboarding room world.Returns this world's hologram service.boolean
isLoaded()
void
load()
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 forplayer
.void
setup()
Sets up post-creation features, such as holograms.@NonNull org.bukkit.Location
Returns a newLocation
containing coordinates for this world's spawn.org.bukkit.World
world()
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 newLocation
containing 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
-