Added value-placeholder option to custom ecoenchants

This commit is contained in:
Auxilor 2022-02-28 09:57:55 +00:00
parent 384ff82adb
commit adcfaccbf5
2 changed files with 13 additions and 0 deletions

View File

@ -37,6 +37,11 @@ public class CustomEcoEnchant extends EcoEnchant {
}
}
@Override
public String getPlaceholder(final int level) {
return this.getLevel(level).getValuePlaceholder();
}
@Override
protected void postUpdate() {
for (EnchantmentTarget target : this.getTargets()) {

View File

@ -30,6 +30,12 @@ public class CustomEcoEnchantLevel implements Holder {
*/
private final Set<ConfiguredEffect> effects = new HashSet<>();
/**
* The value placeholder.
*/
@Getter
private final String valuePlaceholder;
/**
* Create custom EcoEnchant level.
*
@ -47,6 +53,8 @@ public class CustomEcoEnchantLevel implements Holder {
for (Config cfg : config.getSubsections("conditions")) {
conditions.add(Conditions.compile(cfg, "Custom EcoEnchant ID " + parent.getKey().getKey()));
}
this.valuePlaceholder = config.getString("value-placeholder");
}
@NotNull