public interface Expansion
Expansion that contains placeholders
Usage Example:
Player player = event.getPlayer();
Expansion.Builder builder = Expansion.builder("player")
.audiencePlaceholder("name", (p, queue, ctx) -> Tag.selfClosingInserting(Component.text(((Player)p).getUsername()))
.build();
Expansion expansion = builder.build();
// You can also call the register() method to register
// the Expansion in the MiniPlaceholders global Extensions and
// use it in MiniPlaceholders.getAudiencePlaceholders(Audience) e.g.
TagResolver resolver = expansion.audiencePlaceholder(player);
player.sendMessage(MiniMessage.miniMessage().deserialize("Hello <luckperms_prefix> <player_name>", resolver));
- Since:
- 1.0.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescription@NotNull TagResolveraudiencePlaceholders(@NotNull Audience audience) Get theTagResolverof the desiredAudiencestatic Expansion.BuilderCreates a new Expansion Builder@NotNull TagResolverGet global placeholders@NotNull Stringname()Get the expansion namevoidregister()Register this expansionbooleanGet the registration status of this expansion@NotNull TagResolverrelationalPlaceholders(@NotNull Audience audience, @NotNull Audience otherAudience) Get the relational placeholders based on two audiencesvoidUnregisters this expansion
-
Method Details
-
name
Get the expansion name- Returns:
- the expansion name
- Since:
- 1.0.0
-
audiencePlaceholders
Get theTagResolverof the desiredAudience- Parameters:
audience- the audience- Returns:
- A TagResolver with variable placeholders of an Audience
- Since:
- 1.0.0
-
relationalPlaceholders
@NotNull @NotNull TagResolver relationalPlaceholders(@NotNull @NotNull Audience audience, @NotNull @NotNull Audience otherAudience) Get the relational placeholders based on two audiencesThe resulting TagResolver will give results according to the 2
Audienceprovided and when called at any time will retrieve the required values- Parameters:
audience- the main audienceotherAudience- the secondary audience- Returns:
- A TagResolver with variable placeholders between 2
Audiences - Since:
- 1.0.0
-
globalPlaceholders
Get global placeholders- Returns:
- the global placeholders
- Since:
- 1.0.0
-
register
void register()Register this expansion- Throws:
IllegalStateException- if the expansion you are trying to register is already registered- Since:
- 1.0.0
- See Also:
-
unregister
void unregister()Unregisters this expansion- Throws:
IllegalStateException- if the expansion you are trying to unregister is not registered- Since:
- 2.1.0
- See Also:
-
registered
boolean registered()Get the registration status of this expansion- Returns:
- true if the expansion is registered, otherwise false
- Since:
- 2.1.0
-
builder
Creates a new Expansion Builder- Parameters:
name- the expansion name- Returns:
- a new expansion builder
- Since:
- 1.0.0
-