### Example SuperiorCommand Implementation Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md An example demonstrating how to extend SuperiorCommand and implement its core methods for command execution, tab completion, and defining permissions. ```java public class MyCommand extends SuperiorCommand { @Override public void execute(CommandSender sender, String[] args) { sender.sendMessage("Command executed!"); } @Override public List tabComplete(CommandSender sender, String[] args) { return Arrays.asList("option1", "option2"); } @Override public String getPermission() { return "myplugin.command.mycommand"; } } ``` -------------------------------- ### Example PluginModule Implementation Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md A basic example of how to extend the PluginModule class and implement its lifecycle methods. This serves as a template for creating custom modules. ```java public class MyModule extends PluginModule { @Override public void onLoad(ModuleInitializeData initializeData) { // Initialize module } @Override public void onEnable() { // Enable module } } ``` -------------------------------- ### Get Island Worlds by Dimension Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Demonstrates how to obtain World objects for different dimensions (Overworld, Nether, End) associated with an island. Also shows how to get an island's home location in the End dimension. ```java World normal = SuperiorSkyblockAPI.getIslandsWorld(island, Dimension.NORMAL); World nether = SuperiorSkyblockAPI.getIsIslandsWorld(island, Dimension.NETHER); Location end = island.getHome(Dimension.THE_END); ``` -------------------------------- ### Get All Menus Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves a list of all registered menus. ```java List getMenus() ``` -------------------------------- ### Get All Missions Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves a list of all available missions. ```java List getMissions() ``` -------------------------------- ### Event Priority - Lowest Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/04-events.md Example of setting event priority to LOWEST to ensure the event handler runs after other plugins. ```java // Run after other plugins @EventHandler(priority = EventPriority.LOWEST) public void onLateEvent(IslandCreateEvent event) { } ``` -------------------------------- ### IslandUpgradeEvent Example Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/04-events.md Handles the IslandUpgradeEvent, specifically checking for 'SIZE' upgrades and sending a title to the island. ```java @EventHandler public void onUpgrade(IslandUpgradeEvent event) { if (event.getUpgrade().getName().equals("SIZE")) { event.getIsland().sendTitle("Island size increased!", ""); } } ``` -------------------------------- ### Listen to any IslandEvent Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/04-events.md Example of how to register an event listener for any event that extends IslandEvent. This snippet demonstrates accessing the island associated with the event. ```java @EventHandler public void onIslandEvent(IslandEvent event) { Island island = event.getIsland(); System.out.println("Island event: " + island.getName()); } ``` -------------------------------- ### Handle PreIslandCreateEvent Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/04-events.md Example of how to handle the PreIslandCreateEvent. This snippet shows how to cancel island creation based on the player's name. ```java @EventHandler public void onPreCreate(PreIslandCreateEvent event) { if (event.getSuperiorPlayer().getName().contains("admin")) { // Allow creation } else { event.setCancelled(true); // Block creation } } ``` -------------------------------- ### Get SuperiorPlayer by UUID Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Fetch a SuperiorPlayer object using their unique player UUID. This is a direct and efficient way to get player data. ```java UUID uuid = player.getUniqueId(); SuperiorPlayer superior = SuperiorSkyblockAPI.getPlayer(uuid); ``` -------------------------------- ### Get All Loaded Schematics Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves a list of all currently loaded schematics. ```java List getSchematics() ``` -------------------------------- ### Event Priority - Highest Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/04-events.md Example of setting event priority to HIGHEST to ensure the event handler runs before other plugins. ```java // Run before other plugins @EventHandler(priority = EventPriority.HIGHEST) public void onEarlyEvent(IslandCreateEvent event) { } ``` -------------------------------- ### Get Island Description Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the description text for the island. ```java String description = island.getDescription(); ``` -------------------------------- ### Island Creation Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/00-README.md Provides an example of how to programmatically create a new island using the `SuperiorSkyblockAPI`. This includes specifying the owner, schematic, initial worth, biome, and display name. ```APIDOC ## Create an Island ### Description Programmatically creates a new island for a given player with specified parameters. ### Method Static method ### Endpoint N/A (Java API) ### Parameters - `owner` (SuperiorPlayer) - The player who will own the new island. - `schematicName` (string) - The name of the schematic to use for the island's generation. - `worthBonus` (BigDecimal) - An initial worth bonus for the island. - `biome` (Biome) - The biome for the island. - `displayName` (string) - The display name of the island. ### Request Example ```java SuperiorPlayer owner = SuperiorSkyblockAPI.getPlayer(uuid); SuperiorSkyblockAPI.createIsland( owner, "default", // Schematic name BigDecimal.ZERO, // Worth bonus Biome.PLAINS, // Starting biome "My Island" // Display name ); ``` ``` -------------------------------- ### Maven Dependency Installation Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/INDEX.md Provides the necessary Maven configuration to include the SuperiorSkyblockAPI as a dependency in your project. Ensure you have the correct repository and dependency details. ```xml bg-repo https://repo.bg-software.com/repository/api/ com.bgsoftware SuperiorSkyblockAPI 2026.1 provided ``` -------------------------------- ### Track Changes Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/04-events.md Example of an event handler that logs changes to an island's worth, capturing old and new values. ```java @EventHandler public void onWorthUpdate(IslandWorthUpdateEvent event) { logIslandChange( event.getIsland().getName(), event.getOldWorth(), event.getNewWorth() ); } ``` -------------------------------- ### Get Menu by Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves a custom menu by its name. Returns null if the menu is not found. ```java @Nullable BaseMenu getMenu(String name) ``` -------------------------------- ### Get All Island Privileges Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Returns a collection of all currently registered island privileges. ```java public static Collection values() ``` -------------------------------- ### Get Island Discord Invite Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the Discord server invite associated with the island. ```java String discordInvite = island.getDiscord(); ``` -------------------------------- ### Get All Loaded Modules Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieve a list of all currently loaded plugin modules. This is part of the ModulesManager. ```java List getModules() ``` -------------------------------- ### Get Island Creation Date String Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves a formatted string representing the island's creation date. ```java player.sendMessage("Island created: " + island.getCreationTimeDate()); // Output: "Island created: 2025-06-13 15:30" ``` -------------------------------- ### Get Upgrade by Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves an Upgrade object based on its string name, such as "SIZE" or "TEAM_LIMIT". This is the first step to accessing upgrade-specific details. ```java Upgrade size = SuperiorSkyblockAPI.getUpgrades().getUpgrade("SIZE"); if (size != null) { UpgradeLevel level = size.getUpgradeLevel(island.getUpgradeLevel(size)); if (level != null) { player.sendMessage("Island size: " + level.getSize()); } } ``` -------------------------------- ### Get or Create Player Data Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Retrieve a player's SuperiorPlayer object. If the player does not exist in the database, initialize their data. ```java SuperiorPlayer superior = SuperiorSkyblockAPI.getPlayer(player.getUniqueId()); if (superior == null) { // Player doesn't exist in database yet - initialize superior = SuperiorSkyblockAPI.getPlayers().getSuperiorPlayer(player); } ``` -------------------------------- ### Accessing the API and Managers Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/00-README.md Demonstrates how to obtain the main plugin instance and access various managers through static methods or the plugin instance. It also shows how to retrieve specific players and islands. ```APIDOC ## Access the API ### Description Provides static methods to access the main plugin instance and retrieve core game objects like islands and players. ### Method Static methods ### Endpoint N/A (Java API) ### Parameters None ### Request Example ```java // Get the main plugin instance SuperiorSkyblock plugin = SuperiorSkyblockAPI.getSuperiorSkyblock(); // Or use static methods directly Island island = SuperiorSkyblockAPI.getIsland("IslandName"); SuperiorPlayer player = SuperiorSkyblockAPI.getPlayer(uuid); ``` ## Get a Manager ### Description Shows how to access different manager interfaces, which provide access to specific plugin functionalities. Managers can be accessed via static methods or through the main plugin instance. ### Method Static methods or instance methods ### Endpoint N/A (Java API) ### Parameters None ### Request Example ```java // All managers accessible via static methods GridManager grid = SuperiorSkyblockAPI.getGrid(); PlayersManager players = SuperiorSkyblockAPI.getPlayers(); RolesManager roles = SuperiorSkyblockAPI.getRoles(); UpgradesManager upgrades = SuperiorSkyblockAPI.getUpgrades(); // Or through the plugin instance GridManager grid = plugin.getGrid(); ``` ``` -------------------------------- ### Build Entire Project Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/CLAUDE.md Compiles all modules and creates fat JARs. Artifacts are placed in the /target directory. This is the standard build command. ```bash gradle build ``` -------------------------------- ### Access SuperiorSkyblock API Instance Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/00-README.md Get the main plugin instance or access static methods directly to interact with the API. Use this to retrieve core objects like islands and players. ```java SuperiorSkyblock plugin = SuperiorSkyblockAPI.getSuperiorSkyblock(); Island island = SuperiorSkyblockAPI.getIsland("IslandName"); SuperiorPlayer player = SuperiorSkyblockAPI.getPlayer(uuid); ``` -------------------------------- ### Register and Use Custom Key Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Demonstrates how to register a custom key and use it to store and retrieve data from an ItemStack. ```java String getKey() Object getDataContainer(ItemStack itemStack) void setDataContainer(ItemStack itemStack, Object value) ``` ```java Key myKey = SuperiorSkyblockAPI.getKeys().registerKey("myplugin:data"); ItemStack item = new ItemStack(Material.DIAMOND); myKey.setDataContainer(item, "custom-value"); String value = (String) myKey.getDataContainer(item); ``` -------------------------------- ### PluginModule Lifecycle Methods Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Abstract methods defining the lifecycle of a plugin module, including loading, enabling, and disabling. Also provides methods to get the module's name. ```java void onLoad(ModuleInitializeData initializeData) void onEnable() void onDisable() String getModuleName() ``` -------------------------------- ### Get API Version Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Obtain the current version of the API. This is useful for handling compatibility with different plugin versions. ```java int version = SuperiorSkyblockAPI.getAPIVersion(); if (version < 15) { // Handle older API version } ``` -------------------------------- ### Create Custom Command Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/INDEX.md Demonstrates how to create a custom command by extending the SuperiorCommand class. Implement the execute and tabComplete methods for command functionality. ```java public class MyCmd extends SuperiorCommand { public void execute(CommandSender sender, String[] args) { } public List tabComplete(CommandSender sender, String[] args) { } } SuperiorSkyblockAPI.registerCommand(new MyCmd()); ``` -------------------------------- ### Event Handling Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/00-README.md Illustrates how to listen for and handle plugin events, such as island creation, using Java's event listener pattern. This allows for custom logic to be executed in response to specific game events. ```APIDOC ## Listen to Events ### Description Demonstrates how to register an event listener to react to plugin events, such as `IslandCreateEvent`. This allows for custom logic to be executed when specific actions occur within the plugin. ### Method Event Listener (Java Annotation) ### Endpoint N/A (Java API) ### Parameters - `event` (IslandCreateEvent) - The event object containing details about the island creation. ### Request Example ```java @EventHandler public void onIslandCreate(IslandCreateEvent event) { Island island = event.getIsland(); SuperiorPlayer owner = event.getSuperiorPlayer(); // Your logic here island.getBank().deposit(new BigDecimal(1000)); } ``` ``` -------------------------------- ### getUpgradeLevel Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Gets the current level of a specified island upgrade. ```APIDOC ## getUpgradeLevel(Upgrade) ### Description Get the current level of an upgrade. ### Parameters #### Path Parameters - **upgrade** (Upgrade) - Required - Upgrade to check ### Returns #### Success Response (200) - **int** (int) - Level (0 if not upgraded) ### Request Example ```java Upgrade sizeUpgrade = SuperiorSkyblockAPI.getUpgrades().getUpgrade("SIZE"); int level = island.getUpgradeLevel(sizeUpgrade); ``` ``` -------------------------------- ### Get Configuration Value Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieve a configuration value from the plugin settings using its key. The return type depends on the specific key. This is part of the SettingsManager. ```java Object get(String key) ``` ```java boolean pvpAllowed = (boolean) SuperiorSkyblockAPI.getSettings() .get("player-settings.pvp-enabled"); ``` -------------------------------- ### Key and KeyMap Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Utilities for custom key management and map-like storage. ```APIDOC ## Key Custom key for storing metadata on item stacks and other objects. ```java String getKey() Object getDataContainer(ItemStack itemStack) void setDataContainer(ItemStack itemStack, Object value) ``` **Example**: ```java Key myKey = SuperiorSkyblockAPI.getKeys().registerKey("myplugin:data"); ItemStack item = new ItemStack(Material.DIAMOND); myKey.setDataContainer(item, "custom-value"); String value = (String) myKey.getDataContainer(item); ``` ## KeyMap Map-like storage keyed by Key objects. ```java Object get(Key key) void set(Key key, Object value) void remove(Key key) Collection values() ``` ``` -------------------------------- ### Get Island Biome Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the current biome of the island. ```java Biome getBiome() ``` -------------------------------- ### Registering an Island Create Event Listener Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Shows how to register an event listener for island creation using Bukkit's event system. ```java @EventHandler public void onIslandCreate(IslandCreateEvent event) { Island island = event.getIsland(); // Handle event } // Register with plugin Bukkit.getPluginManager().registerEvents(new MyListener(), plugin); ``` -------------------------------- ### Get Plugin Instance Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Retrieve the main plugin instance that implements the SuperiorSkyblock interface. This is essential for accessing other API functionalities. ```java SuperiorSkyblock plugin = SuperiorSkyblockAPI.getSuperiorSkyblock(); ``` -------------------------------- ### Get Island Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the display name of the island. ```java String name = island.getName(); ``` -------------------------------- ### EconomyProvider API Methods Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/06-configuration-and-patterns.md Methods for integrating with economy plugins like Vault. Use these to manage player balances. ```java BigDecimal getBalance(SuperiorPlayer player) void deposit(SuperiorPlayer player, BigDecimal amount) void withdraw(SuperiorPlayer player, BigDecimal amount) ``` -------------------------------- ### Get All Island Flags Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Returns a collection of all registered island flags. ```java public static Collection values() ``` -------------------------------- ### Create Island with Default Settings Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Create a new island for a specified owner using a given schematic, bonus worth, biome, and island name. This method uses default offset behavior for the bonus. ```java SuperiorPlayer owner = SuperiorSkyblockAPI.getPlayer(playerUUID); SuperiorSkyblockAPI.createIsland(owner, "default", BigDecimal.ZERO, Biome.PLAINS, "My Island"); ``` -------------------------------- ### Get Spawners Provider Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves the currently registered spawners provider. ```java SpawnersProvider getSpawnersProvider() ``` -------------------------------- ### BaseMenu Methods Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Methods for defining the properties and behavior of a custom menu, including its title, size, buttons, and how to open it for a player. ```java String getTitle() int getSize() Map getButtons() void open(SuperiorPlayer player) ``` -------------------------------- ### Get Island Privilege Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the uppercase name of an island privilege. ```java String getName() ``` -------------------------------- ### Check Island Build Privilege Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/00-README.md Verify if a player has a specific privilege, such as building, on an island based on their role. This is essential for permission management. ```java IslandPrivilege privilege = IslandPrivilege.getByName("BUILD"); PlayerRole role = island.getPlayerRole(member); if (role != null && role.isPrivilegeAllowed(member, privilege)) { // Grant access } ``` -------------------------------- ### Implement Custom SpawnersProvider Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/06-configuration-and-patterns.md Create a custom SpawnersProvider to integrate with external spawner counting systems. Implement the getSpawners method to return SpawnersSnapshot. ```java public class MySpawnersProvider implements SpawnersProvider { @Override public SpawnersSnapshot getSpawners(Island island) { // Get spawner data for this island from your system Map spawners = getMySpawnerData(island); return new SpawnersSnapshot(spawners); } } // Register the provider SuperiorSkyblockAPI.setSpawnersProvider(new MySpawnersProvider()); ``` -------------------------------- ### Get Island Level Bonus Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves any bonus level applied to the island. ```java BigDecimal levelBonus = island.getLevelBonus(); ``` -------------------------------- ### Registering Island Privileges and Flags Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/INDEX.md Demonstrates how to register new island privileges and flags using the API. Includes methods for registration, retrieval by name, and listing all available options. ```java IslandPrivilege.register("NAME"); IslandPrivilege.register("NAME", Type.ACTION); IslandPrivilege.register("NAME", Type.COMMAND); IslandPrivilege.getByName("NAME"); IslandPrivilege.values(); // Register flags IslandFlag.register("NAME"); IslandFlag.getByName("NAME"); IslandFlag.values(); ``` -------------------------------- ### Get Island Level Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the calculated level of the island based on its worth. ```java BigDecimal level = island.getLevel(); ``` -------------------------------- ### IslandFlag Retrieval Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieve an island flag by its name or get a collection of all registered flags. ```APIDOC ## IslandFlag ### Static Methods #### getByName(String name) Get a flag by name. **Parameters**: - name (String): Required - Flag name **Returns**: - IslandFlag: Registered flag **Throws**: - NullPointerException: if not found #### values() Get all registered flags. **Returns**: - Collection: All flags ``` -------------------------------- ### Get Island Privilege Type Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the type (ACTION or COMMAND) of an island privilege. ```java Type getType() ``` -------------------------------- ### Get Island PayPal Link Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the PayPal donation link configured for the island. ```java String paypalLink = island.getPaypal(); ``` -------------------------------- ### React to Completion Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/04-events.md Demonstrates reacting to an event that signifies the completion of an action, allowing for subsequent operations. ```java @EventHandler public void onCreated(PostIslandCreateEvent event) { Island island = event.getIsland(); // Island is now fully created, safe to use island.setWorthBonus(new BigDecimal(1000)); } ``` -------------------------------- ### IslandPrivilege Retrieval Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieve existing island privileges by name or get a collection of all registered privileges. ```APIDOC ## IslandPrivilege ### Static Methods #### getByName(String name) Get a privilege by name. **Parameters**: - name (String): Required - Privilege name **Returns**: - IslandPrivilege: Registered privilege **Throws**: - NullPointerException: if not found **Example**: ```java IslandPrivilege build = IslandPrivilege.getByName("BUILD"); ``` #### values() Get all registered privileges. **Returns**: - Collection: All privileges ``` -------------------------------- ### Access Plugin Configuration with SettingsManager Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/06-configuration-and-patterns.md Retrieve plugin settings at runtime using the SettingsManager. Ensure the correct key is used for the desired configuration value. ```java Object get(String key) ``` ```java SettingsManager settings = SuperiorSkyblockAPI.getSettings(); boolean pvpEnabled = (boolean) settings.get("player-settings.pvp-enabled"); if (pvpEnabled) { // Handle PVP } ``` -------------------------------- ### Create Island with Basic Parameters Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Creates a new island for a given player using a specified schematic, worth bonus, biome, and island name. Throws an IllegalArgumentException if the schematic is not found. ```java SuperiorSkyblockAPI.getGrid().createIsland( owner, "default", BigDecimal.ZERO, Biome.PLAINS, "My Island" ); ``` -------------------------------- ### Get Player Role Display Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the user-friendly display name for a player role. ```java String getDisplayName() ``` -------------------------------- ### Create Custom SuperiorPlayer Instances with PlayersFactory Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/06-configuration-and-patterns.md Implement a custom PlayersFactory to create or customize SuperiorPlayer objects. ```java SuperiorPlayer createPlayer(SuperiorPlayer superiorPlayer) SuperiorPlayer createPlayer(UUID uuid, String name, long lastTimeStatus) ``` -------------------------------- ### Get Island Worth Bonus Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves any bonus worth applied to the island, typically by administrators. ```java BigDecimal worthBonus = island.getWorthBonus(); ``` -------------------------------- ### Get Island Worth Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the total calculated worth of the island. This value is cached for performance. ```java BigDecimal worth = island.getWorth(); player.sendMessage("Island worth: " + worth); ``` -------------------------------- ### Open Menu for Player Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Opens a specified menu interface for a given player. ```java void openMenu(BaseMenu menu, SuperiorPlayer superiorPlayer) ``` -------------------------------- ### Get Island Members Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves a list of all members of the island. Optionally include the owner in the list. ```java List members = island.getIslandMembers(false); for (SuperiorPlayer member : members) { System.out.println(member.getName()); } ``` -------------------------------- ### Create Island with Bonuses Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Use this method to create a new island with specific worth and level bonuses, a biome, and a name. The 'offset' parameter controls whether to apply an offset. ```java public static void createIsland(SuperiorPlayer superiorPlayer, String schemName, BigDecimal bonusWorth, BigDecimal bonusLevel, Biome biome, String islandName, boolean offset) ``` ```java SuperiorSkyblockAPI.createIsland(owner, "default", new BigDecimal(1000), new BigDecimal(500), Biome.PLAINS, "Island", false); ``` -------------------------------- ### Get Island Creation Time Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the creation timestamp of the island in milliseconds since the epoch. ```java long createdAt = island.getCreationTime(); long ageMs = System.currentTimeMillis() - createdAt; ``` -------------------------------- ### Register and Check Custom Privileges Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/06-configuration-and-patterns.md Register new custom privileges for your plugin and later check if a player or role is allowed to perform actions associated with these privileges. ```java // Register privileges in plugin onEnable() IslandPrivilege.register("MY_ACTION", IslandPrivilege.Type.ACTION); IslandPrivilege.register("MY_COMMAND", IslandPrivilege.Type.COMMAND); // Later, check privilege IslandPrivilege myPriv = IslandPrivilege.getByName("MY_ACTION"); PlayerRole role = island.getPlayerRole(member); if (role.isPrivilegeAllowed(member, myPriv)) { // Grant access } ``` -------------------------------- ### Island Interface - General Methods Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Provides methods for retrieving general information about an island, such as its owner, unique ID, creation time, and cache. ```APIDOC ## getOwner() ### Description Get the owner of the island. ### Method Java Method ### Parameters None ### Returns `SuperiorPlayer` - Island owner (never null) ### Example ```java Island island = SuperiorSkyblockAPI.getIsland("MyIsland"); SuperiorPlayer owner = island.getOwner(); if (owner.isOnline()) { owner.runIfOnline(player -> { player.sendMessage("Island information:"); player.sendMessage("Worth: " + island.getWorth()); }); } ``` ``` ```APIDOC ## getUniqueId() ### Description Get the unique identifier for this island. ### Method Java Method ### Parameters None ### Returns `UUID` - Island UUID ### Example ```java UUID islandUUID = island.getUniqueId(); // Use for persistent storage ``` ``` ```APIDOC ## getCreationTime() ### Description Get the creation timestamp (milliseconds since epoch). ### Method Java Method ### Parameters None ### Returns `long` - Creation time ### Example ```java long createdAt = island.getCreationTime(); long ageMs = System.currentTimeMillis() - createdAt; ``` ``` ```APIDOC ## getCreationTimeDate() ### Description Get a formatted string of creation date. ### Method Java Method ### Parameters None ### Returns `String` - Formatted date ### Example ```java player.sendMessage("Island created: " + island.getCreationTimeDate()); // Output: "Island created: 2025-06-13 15:30" ``` ``` ```APIDOC ## getCache() ### Description Get the island's cache object for efficient access to commonly-used data. ### Method Java Method ### Parameters None ### Returns `IslandCache` - Island cache ### Example ```java IslandCache cache = island.getCache(); BigDecimal worth = cache.getWorth(); BigDecimal level = cache.getLevel(); ``` ``` -------------------------------- ### Get Banks Factory Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieve the BanksFactory to create IslandBank objects. This factory is part of the FactoriesManager. ```java BanksFactory getBanksFactory() ``` -------------------------------- ### Listen to Island Creation Events Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/00-README.md Implement an event listener to react to island creation events. This allows custom logic to be executed when a new island is generated, such as modifying its initial bank balance. ```java @EventHandler public void onIslandCreate(IslandCreateEvent event) { Island island = event.getIsland(); SuperiorPlayer owner = event.getSuperiorPlayer(); // Your logic here island.getBank().deposit(new BigDecimal(1000)); } ``` -------------------------------- ### Get Players Factory Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieve the PlayersFactory to create SuperiorPlayer objects. This factory is part of the FactoriesManager. ```java PlayersFactory getPlayersFactory() ``` -------------------------------- ### Get Islands Factory Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieve the IslandsFactory to create Island objects. This factory is part of the FactoriesManager. ```java IslandsFactory getIslandsFactory() ``` -------------------------------- ### Hook into Post Island Creation Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/06-configuration-and-patterns.md Customize newly created islands by handling the PostIslandCreateEvent. This allows setting initial bank balances, creating warps, and sending welcome messages. ```java @EventHandler public void onIslandCreate(PostIslandCreateEvent event) { Island island = event.getIsland(); // Give starting money island.getBank().deposit(new BigDecimal(5000)); // Set up warps Location home = island.getHome(Dimension.NORMAL); ItemStack icon = new ItemStack(Material.GRASS_BLOCK); island.createWarp("spawn", home, icon); // Send welcome message SuperiorPlayer owner = island.getOwner(); owner.runIfOnline(player -> { player.sendMessage("Welcome to your new island!"); }); } ``` -------------------------------- ### Get Player Role Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the role of a specific player on the island. Returns null if the player is not a member. ```java PlayerRole role = island.getPlayerRole(member); if (role != null) { player.sendMessage(member.getName() + " is a " + role.getDisplayName()); } ``` -------------------------------- ### BaseMenu Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md The base class for creating custom menus. It defines methods for setting the menu's title, size, buttons, and for opening the menu to a specific player. ```APIDOC ## BaseMenu ### Description Base class for custom menus. ### Methods - `getTitle()`: Returns the title of the menu. - `getSize()`: Returns the size of the menu. - `getButtons()`: Returns a map of button slots to menu template buttons. - `open(SuperiorPlayer player)`: Opens the menu for the specified player. ``` -------------------------------- ### Get Island Owner Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the owner of the island. The owner is represented by a SuperiorPlayer object and is never null. ```java SuperiorPlayer owner = island.getOwner(); if (owner.isOnline()) { owner.runIfOnline(player -> { player.sendMessage("Island information:"); player.sendMessage("Worth: " + island.getWorth()); }); } ``` -------------------------------- ### Get SuperiorPlayer and Send Message Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Retrieves a SuperiorPlayer object by UUID and sends a message if the player is online. ```java SuperiorPlayer superior = SuperiorSkyblockAPI.getPlayer(uuid); if (superior.isOnline()) { Player bukkit = superior.asPlayer(); bukkit.sendMessage("Welcome back!"); } ``` -------------------------------- ### Get Spawn Island Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Returns the server's designated spawn island. This island is guaranteed to exist. ```java public static Island getSpawnIsland() ``` ```java Island spawn = SuperiorSkyblockAPI.getSpawnIsland(); Location spawnHome = spawn.getHome(Dimension.NORMAL); ``` -------------------------------- ### createIsland(SuperiorPlayer, String, BigDecimal, Biome, String, boolean) Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Creates a new island with an option to control the offset behavior for applying the bonus worth. ```APIDOC ## createIsland(SuperiorPlayer, String, BigDecimal, Biome, String, boolean) ### Description Create an island with optional offset control. When offset is false, the bonus worth is applied directly. ### Method `public static void createIsland(SuperiorPlayer superiorPlayer, String schemName, BigDecimal bonus, Biome biome, String islandName, boolean offset)` ### Parameters #### Path Parameters - **superiorPlayer** (`SuperiorPlayer`) - Yes - The island owner. - **schemName** (`String`) - Yes - The name of the schematic to paste. - **bonus** (`BigDecimal`) - Yes - The starting island worth bonus. - **biome** (`Biome`) - Yes - The starting biome for the island. - **islandName** (`String`) - Yes - The display name for the island. - **offset** (`boolean`) - Yes - If false, bonus is given directly; if true, offset from default is used. ### Example ```java // Give 1000 worth directly (offset=false) SuperiorSkyblockAPI.createIsland(owner, "default", new BigDecimal(1000), Biome.PLAINS, "Island", false); // Give 1000 as bonus offset (offset=true) SuperiorSkyblockAPI.createIsland(owner, "default", new BigDecimal(1000), Biome.PLAINS, "Island", true); ``` ``` -------------------------------- ### Island Interface - Player & Member Methods Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Provides methods for managing island members, checking relationships, inviting, kicking, and setting player roles. ```APIDOC ## getIslandMembers(boolean) ### Description Get all members of the island. ### Method Java Method ### Parameters #### Query Parameters - **includeOwner** (boolean) - Yes - If true, include island owner in list ### Returns `List` - List of members (empty list if none) ### Example ```java List members = island.getIslandMembers(false); for (SuperiorPlayer member : members) { System.out.println(member.getName()); } ``` ``` ```APIDOC ## isMember(SuperiorPlayer) ### Description Check if a player is a member of the island (not including owner or coop). ### Method Java Method ### Parameters #### Path Parameters - **superiorPlayer** (SuperiorPlayer) - Yes - Player to check ### Returns `boolean` - True if member ### Example ```java if (island.isMember(player)) { player.sendMessage("You are a member"); } ``` ``` ```APIDOC ## isOwner(SuperiorPlayer) ### Description Check if a player is the island owner. ### Method Java Method ### Parameters #### Path Parameters - **superiorPlayer** (SuperiorPlayer) - Yes - Player to check ### Returns `boolean` - True if owner ``` ```APIDOC ## invitePlayer(SuperiorPlayer) ### Description Invite a player to join the island. Fires `IslandInviteEvent`. ### Method Java Method ### Parameters #### Path Parameters - **superiorPlayer** (SuperiorPlayer) - Yes - Player to invite ### Throws `IllegalArgumentException` if player is already member/banned ### Example ```java SuperiorPlayer target = SuperiorSkyblockAPI.getPlayer(targetUUID); if (target != null && !island.isMember(target)) { island.invitePlayer(target); } ``` ``` ```APIDOC ## kickMember(SuperiorPlayer) ### Description Remove a member from the island. Fires `IslandKickEvent`. ### Method Java Method ### Parameters #### Path Parameters - **superiorPlayer** (SuperiorPlayer) - Yes - Member to kick ### Throws `IllegalArgumentException` if not a member ### Example ```java island.kickMember(memberToRemove); ``` ``` ```APIDOC ## setPlayerRole(SuperiorPlayer, PlayerRole) ### Description Set a member's role in the island. Fires `PlayerChangeRoleEvent` and `IslandChangePlayerPrivilegeEvent`. ### Method Java Method ### Parameters #### Path Parameters - **superiorPlayer** (SuperiorPlayer) - Yes - Member to update - **playerRole** (PlayerRole) - Yes - New role ### Example ```java PlayerRole officer = SuperiorSkyblockAPI.getRoles().getRole("Officer"); if (officer != null) { island.setPlayerRole(member, officer); } ``` ``` -------------------------------- ### Get Island Flag by Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves a registered island flag by its name. Throws NullPointerException if the flag is not found. ```java public static IslandFlag getByName(String name) ``` -------------------------------- ### MenuView Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Represents an instance of an open menu for a player. It provides methods to access the menu and player, close the menu, update its contents, and set individual buttons. ```APIDOC ## MenuView ### Description Instance of an open menu for a player. ### Methods - `getMenu()`: Returns the base menu associated with this view. - `getPlayer()`: Returns the player viewing the menu. - `close()`: Closes the menu view for the player. - `update()`: Updates the menu view to reflect any changes. - `setButton(int slot, MenuViewButton button)`: Sets a specific button at the given slot in the menu view. ``` -------------------------------- ### Get Island Unique ID Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the unique UUID for an island. This is useful for persistent storage and referencing the island. ```java UUID islandUUID = island.getUniqueId(); // Use for persistent storage ``` -------------------------------- ### PermissionsProvider API Methods Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/06-configuration-and-patterns.md Methods for integrating with permission plugins like LuckPerms. Use these to manage player permissions. ```java boolean hasPermission(SuperiorPlayer player, String permission) void addPermission(SuperiorPlayer player, String permission) void removePermission(SuperiorPlayer player, String permission) ``` -------------------------------- ### Get Custom Key by Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves a custom data key by its name. Returns null if the key is not found. ```java @Nullable Key getKey(String name) ``` -------------------------------- ### Create Island with Offset Control Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Create a new island, with an option to control how the bonus worth is applied. Set 'offset' to false to apply the bonus directly, or true to use it as an offset from the default. ```java // Give 1000 worth directly (offset=false) SuperiorSkyblockAPI.createIsland(owner, "default", new BigDecimal(1000), Biome.PLAINS, "Island", false); // Give 1000 as bonus offset (offset=true) SuperiorSkyblockAPI.createIsland(owner, "default", new BigDecimal(1000), Biome.PLAINS, "Island", true); ``` -------------------------------- ### createIsland Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Creates a new island for a player with specified bonuses, biome, and name. Allows for an optional offset. ```APIDOC ## createIsland ### Description Creates a new island with separate worth and level bonuses. ### Method `public static void createIsland(SuperiorPlayer superiorPlayer, String schemName, BigDecimal bonusWorth, BigDecimal bonusLevel, Biome biome, String islandName, boolean offset)` ### Parameters #### Path Parameters * `superiorPlayer` (SuperiorPlayer) - Yes - The player who will own the island. * `schemName` (String) - Yes - The name of the schematic to use for the island. * `bonusWorth` (BigDecimal) - Yes - Island worth bonus. * `bonusLevel` (BigDecimal) - Yes - Island level bonus. * `biome` (Biome) - Yes - The biome for the island. * `islandName` (String) - Yes - The display name for the island. * `offset` (boolean) - Yes - Whether to apply an offset during island creation. ### Request Example ```java SuperiorSkyblockAPI.createIsland(owner, "default", new BigDecimal(1000), new BigDecimal(500), Biome.PLAINS, "Island", false); ``` ``` -------------------------------- ### Enums Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Enumerations for various game and system states. ```APIDOC ## Rating Island rating enum for rating system. ```java enum Rating { ONE_STAR, TWO_STARS, THREE_STARS, FOUR_STARS, FIVE_STARS } ``` ## MemberRemoveReason Reason for removing a member. ```java enum MemberRemoveReason { KICKED, LEFT, BANNED, DISBANDED, TRANSFERRED } ``` ## BorderColor Island border color for rendering. ```java enum BorderColor { RED, BLUE, GREEN, WHITE, YELLOW } ``` ## BankAction Type of bank transaction. ```java enum BankAction { DEPOSIT, WITHDRAW, SET } ``` ## SyncStatus Synchronization status for data operations. ```java enum SyncStatus { SYNCED, NOT_SYNCED, SYNCING } ``` ``` -------------------------------- ### IslandPrivilege Instance Methods Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Access information about an existing island privilege instance. ```APIDOC ## IslandPrivilege ### Instance Methods #### getName() Get the privilege name in uppercase. **Returns**: - String: Name #### getType() Get the privilege type (ACTION or COMMAND). **Returns**: - Type: Privilege type #### ordinal() Get the ordinal (array index). Used by EnumerateMap/EnumerateSet for O(1) lookup. **Returns**: - int: Ordinal ``` -------------------------------- ### React to Async Calculation with Callbacks Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/06-configuration-and-patterns.md Utilize callbacks to handle results from asynchronous calculations. Schedule sync tasks within the callback if Bukkit API access is needed. ```java island.calcIslandWorth(event -> { // This runs async BigDecimal newWorth = event.getIsland().getWorth(); // Schedule sync for player notification Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> { // Send message to player }); }); ``` -------------------------------- ### Get Island Privilege Ordinal Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the ordinal (array index) of an island privilege, used for efficient storage and lookup. ```java int ordinal() ``` -------------------------------- ### Get Island Privilege by Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves a registered island privilege using its name. Throws NullPointerException if the privilege is not found. ```java public static IslandPrivilege getByName(String name) ``` ```java IslandPrivilege build = IslandPrivilege.getByName("BUILD"); ``` -------------------------------- ### createIsland(SuperiorPlayer, String, BigDecimal, Biome, String) Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Creates a new island for a given player with specified schematic, bonus worth, biome, and island name. Uses default offset behavior. ```APIDOC ## createIsland(SuperiorPlayer, String, BigDecimal, Biome, String) ### Description Create a new island with the specified parameters. Uses default offset behavior. ### Method `public static void createIsland(SuperiorPlayer superiorPlayer, String schemName, BigDecimal bonus, Biome biome, String islandName)` ### Parameters #### Path Parameters - **superiorPlayer** (`SuperiorPlayer`) - Yes - The island owner. - **schemName** (`String`) - Yes - The name of the schematic to paste. - **bonus** (`BigDecimal`) - Yes - The starting island worth bonus. - **biome** (`Biome`) - Yes - The starting biome for the island. - **islandName** (`String`) - Yes - The display name for the island. ### Throws `IllegalArgumentException` - if the specified schematic is not found. ### Example ```java SuperiorPlayer owner = SuperiorSkyblockAPI.getPlayer(playerUUID); SuperiorSkyblockAPI.createIsland(owner, "default", BigDecimal.ZERO, Biome.PLAINS, "My Island"); ``` ``` -------------------------------- ### Get All Island Warps Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves a collection of all island warps associated with the island. Returns an empty collection if no warps exist. ```java Collection getWarps() ``` -------------------------------- ### SuperiorCommand Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Base class for creating custom commands within the system. It requires implementation of execution and tab completion logic, and provides methods for setting permissions, usage, and description. ```APIDOC ## SuperiorCommand ### Description Base class for custom commands. ### Methods - `execute(CommandSender sender, String[] args)`: Executes the command logic. - `tabComplete(CommandSender sender, String[] args)`: Provides tab completion suggestions. - `getPermission()`: Returns the permission required to execute the command. - `getUsage()`: Returns the usage string for the command. - `getDescription()`: Returns the description of the command. ### Example ```java public class MyCommand extends SuperiorCommand { @Override public void execute(CommandSender sender, String[] args) { sender.sendMessage("Command executed!"); } @Override public List tabComplete(CommandSender sender, String[] args) { return Arrays.asList("option1", "option2"); } @Override public String getPermission() { return "myplugin.command.mycommand"; } } ``` ``` -------------------------------- ### Get Island Warp by Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves an island warp object using its name. Returns null if the warp is not found. ```java IslandWarp spawn = island.getWarp("spawn"); if (spawn != null) { player.teleport(spawn.getLocation()); } ``` -------------------------------- ### SettingsManager Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Provides access to plugin configuration settings. ```APIDOC ## SettingsManager **File**: `com.bgsoftware.superiorskyblock.api.config.SettingsManager` Provides access to plugin configuration. ### Methods #### get(String) ```java Object get(String key) ``` Get a configuration value by key. | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | key | `String` | Yes | Configuration key | **Returns**: `Object` - Config value (type depends on key) **Example**: ```java boolean pvpAllowed = (boolean) SuperiorSkyblockAPI.getSettings() .get("player-settings.pvp-enabled"); ``` ``` -------------------------------- ### Get Island Upgrade Level Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/02-island-core.md Retrieves the current level of a specific island upgrade. Returns 0 if the upgrade has not been applied. ```java Upgrade sizeUpgrade = SuperiorSkyblockAPI.getUpgrades().getUpgrade("SIZE"); int level = island.getUpgradeLevel(sizeUpgrade); ``` -------------------------------- ### PostIslandCreateEvent Class Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/04-events.md Fired after an island has been fully created, including schematic pasting and player initialization. It provides access to the island owner. ```java public class PostIslandCreateEvent extends IslandEvent { public SuperiorPlayer getSuperiorPlayer() } ``` -------------------------------- ### Get Stacked Block Count Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves the number of stacked blocks at a given location. Returns 1 if no blocks are stacked. ```java int getBlockCount(Block block) ``` -------------------------------- ### Get Permissions Provider Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves the permissions provider, typically integrated with LuckPerms. Returns null if no permissions provider is available. ```java PermissionsProvider getPermissionsProvider() ``` -------------------------------- ### React to Island Creation Event Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/00-README.md Implement event-driven logic by handling the IslandCreateEvent. This allows your plugin to react to new island creations. ```java @EventHandler public void onEvent(IslandCreateEvent event) { Island island = event.getIsland(); // React to event } ``` -------------------------------- ### Get Economy Provider Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves the economy provider, typically integrated with Vault. Returns null if no economy provider is available. ```java EconomyProvider getEconomyProvider() ``` -------------------------------- ### Get Schematic by Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves a loaded schematic by its unique name. Returns null if no schematic with the given name exists. ```java @Nullable Schematic getSchematic(String name) ``` -------------------------------- ### Plugin Events Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Information on listening to and handling plugin events. ```APIDOC ## Event Listening Register event listeners with Bukkit: ```java @EventHandler public void onIslandCreate(IslandCreateEvent event) { Island island = event.getIsland(); // Handle event } // Register with plugin Bukkit.getPluginManager().registerEvents(new MyListener(), plugin); ``` ### Custom Event Args Some events include custom argument objects: **PluginEventArgs**: ```java T getEventObject() Map getArgs() Object getArg(String key) ``` ``` -------------------------------- ### Build API Module Only Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/CLAUDE.md Compiles only the API module of the project. Use this for faster builds when only API changes are needed. ```bash gradle :API:build ``` -------------------------------- ### Get Island at Location Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/01-api-entry-point.md Determines which island, if any, is present at a specific location. Returns null if no island occupies the given coordinates. ```java @Nullable public static Island getIslandAt(Location location) ``` ```java Block block = player.getTargetBlock(null, 5); Island island = SuperiorSkyblockAPI.getIslandAt(block.getLocation()); ``` -------------------------------- ### Get Mission Category by Name Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves a specific mission category using its name. Returns null if the category is not found. ```java @Nullable MissionCategory getMissionCategory(String name) ``` -------------------------------- ### SuperiorCommand Abstract Methods Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/05-types-and-data.md Abstract methods that must be implemented for custom commands, including execution logic, tab completion, permission, usage, and description. ```java public abstract void execute(CommandSender sender, String[] args) public abstract List tabComplete(CommandSender sender, String[] args) public String getPermission() public String getUsage() public String getDescription() ``` -------------------------------- ### Get Island by Location Source: https://github.com/bg-software-llc/superiorskyblock2/blob/dev/_autodocs/03-managers.md Retrieves the Island object associated with a specific Location. Useful for checking which island a player is currently on. ```java Island island = SuperiorSkyblockAPI.getGrid().getIslandAt(player.getLocation()); if (island != null) { player.sendMessage("You are on: " + island.getName()); } ```