Repository navigation
Utilities
darksoldier1404 edited this page Jan 28, 2026
·
1 revision
For a full list of wiki pages, see the Home page.
DPP-Core includes a variety of utility classes designed to simplify common plugin development tasks.
ConfigUtils is a static utility class for handling YAML configuration files.
| Method | Description |
|---|---|
loadDefaultPluginConfig(JavaPlugin plugin) |
Loads the main config.yml. If it doesn't exist, it's copied from the plugin's resources. It also automatically adds missing keys from the default config (missingKeyFix). |
savePluginConfig(JavaPlugin plugin, YamlConfiguration config) |
Saves the main config.yml. |
loadCustomData(JavaPlugin plugin, String fileName, String path) |
Loads any YAML file from a specified path within the plugin's data folder. Returns null if the file doesn't exist. |
saveCustomData(JavaPlugin plugin, YamlConfiguration config, String fileName, String path) |
Saves a YamlConfiguration to any specified path/file. |
loadCustomDataMap(JavaPlugin plugin, String path) |
Loads all .yml files in a directory into a HashMap<String, YamlConfiguration>, where the key is the file name without the extension. |
A simple utility for translating color codes in strings.
-
public static String applyColor(String message): Translates both standard&color codes and custom hex color codes in the format<#RRGGBB>.
String colored = ColorUtils.applyColor("&aThis is green. <#FF0000>This is red.");
player.sendMessage(colored);DPP-Core features a built-in language management system called DLang.
-
Enable in
DPlugin: When you extendDPlugin, call the super constructor withtrue:super(true);. -
Create Lang Files: Create language files (e.g.,
en_US.yml,ko_KR.yml) in your plugin'sresources/lang/directory. -
Set Default Language: In your
config.yml, set the default language:Settings.Lang: en_US.
lang/en_US.yml example:
welcome-message: "Welcome to the server, {0}!"
item-not-found: "The item '{0}' could not be found."In your DPlugin class, you can get the DLang instance and retrieve translated strings.
// Get a simple message
String welcome = getLang().get("welcome-message");
// Get a message with arguments
String notFound = getLang().getWithArgs("item-not-found", "Magic Sword");
player.sendMessage(welcome.replace("{0}", player.getName()));
player.sendMessage(notFound);PluginUtil is a crucial internal utility class that manages plugin integrations, version checking, and placeholder registration.
| Method | Description |
|---|---|
initializeSoftDependPlugins() |
Called internally by DPP-Core to safely get instances of soft-dependency plugins like Essentials, LuckPerms, etc. It updates static fields in DPPCore that the API wrappers use. |
isDependPluginLoaded(DependPlugin) |
Checks if a specific supported soft-dependency (e.g., DependPlugin.PlaceholderAPI) was successfully loaded. |
addPlugin(JavaPlugin plugin, int id) |
Registers your plugin with DPP-Core's metrics and update checker system. The id is your plugin's bStats ID. You should call this in your onLoad or onEnable method. |
updateCheck(CommandSender sender) |
Manually triggers an update check for all registered DP-Plugins, sending the result to the specified CommandSender. |
loadAllAction() |
Loads all action files from the actions directory, making them available via DPPCore.getInstance().getActions(). See the Action Builder page for more details. |
- TargetAPI: A simple API to get the entity a player is looking at.
-
Metrics: An implementation of bStats, automatically enabled for plugins that register with
PluginUtil.