Package dev.majek.hexnicks.hook
Class HookManager
java.lang.Object
dev.majek.hexnicks.hook.HookManager
Handles hooked plugins.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull String
applyPlaceHolders
(@NotNull org.bukkit.entity.Player player, @NotNull String string) Apply placeholders from PlaceholderAPI to a string.@Nullable String
Get Essentials' nickname prefix if Essentials is hooked.boolean
Check if the plugin is hooked into Essentials.boolean
Check if the plugin is hooked into PlaceholderAPI.boolean
Check if the plugin is hooked into Vault.void
Reload the hooks to make sure we're hooked into all available plugins.void
setEssNick
(@NotNull org.bukkit.entity.Player player, @NotNull net.kyori.adventure.text.Component nickname) Set a player's Essentials nickname if Essentials is hooked.@NotNull net.kyori.adventure.text.Component
vaultPrefix
(@NotNull org.bukkit.entity.Player player) Get a player's Vault prefix if Vault is hooked.@NotNull net.kyori.adventure.text.Component
vaultSuffix
(@NotNull org.bukkit.entity.Player player) Get a player's Vault suffix if Vault is hooked.
-
Constructor Details
-
HookManager
public HookManager()
-
-
Method Details
-
reloadHooks
public void reloadHooks()Reload the hooks to make sure we're hooked into all available plugins. -
isPapiHooked
public boolean isPapiHooked()Check if the plugin is hooked into PlaceholderAPI.- Returns:
- True if hooked.
-
isVaultHooked
public boolean isVaultHooked()Check if the plugin is hooked into Vault.- Returns:
- True if hooked.
-
isEssentialsHooked
public boolean isEssentialsHooked()Check if the plugin is hooked into Essentials.- Returns:
- True if hooked.
-
applyPlaceHolders
@NotNull public @NotNull String applyPlaceHolders(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull String string) Apply placeholders from PlaceholderAPI to a string.- Parameters:
player
- The player referenced in the string.string
- The string to search.- Returns:
- Formatted string.
-
vaultPrefix
@NotNull public @NotNull net.kyori.adventure.text.Component vaultPrefix(@NotNull @NotNull org.bukkit.entity.Player player) Get a player's Vault prefix if Vault is hooked.- Parameters:
player
- The player.- Returns:
- Player's prefix.
-
vaultSuffix
@NotNull public @NotNull net.kyori.adventure.text.Component vaultSuffix(@NotNull @NotNull org.bukkit.entity.Player player) Get a player's Vault suffix if Vault is hooked.- Parameters:
player
- The player.- Returns:
- Player's suffix.
-
setEssNick
public void setEssNick(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull net.kyori.adventure.text.Component nickname) Set a player's Essentials nickname if Essentials is hooked.- Parameters:
player
- The player.nickname
- The nickname.
-
getEssNickPrefix
Get Essentials' nickname prefix if Essentials is hooked.- Returns:
- Nickname prefix.
-