@Singleton
public final class PlanPlaceholders
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
PlanPlaceholders.PlayerPlaceholderLoader |
static interface |
PlanPlaceholders.StaticPlaceholderLoader |
Constructor and Description |
---|
PlanPlaceholders(PlanConfig config,
DBSystem dbSystem,
ServerInfo serverInfo,
Formatters formatters,
java.util.Set<Placeholders> placeholderRegistries) |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,PlanPlaceholders.PlayerPlaceholderLoader> |
getPlaceholders() |
java.util.Map<java.lang.String,PlanPlaceholders.StaticPlaceholderLoader> |
getStaticPlaceholders() |
java.lang.String |
onPlaceholderRequest(PlayerContainer player,
java.lang.String placeholder,
java.util.List<java.lang.String> parameters)
Look up the placeholder and check if it is registered.
|
java.lang.String |
onPlaceholderRequest(java.util.UUID uuid,
java.lang.String placeholder,
java.util.List<java.lang.String> parameters) |
void |
register(java.lang.String name,
java.util.function.Function<PlayerContainer,java.io.Serializable> loader) |
void |
register(java.lang.String name,
PlanPlaceholders.PlayerPlaceholderLoader loader) |
void |
registerRaw(java.lang.String name,
java.util.function.BiFunction<java.lang.String,PlayerContainer,java.io.Serializable> loader) |
void |
registerStatic(java.lang.String name,
PlanPlaceholders.StaticPlaceholderLoader loader) |
void |
registerStatic(java.lang.String name,
java.util.function.Supplier<java.io.Serializable> loader) |
@Inject public PlanPlaceholders(PlanConfig config, DBSystem dbSystem, ServerInfo serverInfo, Formatters formatters, java.util.Set<Placeholders> placeholderRegistries)
public void registerStatic(java.lang.String name, java.util.function.Supplier<java.io.Serializable> loader)
public void registerStatic(java.lang.String name, PlanPlaceholders.StaticPlaceholderLoader loader)
public void register(java.lang.String name, java.util.function.Function<PlayerContainer,java.io.Serializable> loader)
public void register(java.lang.String name, PlanPlaceholders.PlayerPlaceholderLoader loader)
public void registerRaw(java.lang.String name, java.util.function.BiFunction<java.lang.String,PlayerContainer,java.io.Serializable> loader)
public java.util.Map<java.lang.String,PlanPlaceholders.PlayerPlaceholderLoader> getPlaceholders()
public java.util.Map<java.lang.String,PlanPlaceholders.StaticPlaceholderLoader> getStaticPlaceholders()
public java.lang.String onPlaceholderRequest(java.util.UUID uuid, java.lang.String placeholder, java.util.List<java.lang.String> parameters)
public java.lang.String onPlaceholderRequest(PlayerContainer player, java.lang.String placeholder, java.util.List<java.lang.String> parameters)
player
- the player who is viewing the placeholderplaceholder
- the placeholder to look up to.parameters
- additional placeholder parametersString
if no
value found but the placeholder is registered,
otherwise null