Interface PlanetsManager
- All Superinterfaces:
Manager, ShutDownable, Startable, Toggleable
- All Known Implementing Classes:
Space
PlanetsManager
This interface represents a planets manager, that can manipulates with planets. It has methods to get current planet by player, world and info. It creates, registers and deletes planets.-
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePlanet(@NotNull org.bukkit.entity.Player owner, int id, @NotNull WorldGenerator generator) Creates and loads a new planet for player with specified world generator.voidcreatePlanet(@NotNull org.bukkit.entity.Player owner, int id, @NotNull WorldGenerator generator, org.bukkit.World.Environment environment, long seed, boolean generateStructures, @NotNull String biome) Creates and loads a new planet for player with specified world generator, environment, seed and generate sturctures option.voidcreatePlanet(@NotNull org.bukkit.entity.Player owner, int id, @NotNull WorldTemplate template) Copies template world folder and creates a new planet for player.booleandeletePlanet(@NotNull Planet planet) Unregisters planet, teleports planet players to lobby, unloads world and removes planet folders.Returns a set of all corrupted planets in base.@Nullable DevPlanetgetDevPlanet(@NotNull org.bukkit.World world) Returns a developers planet, that has same world as specified one.@Nullable DevPlanetgetDevPlanet(@NotNull org.bukkit.entity.Player player) Returns a developers planet, where player currently is connected.getFavoritePlanets(@NotNull OfflineWander wander) Returns a list of player's favorite worlds.@Nullable PlanetgetPlanetByAnyID(@NotNull String id) Returns a planet, that has same numeric or custom ID as specified one.@Nullable PlanetgetPlanetByCustomID(@NotNull String id) Returns a planet, that has same custom ID as specified one.@Nullable PlanetgetPlanetById(@NotNull String id) Returns a planet, that has same original ID as specified one.@Nullable PlanetgetPlanetByPlayer(@NotNull org.bukkit.entity.Player player) Returns a planet, where player currently is connected.@Nullable PlanetgetPlanetByWorld(@NotNull org.bukkit.World world) Returns a planet, that has same world as specified one.@Nullable PlanetgetPlanetByWorldName(@NotNull String name) Returns a planet, that has same Minecraft world name as specified one.Returns a set of all stable planets in base.getPlanetsByOwner(@NotNull String owner) Returns a set of planets, that are owned by specified player name.getPlanetsByOwner(@NotNull org.bukkit.entity.Player owner) Returns a set of planets, that are owned by specified player.getPlanetsContainingID(@NotNull String id) Returns a set of planets, that contain specified custom ID.getPlanetsContainingName(@NotNull String name) Returns a set of planets, that contain specified display name.Returns a list of planets, that are marked in config.yml as recommended.booleanCheck if connection with database is stable.voidregisterPlanet(@NotNull Planet planet) Registers planet to base, for example if plugin found planet data while loading planets.voidunregisterPlanet(@NotNull Planet planet) Unregisters planet from base, so it will be not displayed in worlds browser menu.Methods inherited from interface ShutDownable
shutdownMethods inherited from interface Toggleable
isWorkingModifier and TypeMethodDescriptionbooleanChecks whether manager was started successfully and it currently works.
-
Method Details
-
getPlanets
-
getCorruptedPlanets
-
getPlanetById
-
getDevPlanet
Returns a developers planet, where player currently is connected.- Parameters:
player- to get dev planet.- Returns:
- if player is in dev planet - returns dev planet, else - null.
-
getDevPlanet
Returns a developers planet, that has same world as specified one.- Parameters:
world- to get dev planet.- Returns:
- if exists - dev planet, else - null.
-
getPlanetByPlayer
Returns a planet, where player currently is connected. Should return planet even if player is in dev planet.- Parameters:
player- to get planet.- Returns:
- if player is in planet - returns planet, else - null.
-
getPlanetByWorld
Returns a planet, that has same world as specified one.- Parameters:
world- to get planet.- Returns:
- if exists - planet, else - null.
-
getPlanetsByOwner
-
getPlanetsByOwner
-
getPlanetByWorldName
-
getPlanetByAnyID
-
getPlanetByCustomID
-
getRecommendedPlanets
-
getFavoritePlanets
Returns a list of player's favorite worlds.- Parameters:
wander- player as wander.- Returns:
- set of player's favorite planets.
-
getPlanetsContainingID
-
getPlanetsContainingName
-
createPlanet
void createPlanet(@NotNull @NotNull org.bukkit.entity.Player owner, int id, @NotNull @NotNull WorldTemplate template) Copies template world folder and creates a new planet for player.- Parameters:
owner- owner of planet.id- ID of planet.template- template of world.
-
createPlanet
void createPlanet(@NotNull @NotNull org.bukkit.entity.Player owner, int id, @NotNull @NotNull WorldGenerator generator) Creates and loads a new planet for player with specified world generator.- Parameters:
owner- Owner of planet.id- ID of planet.generator- Generator of world.
-
createPlanet
void createPlanet(@NotNull @NotNull org.bukkit.entity.Player owner, int id, @NotNull @NotNull WorldGenerator generator, @NotNull org.bukkit.World.Environment environment, long seed, boolean generateStructures, @NotNull @NotNull String biome) Creates and loads a new planet for player with specified world generator, environment, seed and generate sturctures option.- Parameters:
owner- Owner of planet.id- ID of planet.generator- Generator of world.environment- Environment of world.seed- Seed for generation.generateStructures- Generate or not generate structures.biome- Biome for generation.
-
deletePlanet
Unregisters planet, teleports planet players to lobby, unloads world and removes planet folders.- Parameters:
planet- planet to delete.
-
registerPlanet
Registers planet to base, for example if plugin found planet data while loading planets.- Parameters:
planet- planet to register.
-
unregisterPlanet
Unregisters planet from base, so it will be not displayed in worlds browser menu.- Parameters:
planet- planet to unregister.
-
isStableConnection
boolean isStableConnection()Check if connection with database is stable.- Returns:
- true - if connection is normal, false - not stable.
-