mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-26 15:45:12 +01:00
Updated placeholder registration
This commit is contained in:
parent
2608d4239e
commit
dc66408d3d
@ -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))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -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)
|
||||
)
|
||||
);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user