Updated placeholder registration

This commit is contained in:
Auxilor 2022-03-15 13:08:12 +00:00
parent 2608d4239e
commit dc66408d3d
2 changed files with 7 additions and 7 deletions

View File

@ -1,8 +1,8 @@
package com.willfp.ecoenchants.enchantments.itemtypes;
import com.willfp.eco.core.Prerequisite;
import com.willfp.eco.core.integrations.placeholder.PlaceholderEntry;
import com.willfp.eco.core.integrations.placeholder.PlaceholderManager;
import com.willfp.eco.core.placeholder.PlayerPlaceholder;
import com.willfp.eco.util.StringUtils;
import com.willfp.ecoenchants.display.EnchantmentCache;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
@ -109,10 +109,10 @@ public abstract class Spell extends EcoEnchant {
super(key, EnchantmentType.SPELL, prerequisites);
PlaceholderManager.registerPlaceholder(
new PlaceholderEntry(
new PlayerPlaceholder(
this.getPlugin(),
this.getPermissionName() + "_" + "cooldown",
player -> StringUtils.internalToString(getCooldown(this, player))
player -> StringUtils.toNiceString(getCooldown(this, player))
)
);
}

View File

@ -1,8 +1,8 @@
package com.willfp.ecoenchants.enchantments.util;
import com.willfp.eco.core.EcoPlugin;
import com.willfp.eco.core.integrations.placeholder.PlaceholderEntry;
import com.willfp.eco.core.integrations.placeholder.PlaceholderManager;
import com.willfp.eco.core.placeholder.PlayerPlaceholder;
import com.willfp.eco.util.BlockUtils;
import com.willfp.eco.util.NumberUtils;
import com.willfp.eco.util.StringUtils;
@ -74,7 +74,7 @@ public class EnchantmentUtils {
*/
public static void registerPlaceholders(@NotNull final EcoEnchant enchantment) {
PlaceholderManager.registerPlaceholder(
new PlaceholderEntry(
new PlayerPlaceholder(
enchantment.getPlugin(),
enchantment.getPermissionName() + "_" + "enabled",
player -> String.valueOf(enchantment.isEnabled())
@ -86,10 +86,10 @@ public class EnchantmentUtils {
Object object = enchantment.getConfig().get(string);
PlaceholderManager.registerPlaceholder(
new PlaceholderEntry(
new PlayerPlaceholder(
enchantment.getPlugin(),
enchantment.getPermissionName() + "_" + key,
player -> StringUtils.internalToString(object)
player -> StringUtils.toNiceString(object)
)
);
});