mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Added support for psuedo-papi syntax without placeholderapi for internal placeholders
This commit is contained in:
parent
efb0ad84e0
commit
0915d4c31a
@ -32,8 +32,16 @@ public class PlaceholderManager {
|
||||
}
|
||||
|
||||
public static String translatePlaceholders(String text, Player player) {
|
||||
AtomicReference<String> translatedReference = new AtomicReference<>(text);
|
||||
integrations.forEach(placeholderIntegration -> translatedReference.set(placeholderIntegration.translate(translatedReference.get(), player)));
|
||||
return translatedReference.get();
|
||||
if(integrations.isEmpty()) {
|
||||
placeholders.forEach(placeholderEntry -> {
|
||||
String test = "%ecoenchants_" + placeholderEntry.getIdentifier() + "%";
|
||||
text.replaceAll(test, placeholderEntry.getResult(player));
|
||||
});
|
||||
return text;
|
||||
} else {
|
||||
AtomicReference<String> translatedReference = new AtomicReference<>(text);
|
||||
integrations.forEach(placeholderIntegration -> translatedReference.set(placeholderIntegration.translate(translatedReference.get(), player)));
|
||||
return translatedReference.get();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user