Skip to main content

Overview

The GridManager interface handles all island-related operations including creation, deletion, retrieval, and grid management. Access it via SuperiorSkyblockAPI.getGrid().

Island Creation

createIsland(SuperiorPlayer, String, BigDecimal, Biome, String)
void
Create a new island.Parameters:
  • superiorPlayer - The new owner for the island
  • schemName - The schematic that should be used
  • bonus - A starting worth for the island
  • biome - A starting biome for the island
  • islandName - The name of the new island
createIsland(SuperiorPlayer, String, BigDecimal, Biome, String, boolean)
void
Create a new island with offset option.Parameters:
  • superiorPlayer - The new owner for the island
  • schemName - The schematic that should be used
  • bonus - A starting worth for the island
  • biome - A starting biome for the island
  • islandName - The name of the new island
  • offset - Should the island have an offset for its values? If disabled, the bonus will be given
createIsland(SuperiorPlayer, String, BigDecimal, BigDecimal, Biome, String, boolean)
void
Create a new island with separate worth and level bonuses.Parameters:
  • superiorPlayer - The new owner for the island
  • schemName - The schematic that should be used
  • bonusWorth - A starting worth for the island
  • bonusLevel - A starting level for the island
  • biome - A starting biome for the island
  • islandName - The name of the new island
  • offset - Should the island have an offset for its values? If disabled, the bonus will be given
createIsland(SuperiorPlayer, String, BigDecimal, BigDecimal, Biome, String, boolean, @Nullable BlockOffset)
void
Create a new island with spawn offset.Parameters:
  • superiorPlayer - The new owner for the island
  • schemName - The schematic that should be used
  • bonusWorth - A starting worth for the island
  • bonusLevel - A starting level for the island
  • biome - A starting biome for the island
  • islandName - The name of the new island
  • offset - Should the island have an offset for its values? If disabled, the bonus will be given
  • spawnOffset - The offset to teleport the player to from the center of the schematic
createIsland(Island.Builder, Biome, boolean)
void
Create a new island using a builder.Parameters:
  • builder - The builder for the island
  • biome - A starting biome for the island
  • offset - Should the island have an offset for its values? If disabled, the bonus will be given
createIsland(Island.Builder, Biome, boolean, @Nullable BlockOffset)
void
Create a new island using a builder with spawn offset.Parameters:
  • builder - The builder for the island
  • biome - A starting biome for the island
  • offset - Should the island have an offset for its values? If disabled, the bonus will be given
  • spawnOffset - The offset to teleport the player to from the center of the schematic

Island Creation Algorithm

setIslandCreationAlgorithm(@Nullable IslandCreationAlgorithm)
void
Set the creation algorithm for islands.Parameters:
  • islandCreationAlgorithm - The new algorithm to set. If null, the default one will be used
getIslandCreationAlgorithm()
IslandCreationAlgorithm
Get the currently used island creation algorithm.Returns: The current island creation algorithm
hasActiveCreateRequest(SuperiorPlayer)
boolean
Checks if a player has an active request for creating an island.Parameters:
  • superiorPlayer - The player to check
Returns: True if the player has an active create request

Island Preview

startIslandPreview(SuperiorPlayer, String, String)
void
Start the island preview task for a specific player.Parameters:
  • superiorPlayer - The player to start preview for
  • schemName - The schematic to preview
  • islandName - The requested island name by the player
cancelIslandPreview(SuperiorPlayer)
void
Cancel the island preview for a specific player.Parameters:
  • superiorPlayer - The player to cancel preview for
cancelAllIslandPreviews()
void
Cancel all active island previews.
getIslandPreview(SuperiorPlayer)
@Nullable IslandPreview
Check if a player has an ongoing island preview task.Parameters:
  • superiorPlayer - The player to check
Returns: The island preview object, or null if none active

Island Deletion

deleteIsland(Island)
void
Delete an island.Parameters:
  • island - The island to delete

Island Retrieval

getIsland(int, SortingType)
@Nullable Island
Get the island in a specific position from one of the top lists. Positions start from 0.Parameters:
  • position - The position to check
  • sortingType - The sorting type that should be considered
Returns: The island in that position, or null
getIslandPosition(Island, SortingType)
int
Get the position of an island. Positions start from 0.Parameters:
  • island - The island to check
  • sortingType - The sorting type that should be considered
Returns: The position of the island
getIslandByUUID(UUID)
@Nullable Island
Get an island by its UUID.Parameters:
  • uuid - The UUID of the island
Returns: The island with that UUID, or null
getIsland(String)
@Nullable Island
Get an island by its name.Parameters:
  • islandName - The name to check
Returns: The island with that name, or null
getIslandAt(@Nullable Location)
@Nullable Island
Get an island at an exact position in the world.Parameters:
  • location - The position to check
Returns: The island at that position, or null
getIslandsAt(@Nullable Chunk)
@Nullable List<Island>
Get all the islands from a chunk.Parameters:
  • chunk - The chunk to check
Returns: The islands at that position
getSize()
int
Get the amount of islands.Returns: The total number of islands
getSpawnIsland()
Island
Get the spawn island object.Returns: The spawn island

