public class Replacer extends Object
Constructor and Description |
---|
Replacer() |
Modifier and Type | Method and Description |
---|---|
Map<String,net.md_5.bungee.api.chat.BaseComponent[]> |
componentReplacements()
The map of placeholders with their component array replacements
|
Replacer |
copy()
Create a copy of this Replacer
|
Replacer |
copy(Replacer from)
Copy all the values of another Replacer
|
Replacer |
placeholderIndicator(char placeholderIndicator)
Set the placeholder indicator for both prefix and suffix
|
char |
placeholderPrefix()
The placeholder indicator's prefix character
|
Replacer |
placeholderPrefix(char placeholderPrefix)
The placeholder indicator's prefix character
|
char |
placeholderSuffix()
The placeholder indicator's suffix character
|
Replacer |
placeholderSuffix(char placeholderSuffix)
The placeholder indicator's suffix character
|
Replacer |
replace(Map<String,?> replacements)
Add a map with placeholders and values that should get replaced in the message
|
Replacer |
replace(String... replacements)
Add an array with placeholders and values that should get replaced in the message
|
Replacer |
replace(String placeholder,
net.md_5.bungee.api.chat.BaseComponent... replacement)
Add a placeholder to component mapping that should get replaced in the message
|
net.md_5.bungee.api.chat.BaseComponent[] |
replaceIn(net.md_5.bungee.api.chat.BaseComponent... components)
Replace the placeholders in a component array
|
static net.md_5.bungee.api.chat.BaseComponent[] |
replaceIn(net.md_5.bungee.api.chat.BaseComponent[] message,
String... replacements)
Replace certain placeholders with values in a component array.
|
static net.md_5.bungee.api.chat.BaseComponent[] |
replaceIn(net.md_5.bungee.api.chat.BaseComponent[] message,
String placeholder,
net.md_5.bungee.api.chat.BaseComponent... replacement)
Replace a certain placeholder with a component array in a component array.
|
net.md_5.bungee.api.chat.BaseComponent[] |
replaceIn(List<net.md_5.bungee.api.chat.BaseComponent> components)
Replace the placeholders in a component list
|
String |
replaceIn(String string)
Replace the placeholders in a string.
|
static String |
replaceIn(String message,
String... replacements)
Replace certain placeholders with values in string.
|
Map<String,String> |
replacements()
The map of placeholders with their string replacements
|
public static String replaceIn(String message, String... replacements)
message
- The string to replace inreplacements
- The replacements, nth element is the placeholder, n+1th the valuepublic static net.md_5.bungee.api.chat.BaseComponent[] replaceIn(net.md_5.bungee.api.chat.BaseComponent[] message, String... replacements)
message
- The BaseComponent array to replace inreplacements
- The replacements, nth element is the placeholder, n+1th the valuepublic static net.md_5.bungee.api.chat.BaseComponent[] replaceIn(net.md_5.bungee.api.chat.BaseComponent[] message, String placeholder, net.md_5.bungee.api.chat.BaseComponent... replacement)
message
- The BaseComponent array to replace inplaceholder
- The placeholder to replacereplacement
- The replacement componentspublic Replacer replace(String... replacements)
replacements
- The replacements, nth element is the placeholder, n+1th the valuepublic Replacer replace(Map<String,?> replacements)
replacements
- The replacements mapped placeholder to valuepublic Replacer replace(String placeholder, net.md_5.bungee.api.chat.BaseComponent... replacement)
placeholder
- The placeholder to replacereplacement
- The replacement componentspublic Replacer placeholderIndicator(char placeholderIndicator)
placeholderIndicator
- The character to use as a placeholder indicatorpublic net.md_5.bungee.api.chat.BaseComponent[] replaceIn(net.md_5.bungee.api.chat.BaseComponent... components)
components
- The BaseComponent array to replace inpublic net.md_5.bungee.api.chat.BaseComponent[] replaceIn(List<net.md_5.bungee.api.chat.BaseComponent> components)
components
- The BaseComponent list to replace inpublic String replaceIn(String string)
string
- The String list to replace inpublic Replacer copy()
public Replacer copy(Replacer from)
from
- The replacer to copypublic Map<String,String> replacements()
public Map<String,net.md_5.bungee.api.chat.BaseComponent[]> componentReplacements()
public char placeholderPrefix()
public char placeholderSuffix()
public Replacer placeholderPrefix(char placeholderPrefix)
public Replacer placeholderSuffix(char placeholderSuffix)
Copyright © 2018. All Rights Reserved.