| title | API |
|---|---|
| description | Documentation on the API and repo. |
| published | true |
| date | 2024-06-23 13:24:34 UTC |
| tags | |
| editor | markdown |
| dateCreated | 2024-02-27 19:04:15 UTC |
Depending on your build environment, you may need to use different formatting for your build files. Below you'll find formatting for Apache Maven and Gradle (Kotlin DSL).
Apache Maven
Insert these into your pom.xml file.
<repository>
<id>iridiumdevelopment</id>
<url>https://nexus.iridiumdevelopment.net/repository/maven-releases/</url>
</repository><dependency>
<groupId>com.iridium</groupId>
<artifactId>IridiumSkyblock</artifactId>
<version>LATEST</version>
</dependency>After that, run mvn package, and maven should recognize the dependency and build your project.
Gradle Kotlin DSL
Insert these into your build.gradle.kts file.
repositories {
maven("https://nexus.iridiumdevelopment.net/repository/maven-releases/")
}dependencies {
implementation("com.iridium:IridiumSkyblock:LATEST")
}After that, run gradle build, and gradle should recognize the dependency and build your project.
Note: You may have to change the version that you're compiling against. Change
LATESTto the version you need. {.is-info}
First get the User object using the following code. And then you can retrieve an Optional Island from the user object
public Optional<Island> getPlayerIsland(Player player) {
User user = IridiumSkyblockAPI.getInstance().getUser(player);
Optional<Island> island = user.getIsland();
return island;
}
This will get the location specified in the second argument, however it will also use the island the player is standing on as cache. This is useful for getting Islands near a player, e.g. when they break a block right click a block ect, since 99% of the time this will be in the island they player is standing on. (and if it isnt it will do a regular lookup) This method is prefered since it is quicker and causes less lag
public Optional<Island> getPlayerIsland(Player player) {
User user = IridiumSkyblock.getInstance().getIslandManager().getTeamViaPlayerLocation(player, player.getLocation());
Optional<Island> island = user.getCurrentIsland();
return island;
}
You can retrieve an Optional Island from the IridiumSkyblockAPI instance
public Optional<Island> getIsland(Location location) {
Optional<Island> island = IridiumSkyblockAPI.getInstance().getIslandViaLocation(location);
return island;
}
You can retrieve an Optional Island from the IridiumSkyblockAPI instance
public Optional<Island> getIsland(String name) {
Optional<Island> island = IridiumSkyblockAPI.getInstance().getIslandByName(name);
return island;
}
To do this you first need to get the User object from a Player You can then do this by using the IridiumSkyblockAPI#getIslandPermission function and passing in the correct PermissionType(BLOCK_PLACE)
public boolean canBuild(Island island, Player player) {
User user = IridiumSkyblockAPI.getInstance().getUser(player);
boolean isAllowed = IridiumSkyblockAPI.getInstance().getIslandPermission(island, user, PermissionType.BLOCK_PLACE);
return isAllowed;
}
Constructor for api initialization.
- Parameters:
iridiumSkyblock— The instance of the {@link IridiumSkyblock} class
Accesses the api instance. Might be null if this method is called when {@link IridiumSkyblock}'s startup method is still being executed.
- Returns: the instance of this api
- Since: 3.0.0
Adds an Island BankItem.
- Parameters:
bankItem— The specified Bankitem - Since: 3.0.0
Adds an Island enhancement.
- Parameters:
enhancementName— The name of the enhancement (used for storage purposes)enhancement— the enhancement item
- Since: 4.0.2
Adds an Island permission.
- Parameters:
permission— The specified Permissionkey— the unique key associated with this permission
- Since: 3.0.0
Adds an IridiumSkyblock command.
- Parameters:
command— The command that should be added - Since: 3.0.0
Gets a {@link User}'s info. Creates one if they don't exist.
- Parameters:
offlinePlayer— The player who's data should be fetched - Returns: the user data
- Since: 3.0.0
Finds an Island by its id.
- Parameters:
id— The id of the Island - Returns: Optional with the Island, empty if there is none
- Since: 3.0.0
Finds an Island by its name.
- Parameters:
name— The name of the Island - Returns: Optional with the Island, empty if there is none
- Since: 3.0.0
Gets an {@link Island} from a location.
- Parameters:
location— The location you are looking at - Returns: Optional of the Island at the location, empty if there is none
- Since: 3.0.0
Gets a permission object from name.
- Parameters:
permissionKey— The permission key - Returns: the permission
- Since: 3.0.0
Gets a permission object from name.
- Parameters:
permissionType— The permission key - Returns: the permission
- Since: 3.0.4
public boolean getIslandPermission(@NotNull Island island, @NotNull User user, @NotNull Permission permission, @NotNull String key)
Gets whether a permission is allowed or denied.
- Parameters:
island— The specified Islanduser— The Specified userpermission— The Specified permissionkey— The permission key
- Returns: true if the permission is allowed
- Since: 3.0.0
public boolean getIslandPermission(@NotNull Island island, @NotNull User user, @NotNull PermissionType permissionType)
Gets whether a permission is allowed or denied.
- Parameters:
island— The specified Islanduser— The specified userpermissionType— The specified permission type
- Returns: true if the permission is allowed
- Since: 3.0.4
Gets a list of Islands sorted by SortType.
- Parameters:
sortType— How we are sorting the Islands - Returns: sorted list of all Islands
- Since: 3.0.0
Returns the overworld.
- Returns: the main Skyblock {@link World}, might be null if some third-party plugin deleted it
- Since: 3.0.0
Returns the nether world.
- Returns: the nether Skyblock {@link World}, might be null if some third-party plugin deleted it
- Since: 3.0.0
Returns the end world.
- Returns: the nether Skyblock {@link World}, might be null if some third-party plugin deleted it
- Since: 3.0.0
Returns whether the specified world is from IridiumSkyblock.
- Parameters:
world— The world that should be checked - Returns: true if it is a world used by IridiumSkyblock
- Since: 3.0.7
Returns if this is the overworld of IridiumSkyblock.
- Parameters:
world— The world that should be checked - Returns: true if this is the overworld of IridiumSkyblock
- Since: 3.1.3
Returns if this is the nether world of IridiumSkyblock.
- Parameters:
world— The world that should be checked - Returns: true if this is the nether world of IridiumSkyblock
- Since: 3.1.3
Returns if this is the end world of IridiumSkyblock.
- Parameters:
world— The world that should be checked - Returns: true if this is the end world of IridiumSkyblock
- Since: 3.1.3
Returns whether the specified player can visit the provided Island.
- Parameters:
user— the userisland— the Island
- Returns: true if the user can visit the Island
- Since: 3.2.7
These API calls can be found in IslandCreateEvent.java.
The name of the Island.
null indicates that the name of the Player is used as the Island name because it hasn't been set.
- Returns: the name of the Island or null
Sets the name of the Island.
set it to null to default to the player's name
- Parameters:
islandName— The name of the island
Sets the schematic of the new island
- Parameters:
schematicConfig— The schematic configuration of the island
- BLOCK_BREAK
- BLOCK_PLACE
- BUCKET
- CHANGE_PERMISSIONS
- CLAIM
- DEMOTE
- DESCRIPTION
- DOORS
- INVITE
- TRUST
- KICK
- KILL_MOBS
- OPEN_CONTAINERS
- PROMOTE
- REDSTONE
- RENAME
- SETHOME
- MANAGE_WARPS
- SPAWNERS
- SETTINGS
These API calls can be found in IslandDeleteEvent.java.