You can do this simply using the IridiumSkyblockAPI#getIslandPermission() method, which will return true if a user has the specified permission, it will also acount for /is bypass
Creating custom permissions
/*Create the Permission Objectthe item parsed in will be the item displayed in the GUIand the IslandRank is the lowest rank that can use this permission (by default)*/Permission myPermission =newPermission(new Item(XMaterial.BEDROCK,1,1,"&bMy Custom permission",Arrays.asList("&7My Custom Permission added though the IridiumSkyblock API.","","&b&lPermission","%permission%") ),IslandRank.MEMBER );/*This will register the permission with IridiumSkyblockThe first object we are parsing in is the Permission object we created aboveThe second is a unique string we use to identify this permission */IridiumSkyblockAPI.getInstance().addPermission(myPermission,"myPermission");
Checking custom permissions
/*This is getting the permission object assosiated with the Key "myPermission" This is the key you created yourself in the example above
*/Optional<Permission> permission =IridiumSkyblockAPI.getInstance().getPermission("myPermission");/*Here we are getting if the user has access to this permissionThe island we are parsing though is the island we are testing if they have this permissionThe second is the user objectNext is the Permission object we got aboveAnd finally we have the Permission KeyThis will return if they player has access to break blocks taking if the user is bypassed into account*/boolean hasPermission = IridiumSkyblockAPI.getInstance().getIslandPermission(island, user, permission.get(), "myPermission");
Adding your own Island Upgrades
Upgrade<SizeUpgrade> upgrade = new Upgrade<>(true, "Custom Upgrade",
new Item(XMaterial.GRASS_BLOCK, 11, 1, "&b&lCustom Island Upgrade", Arrays.asList(
"&bMy Custom Island Upgrade",
"",
"&b&l[!] &bLeft Click to Purchase this Upgrade"
)), ImmutableMap.<Integer, SizeUpgrade>builder()
.put(1, new SizeUpgrade(1000, 15, 50))
.put(2, new SizeUpgrade(1000, 15, 100))
.put(3, new SizeUpgrade(1000, 15, 150))
.build());
IridiumSkyblockAPI.getInstance().addUpgrade("CustomUpgrade", upgrade);
Each Upgrade must be supplied with an Object Extending UpgradeData using generics, UpgradeData contains the ugrade cost assosiated with the upgrade, you can then add whatever other variables you with such as a size integer.
You can then get what Upgrade Level an island is on by using the following code Supplying the same key you passed in when calling the addUpgrade method
int level = IridiumSkyblockAPI.getInstance().getIslandUpgrade(island, "CustomUpgrade").getLevel()