Island Lists

getIslands()
List<Island>
Get all the islands unordered.Returns: List of all islands
getIslands(SortingType)
List<Island>
Get all the islands ordered by a specific sorting type.Parameters:
  • sortingType - The sorting type to order the list by
Returns: List of islands ordered by the sorting type

Island Sorting

sortIslands(SortingType)
void
Sort the islands.Parameters:
  • sortingType - The sorting type to use
sortIslands(SortingType, @Nullable Runnable)
void
Sort the islands with callback.Parameters:
  • sortingType - The sorting type to use
  • onFinish - Callback runnable executed when sorting completes
registerSortingType(SortingType)
void
Add a new sorting type to the registry of islands.Parameters:
  • sortingType - The new sorting type to register

World Management

getIslandsWorld(Island, Dimension)
@Nullable World
Get the world of an island by the dimension. If the dimension is disabled in config, null will be returned.Parameters:
  • island - The island to check
  • dimension - The world dimension
Returns: The world for that dimension, or null
getIslandsWorldDimension(World)
@Nullable Dimension
Get the dimension of an islands world. If the world is not an islands world, null will be returned.Parameters:
  • world - The world to check
Returns: The dimension of the world, or null
getIslandsWorldInfo(Island, Dimension)
@Nullable WorldInfo
Get the WorldInfo of the world of an island by the dimension. The world might not be loaded at the time of calling this method.Parameters:
  • island - The island to check
  • dimension - The world dimension
Returns: The world info for the given dimension, or null if dimension is not enabled
getIslandsWorldInfo(Island, String)
@Nullable WorldInfo
Get the WorldInfo of the world of an island by its name. The world might not be loaded at the time of calling this method.Parameters:
  • island - The island to check
  • worldName - The name of the world
Returns: The world info for the given name, or null if not an islands world
isIslandsWorld(World)
boolean
Checks if the given world is an islands world (normal, nether, or end if enabled).Parameters:
  • world - The world to check
Returns: True if it’s an islands world
registerIslandWorld(World)
void
Register a world as an islands world. This will add all protections to that world, however - no islands will be physically there.Parameters:
  • world - The world to register as an islands world
Throws: IllegalArgumentException if the world couldn’t be registered
getRegisteredWorlds()
List<World>
Get all registered worlds.Returns: List of all registered island worlds

Island Calculations

calcAllIslands()
void
Calculate the worth of all the islands on the server.
calcAllIslands(@Nullable Runnable)
void
Calculate the worth of all the islands on the server with callback.Parameters:
  • callback - Runnable that will be ran when process is finished
getTotalWorth()
BigDecimal
Get the total worth of all the islands. This value is updated every minute, so it might not be 100% accurate.Returns: The total worth of all islands
getTotalLevel()
BigDecimal
Get the total level of all the islands. This value is updated every minute, so it might not be 100% accurate.Returns: The total level of all islands

Island Purge

addIslandToPurge(Island)
void
Make the island to be deleted when server stops.Parameters:
  • island - The island to delete
removeIslandFromPurge(Island)
void
Remove the island from being deleted when server stops.Parameters:
  • island - The island to keep
isIslandPurge(Island)
boolean
Check if the island will be deleted when the server stops.Parameters:
  • island - The island to check
Returns: True if the island is scheduled for purge
getIslandsToPurge()
List<Island>
Get all the islands that will be deleted when the server stops.Returns: List of islands scheduled for purge

Grid Position

getLastIslandPosition()
BlockPosition
Get the position of the last island that was generated.Returns: The position of the last generated island
setLastIslandPosition(BlockPosition)
void
Set the position of the last island. Warning: Do not use this method unless you know what you’re doing.Parameters:
  • blockPosition - The position to set

Islands Container

getIslandsContainer()
IslandsContainer
Get the islands container.Returns: The current islands container
setIslandsContainer(IslandsContainer)
void
Set a new islands container.Parameters:
  • islandsContainer - The new islands container to set

Example Usage

import com.bgsoftware.superiorskyblock.api.SuperiorSkyblockAPI;
import com.bgsoftware.superiorskyblock.api.handlers.GridManager;
import com.bgsoftware.superiorskyblock.api.island.Island;
import com.bgsoftware.superiorskyblock.api.island.SortingType;
import com.bgsoftware.superiorskyblock.api.wrappers.SuperiorPlayer;
import org.bukkit.block.Biome;

import java.math.BigDecimal;
import java.util.List;

public class GridExample {
    public void example(SuperiorPlayer player) {
        GridManager gridManager = SuperiorSkyblockAPI.getGrid();
        
        // Create a new island
        gridManager.createIsland(
            player,
            "default",
            BigDecimal.ZERO,
            Biome.PLAINS,
            "MyIsland",
            false
        );
        
        // Get top island
        Island topIsland = gridManager.getIsland(0, SortingType.BY_WORTH);
        
        // Get all islands
        List<Island> islands = gridManager.getIslands();
        
        // Calculate all islands
        gridManager.calcAllIslands(() -> {
            System.out.println("Calculation complete!");
        });
    }
}