Added cache update post-load

This commit is contained in:
BuildTools 2020-11-13 15:38:21 +00:00
parent cdd36891d2
commit 8815c774b7
3 changed files with 8 additions and 15 deletions

View File

@ -32,19 +32,8 @@ public class PlaceholderManager {
}
public static String translatePlaceholders(String text, Player player) {
if(integrations.isEmpty()) {
placeholders.forEach(placeholderEntry -> {
if(player == null && placeholderEntry.requiresPlayer())
return;
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();
}
AtomicReference<String> translatedReference = new AtomicReference<>(text);
integrations.forEach(placeholderIntegration -> translatedReference.set(placeholderIntegration.translate(translatedReference.get(), player)));
return translatedReference.get();
}
}

View File

@ -447,6 +447,10 @@ public class Loader {
}
Logger.info("");
Logger.info("Updating cache...");
EnchantmentCache.update();
Logger.info("");
}
/**

View File

@ -3,7 +3,7 @@
#
name: "Curse of Breaklessness"
description: &a%ecoenchants_breaklessnesscurse_chance_per_level_percentage%%&f chance to prevent block breaking.
description: "&a%ecoenchants_breaklessnesscurse_chance_per_level_percentage%%&f chance to prevent block breaking."
enabled: true
obtaining: