Class IslandGenerator

java.lang.Object
us.talabrek.ultimateskyblock.island.IslandGenerator

public class IslandGenerator extends Object
The factory for creating islands (actual blocks).
  • Constructor Summary

    Constructors
    Constructor
    Description
    IslandGenerator(@NotNull File dataFolder, @NotNull org.bukkit.configuration.file.FileConfiguration config)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    createIsland(@NotNull PlayerPerk playerPerk, @NotNull org.bukkit.Location next, @Nullable String cSchem)
    Generate an island at the given Location.
    boolean
    findAndSetChest(@NotNull org.bukkit.Location location, @NotNull Perk perk)
    Find the nearest chest at the given Location and fill the chest with the starter and Perk based items.
    Gets a List of available schematic names.
    boolean
    setChest(@Nullable org.bukkit.Location chestLocation, @NotNull Perk perk)
    Fill the Inventory of the given chest Location with the starter and Perk based items.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IslandGenerator

      public IslandGenerator(@NotNull @NotNull File dataFolder, @NotNull @NotNull org.bukkit.configuration.file.FileConfiguration config)
  • Method Details

    • getSchemeNames

      public List<String> getSchemeNames()
      Gets a List of available schematic names.
      Returns:
      List of available schematic names.
    • createIsland

      public boolean createIsland(@NotNull @NotNull PlayerPerk playerPerk, @NotNull @NotNull org.bukkit.Location next, @Nullable @Nullable String cSchem)
      Generate an island at the given Location.
      Parameters:
      playerPerk - PlayerPerk object for the island owner.
      next - Location to generate an island.
      cSchem - New island schematic.
      Returns:
      True if the island was generated, false otherwise.
    • findAndSetChest

      public boolean findAndSetChest(@NotNull @NotNull org.bukkit.Location location, @NotNull @NotNull Perk perk)
      Find the nearest chest at the given Location and fill the chest with the starter and Perk based items.
      Parameters:
      location - Location to search for a chest.
      perk - Perk containing extra perk-based items to add.
      Returns:
      True if the chest is found and filled, false otherwise.
    • setChest

      public boolean setChest(@Nullable @Nullable org.bukkit.Location chestLocation, @NotNull @NotNull Perk perk)
      Fill the Inventory of the given chest Location with the starter and Perk based items.
      Parameters:
      chestLocation - Location of the chest block.
      perk - Perk containing extra perk-based items to add.
      Returns:
      True if the chest is found and filled, false otherwise.