Removed internal parser (again)

This commit is contained in:
BuildTools 2020-11-13 15:49:26 +00:00
parent baf34470d8
commit 730c940a22

View File

@ -32,20 +32,8 @@ public class PlaceholderManager {
} }
public static String translatePlaceholders(String text, Player player) { public static String translatePlaceholders(String text, Player player) {
if(integrations.isEmpty()) {
AtomicReference<String> returnText = new AtomicReference<>();
placeholders.forEach(placeholderEntry -> {
if(player == null && placeholderEntry.requiresPlayer())
return;
String test = "%ecoenchants_" + placeholderEntry.getIdentifier() + "%";
returnText.set(text.replaceAll(test, placeholderEntry.getResult(player)));
});
return returnText.get();
} else {
AtomicReference<String> translatedReference = new AtomicReference<>(text); AtomicReference<String> translatedReference = new AtomicReference<>(text);
integrations.forEach(placeholderIntegration -> translatedReference.set(placeholderIntegration.translate(translatedReference.get(), player))); integrations.forEach(placeholderIntegration -> translatedReference.set(placeholderIntegration.translate(translatedReference.get(), player)));
return translatedReference.get(); return translatedReference.get();
} }
} }
}