Class Space

java.lang.Object
ua.mcchickenstudio.opencreative.managers.space.Space
All Implemented Interfaces:
Manager, PlanetsManager

public final class Space extends Object implements PlanetsManager
  • Constructor Details

    • Space

      public Space()
  • Method Details

    • getPlanets

      @NotNull public @NotNull Set<Planet> getPlanets()
      Description copied from interface: PlanetsManager
      Returns a set of all stable planets in base.
      Specified by:
      getPlanets in interface PlanetsManager
      Returns:
      set of planets.
    • getCorruptedPlanets

      @NotNull public @NotNull Set<Planet> getCorruptedPlanets()
      Description copied from interface: PlanetsManager
      Returns a set of all corrupted planets in base. They will be not displayed in worlds browser menu or even in search orders.
      Specified by:
      getCorruptedPlanets in interface PlanetsManager
      Returns:
      set of planets.
    • registerPlanet

      public void registerPlanet(@NotNull @NotNull Planet planet)
      Description copied from interface: PlanetsManager
      Registers planet to base, for example if plugin found planet data while loading planets.
      Specified by:
      registerPlanet in interface PlanetsManager
      Parameters:
      planet - planet to register.
    • unregisterPlanet

      public void unregisterPlanet(@NotNull @NotNull Planet planet)
      Description copied from interface: PlanetsManager
      Unregisters planet from base, so it will be not displayed in worlds browser menu.
      Specified by:
      unregisterPlanet in interface PlanetsManager
      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: PlanetsManager
      Creates and loads a new planet for player with specified world generator.
      Specified by:
      createPlanet in interface PlanetsManager
      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: PlanetsManager
      Copies template world folder and creates a new planet for player.
      Specified by:
      createPlanet in interface PlanetsManager
      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: PlanetsManager
      Creates and loads a new planet for player with specified world generator, environment, seed and generate sturctures option.
      Specified by:
      createPlanet in interface PlanetsManager
      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: PlanetsManager
      Returns a set of planets, that are owned by specified player.
      Specified by:
      getPlanetsByOwner in interface PlanetsManager
      Parameters:
      player - owner of planets.
      Returns:
      set of player's created planets.
    • deletePlanet

      public boolean deletePlanet(@NotNull @NotNull Planet planet)
      Description copied from interface: PlanetsManager
      Unregisters planet, teleports planet players to lobby, unloads world and removes planet folders.
      Specified by:
      deletePlanet in interface PlanetsManager
      Parameters:
      planet - planet to delete.
    • getRecommendedPlanets

      @NotNull public @NotNull List<Planet> getRecommendedPlanets()
      Description copied from interface: PlanetsManager
      Returns a list of planets, that are marked in config.yml as recommended.
      Specified by:
      getRecommendedPlanets in interface PlanetsManager
      Returns:
      list of recommended planets.
    • getFavoritePlanets

      @NotNull public @NotNull Set<Planet> getFavoritePlanets(@NotNull @NotNull OfflineWander wander)
      Description copied from interface: PlanetsManager
      Returns a list of player's favorite worlds.
      Specified by:
      getFavoritePlanets in interface PlanetsManager
      Parameters:
      wander - player as wander.
      Returns:
      set of player's favorite planets.
    • getPlanetsContainingName

      @NotNull public @NotNull Set<Planet> getPlanetsContainingName(@NotNull @NotNull String worldName)
      Description copied from interface: PlanetsManager
      Returns a set of planets, that contain specified display name.
      Specified by:
      getPlanetsContainingName in interface PlanetsManager
      Parameters:
      worldName - display name.
      Returns:
      set of planets with similar display names.
    • getPlanetsContainingID

      @NotNull public @NotNull Set<Planet> getPlanetsContainingID(@NotNull @NotNull String worldID)
      Description copied from interface: PlanetsManager
      Returns a set of planets, that contain specified custom ID.
      Specified by:
      getPlanetsContainingID in interface PlanetsManager
      Parameters:
      worldID - custom id.
      Returns:
      set of planets with similar custom IDs.
    • getPlanetsByOwner

      @NotNull public @NotNull Set<Planet> getPlanetsByOwner(@NotNull @NotNull String owner)
      Description copied from interface: PlanetsManager
      Returns a set of planets, that are owned by specified player name.
      Specified by:
      getPlanetsByOwner in interface PlanetsManager
      Parameters:
      owner - owner of planets.
      Returns:
      set of player's created planets.
    • getPlanetByPlayer

      public Planet getPlanetByPlayer(@NotNull @NotNull org.bukkit.entity.Player player)
      Description copied from interface: PlanetsManager
      Returns a planet, where player currently is connected. Should return planet even if player is in dev planet.
      Specified by:
      getPlanetByPlayer in interface PlanetsManager
      Parameters:
      player - to get planet.
      Returns:
      if player is in planet - returns planet, else - null.
    • getDevPlanet

      public DevPlanet getDevPlanet(@NotNull @NotNull org.bukkit.entity.Player player)
      Description copied from interface: PlanetsManager
      Returns a developers planet, where player currently is connected.
      Specified by:
      getDevPlanet in interface PlanetsManager
      Parameters:
      player - to get dev planet.
      Returns:
      if player is in dev planet - returns dev planet, else - null.
    • getDevPlanet

      public DevPlanet getDevPlanet(@NotNull @NotNull org.bukkit.World world)
      Description copied from interface: PlanetsManager
      Returns a developers planet, that has same world as specified one.
      Specified by:
      getDevPlanet in interface PlanetsManager
      Parameters:
      world - to get dev planet.
      Returns:
      if exists - dev planet, else - null.
    • getPlanetByWorld

      public Planet getPlanetByWorld(@NotNull @NotNull org.bukkit.World world)
      Description copied from interface: PlanetsManager
      Returns a planet, that has same world as specified one.
      Specified by:
      getPlanetByWorld in interface PlanetsManager
      Parameters:
      world - to get planet.
      Returns:
      if exists - planet, else - null.
    • getPlanetByWorldName

      public Planet getPlanetByWorldName(@NotNull @NotNull String worldName)
      Description copied from interface: PlanetsManager
      Returns a planet, that has same Minecraft world name as specified one.
      Specified by:
      getPlanetByWorldName in interface PlanetsManager
      Parameters:
      worldName - world name to get planet.
      Returns:
      if exists - planet, else - null.
    • getPlanetById

      public Planet getPlanetById(@NotNull @NotNull String id)
      Description copied from interface: PlanetsManager
      Returns a planet, that has same original ID as specified one.
      Specified by:
      getPlanetById in interface PlanetsManager
      Parameters:
      id - to get planet.
      Returns:
      if exists - planet, else - null.
    • getPlanetByAnyID

      @Nullable public @Nullable Planet getPlanetByAnyID(@NotNull @NotNull String id)
      Description copied from interface: PlanetsManager
      Returns a planet, that has same numeric or custom ID as specified one.
      Specified by:
      getPlanetByAnyID in interface PlanetsManager
      Parameters:
      id - to get planet.
      Returns:
      if exists - planet, else - null.
    • getPlanetByCustomID

      public Planet getPlanetByCustomID(@NotNull @NotNull String customID)
      Description copied from interface: PlanetsManager
      Returns a planet, that has same custom ID as specified one.
      Specified by:
      getPlanetByCustomID in interface PlanetsManager
      Parameters:
      customID - to get planet.
      Returns:
      if exists - planet, else - null.
    • init

      public void init()
      Description copied from interface: Manager
      Initialization of manager.
      Specified by:
      init in interface Manager
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: Manager
      Checks if manager is ready to work.
      Specified by:
      isEnabled in interface Manager
      Returns:
      true - if enabled, false - disabled.
    • isStableConnection

      public boolean isStableConnection()
      Description copied from interface: PlanetsManager
      Check if connection with database is stable.
      Specified by:
      isStableConnection in interface PlanetsManager
      Returns:
      true - if connection is normal, false - not stable.
    • getName

      public String getName()
      Description copied from interface: Manager
      Returns name of manager, that will be displayed by request in the logs.
      Specified by:
      getName in interface Manager
      Returns:
      name of manager.