Class Space
java.lang.Object
ua.mcchickenstudio.opencreative.managers.space.Space
- All Implemented Interfaces:
Manager, PlanetsManager
-
Constructor Summary
Constructors -
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, @NotNull 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.getDevPlanet(@NotNull org.bukkit.World world) Returns a developers planet, that has same world as specified one.getDevPlanet(@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.getName()Returns name of manager, that will be displayed by request in the logs.@Nullable PlanetgetPlanetByAnyID(@NotNull String id) Returns a planet, that has same numeric or custom ID as specified one.getPlanetByCustomID(@NotNull String customID) Returns a planet, that has same custom ID as specified one.getPlanetById(@NotNull String id) Returns a planet, that has same original ID as specified one.getPlanetByPlayer(@NotNull org.bukkit.entity.Player player) Returns a planet, where player currently is connected.getPlanetByWorld(@NotNull org.bukkit.World world) Returns a planet, that has same world as specified one.getPlanetByWorldName(@NotNull String worldName) 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 player) Returns a set of planets, that are owned by specified player.getPlanetsContainingID(@NotNull String worldID) Returns a set of planets, that contain specified custom ID.getPlanetsContainingName(@NotNull String worldName) Returns a set of planets, that contain specified display name.Returns a list of planets, that are marked in config.yml as recommended.voidinit()Initialization of manager.booleanChecks if manager is ready to work.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.
-
Constructor Details
-
Space
public Space()
-
-
Method Details
-
getPlanets
Description copied from interface:PlanetsManagerReturns a set of all stable planets in base.- Specified by:
getPlanetsin interfacePlanetsManager- Returns:
- set of planets.
-
getCorruptedPlanets
Description copied from interface:PlanetsManagerReturns a set of all corrupted planets in base. They will be not displayed in worlds browser menu or even in search orders.- Specified by:
getCorruptedPlanetsin interfacePlanetsManager- Returns:
- set of planets.
-
registerPlanet
Description copied from interface:PlanetsManagerRegisters planet to base, for example if plugin found planet data while loading planets.- Specified by:
registerPlanetin interfacePlanetsManager- Parameters:
planet- planet to register.
-
unregisterPlanet
Description copied from interface:PlanetsManagerUnregisters planet from base, so it will be not displayed in worlds browser menu.- Specified by:
unregisterPlanetin interfacePlanetsManager- Parameters:
planet- planet to unregister.
-
createPlanet
public void createPlanet(@NotNull @NotNull org.bukkit.entity.Player owner, int id, @NotNull @NotNull WorldGenerator generator) Description copied from interface:PlanetsManagerCreates and loads a new planet for player with specified world generator.- Specified by:
createPlanetin interfacePlanetsManager- Parameters:
owner- Owner of planet.id- ID of planet.generator- Generator of world.
-
createPlanet
public void createPlanet(@NotNull @NotNull org.bukkit.entity.Player owner, int id, @NotNull @NotNull WorldTemplate template) Description copied from interface:PlanetsManagerCopies template world folder and creates a new planet for player.- Specified by:
createPlanetin interfacePlanetsManager- Parameters:
owner- owner of planet.id- ID of planet.template- template of world.
-
createPlanet
public 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) Description copied from interface:PlanetsManagerCreates and loads a new planet for player with specified world generator, environment, seed and generate sturctures option.- Specified by:
createPlanetin interfacePlanetsManager- 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.
-
getPlanetsByOwner
@NotNull public @NotNull Set<Planet> getPlanetsByOwner(@NotNull @NotNull org.bukkit.entity.Player player) Description copied from interface:PlanetsManagerReturns a set of planets, that are owned by specified player.- Specified by:
getPlanetsByOwnerin interfacePlanetsManager- Parameters:
player- owner of planets.- Returns:
- set of player's created planets.
-
deletePlanet
Description copied from interface:PlanetsManagerUnregisters planet, teleports planet players to lobby, unloads world and removes planet folders.- Specified by:
deletePlanetin interfacePlanetsManager- Parameters:
planet- planet to delete.
-
getRecommendedPlanets
Description copied from interface:PlanetsManagerReturns a list of planets, that are marked in config.yml as recommended.- Specified by:
getRecommendedPlanetsin interfacePlanetsManager- Returns:
- list of recommended planets.
-
getFavoritePlanets
Description copied from interface:PlanetsManagerReturns a list of player's favorite worlds.- Specified by:
getFavoritePlanetsin interfacePlanetsManager- Parameters:
wander- player as wander.- Returns:
- set of player's favorite planets.
-
getPlanetsContainingName
Description copied from interface:PlanetsManagerReturns a set of planets, that contain specified display name.- Specified by:
getPlanetsContainingNamein interfacePlanetsManager- Parameters:
worldName- display name.- Returns:
- set of planets with similar display names.
-
getPlanetsContainingID
Description copied from interface:PlanetsManagerReturns a set of planets, that contain specified custom ID.- Specified by:
getPlanetsContainingIDin interfacePlanetsManager- Parameters:
worldID- custom id.- Returns:
- set of planets with similar custom IDs.
-
getPlanetsByOwner
Description copied from interface:PlanetsManagerReturns a set of planets, that are owned by specified player name.- Specified by:
getPlanetsByOwnerin interfacePlanetsManager- Parameters:
owner- owner of planets.- Returns:
- set of player's created planets.
-
getPlanetByPlayer
Description copied from interface:PlanetsManagerReturns a planet, where player currently is connected. Should return planet even if player is in dev planet.- Specified by:
getPlanetByPlayerin interfacePlanetsManager- Parameters:
player- to get planet.- Returns:
- if player is in planet - returns planet, else - null.
-
getDevPlanet
Description copied from interface:PlanetsManagerReturns a developers planet, where player currently is connected.- Specified by:
getDevPlanetin interfacePlanetsManager- Parameters:
player- to get dev planet.- Returns:
- if player is in dev planet - returns dev planet, else - null.
-
getDevPlanet
Description copied from interface:PlanetsManagerReturns a developers planet, that has same world as specified one.- Specified by:
getDevPlanetin interfacePlanetsManager- Parameters:
world- to get dev planet.- Returns:
- if exists - dev planet, else - null.
-
getPlanetByWorld
Description copied from interface:PlanetsManagerReturns a planet, that has same world as specified one.- Specified by:
getPlanetByWorldin interfacePlanetsManager- Parameters:
world- to get planet.- Returns:
- if exists - planet, else - null.
-
getPlanetByWorldName
Description copied from interface:PlanetsManagerReturns a planet, that has same Minecraft world name as specified one.- Specified by:
getPlanetByWorldNamein interfacePlanetsManager- Parameters:
worldName- world name to get planet.- Returns:
- if exists - planet, else - null.
-
getPlanetById
Description copied from interface:PlanetsManagerReturns a planet, that has same original ID as specified one.- Specified by:
getPlanetByIdin interfacePlanetsManager- Parameters:
id- to get planet.- Returns:
- if exists - planet, else - null.
-
getPlanetByAnyID
Description copied from interface:PlanetsManagerReturns a planet, that has same numeric or custom ID as specified one.- Specified by:
getPlanetByAnyIDin interfacePlanetsManager- Parameters:
id- to get planet.- Returns:
- if exists - planet, else - null.
-
getPlanetByCustomID
Description copied from interface:PlanetsManagerReturns a planet, that has same custom ID as specified one.- Specified by:
getPlanetByCustomIDin interfacePlanetsManager- Parameters:
customID- to get planet.- Returns:
- if exists - planet, else - null.
-
init
-
isEnabled
-
isStableConnection
public boolean isStableConnection()Description copied from interface:PlanetsManagerCheck if connection with database is stable.- Specified by:
isStableConnectionin interfacePlanetsManager- Returns:
- true - if connection is normal, false - not stable.
-
getName
-