Repository navigation
External API Wrappers
For a full list of wiki pages, see the Home page.
DPP-Core provides convenient wrapper classes for several popular Bukkit plugins. These wrappers simplify interaction by providing static methods that handle null checks and boilerplate code, ensuring that your plugin doesn't break if a dependency is missing.
DPP-Core automatically detects if these plugins are present on the server. You can check if a dependency was loaded using PluginUtil.isDependPluginLoaded(DependPlugin).
-
Utility Class:
com.darksoldier1404.dppc.api.placeholder.PlaceholderUtils -
Dependency Enum:
DependPlugin.PlaceholderAPI
This wrapper allows you to safely apply placeholders to strings.
-
PlaceholderUtils.applyPlaceholder(Player p, String text): Parses all placeholders in the given text. If PlaceholderAPI is not present, it returns the original text unmodified.
DPP-Core also includes a PlaceholderBuilder to easily register your own custom placeholders.
Example:
// In your onEnable method
new PlaceholderBuilder.Builder(this)
.identifier('myplugin') // The identifier for your placeholders (e.g., %myplugin_level%)
.author('YourName')
.version('1.0')
.onRequest((player, params) -> {
if(player == null) return "";
if(params.equalsIgnoreCase('level')){
return String.valueOf(getPlayerLevel(player)); // Your logic to get player level
}
if(params.equalsIgnoreCase('balance')){
return String.valueOf(getPlayerBalance(player)); // Your logic
}
return null; // Let PlaceholderAPI handle it or return an empty string
})
.build();-
Utility Class:
com.darksoldier1404.dppc.api.essentials.MoneyAPI -
Dependency Enum:
DependPlugin.Essentials
Provides a simple interface for interacting with the Essentials economy system.
-
MoneyAPI.hasEnoughMoney(Player p, double amount): Checks if a player has a certain amount of money. -
MoneyAPI.getMoney(Player p): Returns the player's balance as aBigDecimal. -
MoneyAPI.addMoney(Player p, double amount): Gives money to a player. -
MoneyAPI.takeMoney(Player p, double amount): Takes money from a player.
-
Utility Classes:
com.darksoldier1404.dppc.api.luckperms.PermissionAPIcom.darksoldier1404.dppc.api.luckperms.LuckpermAPI
-
Dependency Enum:
DependPlugin.LuckPerms
These classes provide helpers for managing player permissions, prefixes, and suffixes.
-
PermissionAPI.addPermission(UUID uuid, String permission): Adds a permission node to a user. -
PermissionAPI.delPermission(UUID uuid, String permission): Removes a permission node from a user. -
PermissionAPI.isPlayerInGroup(Player player, String group): Checks if a player is in a specific group.
-
LuckpermAPI.setPrefix(OfflinePlayer p, String prefix, int priority): Sets a player's prefix. -
LuckpermAPI.setSuffix(OfflinePlayer p, String suffix, int priority): Sets a player's suffix. -
LuckpermAPI.delPrefix(...)/delSuffix(...): Removes prefixes or suffixes.
-
Utility Class:
com.darksoldier1404.dppc.api.worldguard.WorldGuardAPI -
Dependency Enum:
DependPlugin.WorldGuard
A comprehensive wrapper for the WorldGuard API.
-
WorldGuardAPI.isPlayerInRegion(Player player, String regionName): Checks if a player is currently inside a region with the specified name. -
WorldGuardAPI.getPlayersInRegion(World world, String regionName): Returns a list of all players inside a specific region. -
WorldGuardAPI.isRegion(World world, String regionName): Checks if a region with the given name exists in a world. -
WorldGuardAPI.isPlayerRegionOwner(...)/isPlayerRegionMember(...): Checks a player's role within a region.