Utilities-OG
A collection of utilities and APIs used by TrueOG Network. Developed by christianniehaus & NotAlexNoyle.
Current Target: Purpur 1.19.4
Building:
./gradlew build
The resulting .jar file will be in build/libs
At the moment, any config change requires a server restart to take effect.
Features:
- Mock Bamboo: Enables crafting mock bamboo planks from 2x2 bamboo and mock bamboo wood from 2x2 mock bamboo planks.
- Chain Armor: Enables crafting chain armor from chains.
- Color Codes: Displays information to players about Bukkit's chat color codes and their syntax.
- MiniPlaceholderAPI: Enables a custom, easy-to-use MiniPlaceholders API (Note: May require additional configuration for specific placeholders).
- NoFlippy: Prevents trapdoors from being flipped in WorldGuard regions where the "can-flippy" flag is set to DENY (Requires WorldGuard plugin).
- TogglePhantoms: Allows players to use the
/togglephantomscommand to turn phantom spawning on or off for themselves. - Ping: Provides two commands:
/ping(displays real player ping) and/bing(replicates vanilla /ping functionality). - Ranks Menu: Displays information to players about available ranks at the TrueOG Network Store.
Warning:
- DisableEntityCramming (Default: false): Disables entity cramming damage server-wide. This can cause lag if no other plugin manages entity limits. Enable this Module only if you have a separate plugin managing entity limitations.
Permissions:
utilities.about- Description: Allows players to use the base
/utilitiescommand to get information about the plugin. - Default:
op(Server Operator)
- Description: Allows players to use the base
utilities.colorcodes- Description: Grants permission to use the
/colorcodescommand to view Bukkit chat color code information. - Default:
op(Server Operator)
- Description: Grants permission to use the
utilities.togglephantoms- Description: Allows players to use the
/togglephantomscommand to enable or disable phantom spawning for themselves. - Default:
op(Server Operator)
- Description: Allows players to use the
utilities.togglecramming- Description: Grants permission to use the
/togglecrammingcommand (if enabled) to manage entity cramming damage. - Default:
op(Server Operator)
- Description: Grants permission to use the
utilities.ranks- Description: Allows players to use the
/rankscommand to view information about available ranks on the TrueOG Network Store. - Default:
op(Server Operator)
- Description: Allows players to use the
utilities.ping- Description: Grants permission to use the
/ping(real ping) and/bing(mimics vanilla ping) commands. - Default:
op(Server Operator)
- Description: Grants permission to use the
Please note: These permissions can be modified in the Utilities-OG configuration file config.yml.
API Documentation:
1. [void] trueOGMessage(Player player, String message)
Send a message to the player with TrueOG formatting. Supports modern color codes and legacy Bukkit color codes (case-insensitive).
Player targetPlayer = Bukkit.getPlayer("USERNAME");
UtilitiesOG.trueOGMessage(targetPlayer, "&6This is a &*message with <green>True&4OG <bold>formatting!");
2. [TextComponent] trueOGExpandMiniPlaceholders(Player player, String input)
Expands MiniPlaceholders within a string for the given player, with support for color code processing via trueogColorize().
Player targetPlayer = Bukkit.getPlayer("SomePlayer");
String message = "Welcome back, <player_display_name>!";
TextComponent expandedMessage = UtilitiesOG.trueOGExpandMiniPlaceholders(targetPlayer, message);
UtilitiesOG.trueOGMessage(targetPlayer, expandedMessage);
3. [TextComponent] trueogColorize(Player player, String message)
Converts a message string into a formatted TextComponent using both legacy and modern color codes, along with MiniMessage processing.
Player targetPlayer = Bukkit.getPlayer("USERNAME");
TextComponent myMessage = UtilitiesOG.trueogColorize(targetPlayer, "&6This is a &*message with <green>True&4OG <bold>formatting!");
4. [void] trueOGRegisterMiniPlaceholder(String placeholderName, PlaceholderType placeholderType, String content)
Creates and registers a MiniPlaceholder with the specified name and type. The content can include global MiniPlaceholders that will be expanded during registration.
String placeholderName = "example_placeholder";
PlaceholderType placeholderType = PlaceholderType.STRING;
String content = "Hello, <player_name>!";
UtilitiesOG.trueOGRegisterMiniPlaceholder(placeholderName, placeholderType, content);
5. [void] trueOGUnregisterMiniPlaceholder(String placeholderName)
Unregisters a previously registered MiniPlaceholder by its name.
String placeholderName = "example_placeholder";
UtilitiesOG.trueOGUnregisterMiniPlaceholder(placeholderName);
});
6. [boolean] isMiniPlaceholderRegistered(String placeholderName)
Checks if a MiniPlaceholder is already registered based on its name.
String placeholderName = "example_placeholder";
boolean isRegistered = UtilitiesOG.isMiniPlaceholderRegistered(placeholderName);
7. [BukkitTask] runTaskAsynchronously(final Runnable run)
Runs a task asynchronously as UtilitiesOG using the BukkitTask API.
BukkitTask asyncTask = UtilitiesOG.runTaskAsynchronously(() -> {
// Your async code here.
});
TODO:
-
LuckPerms colors for <player_display_name>.
-
Global Placeholder Registration.
-
Relative Placeholder Registration.