Interface PlanetsManager

All Superinterfaces:
Manager, ShutDownable, Startable, Toggleable
All Known Implementing Classes:
Space

public interface PlanetsManager extends Manager, Toggleable

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 Type
    Method
    Description
    void
    createPlanet(@NotNull org.bukkit.entity.Player owner, int id, @NotNull WorldGenerator generator)
    Creates and loads a new planet for player with specified world generator.
    void
    createPlanet(@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.
    void
    createPlanet(@NotNull org.bukkit.entity.Player owner, int id, @NotNull WorldTemplate template)
    Copies template world folder and creates a new planet for player.
    boolean
    deletePlanet(@NotNull Planet planet)
    Unregisters planet, teleports planet players to lobby, unloads world and removes planet folders.
    @NotNull Set<Planet>
    Returns a set of all corrupted planets in base.
    @Nullable DevPlanet
    getDevPlanet(@NotNull org.bukkit.World world)
    Returns a developers planet, that has same world as specified one.
    @Nullable DevPlanet
    getDevPlanet(@NotNull org.bukkit.entity.Player player)
    Returns a developers planet, where player currently is connected.
    @NotNull Set<Planet>
    Returns a list of player's favorite worlds.
    @Nullable Planet
    getPlanetByAnyID(@NotNull String id)
    Returns a planet, that has same numeric or custom ID as specified one.
    @Nullable Planet
    Returns a planet, that has same custom ID as specified one.
    @Nullable Planet
    getPlanetById(@NotNull String id)
    Returns a planet, that has same original ID as specified one.
    @Nullable Planet
    getPlanetByPlayer(@NotNull org.bukkit.entity.Player player)
    Returns a planet, where player currently is connected.
    @Nullable Planet
    getPlanetByWorld(@NotNull org.bukkit.World world)
    Returns a planet, that has same world as specified one.
    @Nullable Planet
    Returns a planet, that has same Minecraft world name as specified one.
    @NotNull Set<Planet>
    Returns a set of all stable planets in base.
    @NotNull Set<Planet>
    getPlanetsByOwner(@NotNull String owner)
    Returns a set of planets, that are owned by specified player name.
    @NotNull Set<Planet>
    getPlanetsByOwner(@NotNull org.bukkit.entity.Player owner)
    Returns a set of planets, that are owned by specified player.
    @NotNull Set<Planet>
    Returns a set of planets, that contain specified custom ID.
    @NotNull Set<Planet>
    Returns a set of planets, that contain specified display name.
    @NotNull List<Planet>
    Returns a list of planets, that are marked in config.yml as recommended.
    boolean
    Check if connection with database is stable.
    void
    registerPlanet(@NotNull Planet planet)
    Registers planet to base, for example if plugin found planet data while loading planets.
    void
    unregisterPlanet(@NotNull Planet planet)
    Unregisters planet from base, so it will be not displayed in worlds browser menu.

    Methods inherited from interface ua.mcchickenstudio.opencreative.managers.Manager

    getName

    Methods inherited from interface ua.mcchickenstudio.opencreative.managers.ShutDownable

    shutdown

    Methods inherited from interface ua.mcchickenstudio.opencreative.managers.Startable

    start

    Methods inherited from interface ua.mcchickenstudio.opencreative.managers.Toggleable

    isWorking
  • Method Details

    • getPlanets

      @NotNull @NotNull Set<Planet> getPlanets()
      Returns a set of all stable planets in base.
      Returns:
      set of planets.
    • getCorruptedPlanets

      @NotNull @NotNull Set<Planet> getCorruptedPlanets()
      Returns a set of all corrupted planets in base. They will be not displayed in worlds browser menu or even in search orders.
      Returns:
      set of planets.
    • getPlanetById

      @Nullable @Nullable Planet getPlanetById(@NotNull @NotNull String id)
      Returns a planet, that has same original ID as specified one.
      Parameters:
      id - to get planet.
      Returns:
      if exists - planet, else - null.
    • getDevPlanet

      @Nullable @Nullable DevPlanet getDevPlanet(@NotNull @NotNull org.bukkit.entity.Player player)
      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

      @Nullable @Nullable DevPlanet getDevPlanet(@NotNull @NotNull org.bukkit.World world)
      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

      @Nullable @Nullable Planet getPlanetByPlayer(@NotNull @NotNull org.bukkit.entity.Player player)
      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

      @Nullable @Nullable Planet getPlanetByWorld(@NotNull @NotNull org.bukkit.World world)
      Returns a planet, that has same world as specified one.
      Parameters:
      world - to get planet.
      Returns:
      if exists - planet, else - null.
    • getPlanetsByOwner

      @NotNull @NotNull Set<Planet> getPlanetsByOwner(@NotNull @NotNull String owner)
      Returns a set of planets, that are owned by specified player name.
      Parameters:
      owner - owner of planets.
      Returns:
      set of player's created planets.
    • getPlanetsByOwner

      @NotNull @NotNull Set<Planet> getPlanetsByOwner(@NotNull @NotNull org.bukkit.entity.Player owner)
      Returns a set of planets, that are owned by specified player.
      Parameters:
      owner - owner of planets.
      Returns:
      set of player's created planets.
    • getPlanetByWorldName

      @Nullable @Nullable Planet getPlanetByWorldName(@NotNull @NotNull String name)
      Returns a planet, that has same Minecraft world name as specified one.
      Parameters:
      name - world name to get planet.
      Returns:
      if exists - planet, else - null.
    • getPlanetByAnyID

      @Nullable @Nullable Planet getPlanetByAnyID(@NotNull @NotNull String id)
      Returns a planet, that has same numeric or custom ID as specified one.
      Parameters:
      id - to get planet.
      Returns:
      if exists - planet, else - null.
    • getPlanetByCustomID

      @Nullable @Nullable Planet getPlanetByCustomID(@NotNull @NotNull String id)
      Returns a planet, that has same custom ID as specified one.
      Parameters:
      id - to get planet.
      Returns:
      if exists - planet, else - null.
    • getRecommendedPlanets

      @NotNull @NotNull List<Planet> getRecommendedPlanets()
      Returns a list of planets, that are marked in config.yml as recommended.
      Returns:
      list of recommended planets.
    • getFavoritePlanets

      @NotNull @NotNull Set<Planet> getFavoritePlanets(@NotNull @NotNull OfflineWander wander)
      Returns a list of player's favorite worlds.
      Parameters:
      wander - player as wander.
      Returns:
      set of player's favorite planets.
    • getPlanetsContainingID

      @NotNull @NotNull Set<Planet> getPlanetsContainingID(@NotNull @NotNull String id)
      Returns a set of planets, that contain specified custom ID.
      Parameters:
      id - custom id.
      Returns:
      set of planets with similar custom IDs.
    • getPlanetsContainingName

      @NotNull @NotNull Set<Planet> getPlanetsContainingName(@NotNull @NotNull String name)
      Returns a set of planets, that contain specified display name.
      Parameters:
      name - display name.
      Returns:
      set of planets with similar display names.
    • 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

      boolean deletePlanet(@NotNull @NotNull Planet planet)
      Unregisters planet, teleports planet players to lobby, unloads world and removes planet folders.
      Parameters:
      planet - planet to delete.
    • registerPlanet

      void registerPlanet(@NotNull @NotNull Planet planet)
      Registers planet to base, for example if plugin found planet data while loading planets.
      Parameters:
      planet - planet to register.
    • unregisterPlanet

      void unregisterPlanet(@NotNull @NotNull Planet planet)
      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.