Class PlaceholderApiBridge
java.lang.Object
dev.crafty.core.bridge.placeholders.placeholderapi.PlaceholderApiBridge
- All Implemented Interfaces:
Bridge,PlaceholderBridge
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this bridge can be registered.getName()Returns the unique name of this bridge instance.voidregisterPlaceholder(String identifier, BiFunction<org.bukkit.entity.Player, String, String> replacer) Registers a new placeholder with the given identifier and replacement function.replacePlaceholders(String input) Replaces all registered placeholders in the given input string with their corresponding values.replacePlaceholders(String input, org.bukkit.entity.Player player) Replaces all registered placeholders in the given input string with their corresponding values, using the providedPlayercontext for player-specific placeholders.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.crafty.core.bridge.Bridge
pluginEnabledMethods inherited from interface dev.crafty.core.bridge.placeholders.PlaceholderBridge
bridgeName
-
Constructor Details
-
PlaceholderApiBridge
public PlaceholderApiBridge()
-
-
Method Details
-
registerPlaceholder
public void registerPlaceholder(String identifier, BiFunction<org.bukkit.entity.Player, String, String> replacer) Description copied from interface:PlaceholderBridgeRegisters a new placeholder with the given identifier and replacement function.- Specified by:
registerPlaceholderin interfacePlaceholderBridge- Parameters:
identifier- the unique identifier for the placeholder (e.g., "player_name")replacer- a function that takes the input string and returns the replacement value
-
replacePlaceholders
Description copied from interface:PlaceholderBridgeReplaces all registered placeholders in the given input string with their corresponding values.- Specified by:
replacePlaceholdersin interfacePlaceholderBridge- Parameters:
input- the input string containing placeholders to be replaced- Returns:
- the input string with all placeholders replaced
-
replacePlaceholders
Description copied from interface:PlaceholderBridgeReplaces all registered placeholders in the given input string with their corresponding values, using the providedPlayercontext for player-specific placeholders.- Specified by:
replacePlaceholdersin interfacePlaceholderBridge- Parameters:
input- the input string containing placeholders to be replacedplayer- the player whose context should be used for placeholder replacement- Returns:
- the input string with all placeholders replaced, using player context where applicable
-
getName
Description copied from interface:BridgeReturns the unique name of this bridge instance. -
canRegister
public boolean canRegister()Description copied from interface:BridgeChecks if this bridge can be registered.- Specified by:
canRegisterin interfaceBridge- Returns:
- true if the bridge can be registered, false otherwise
-