diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java index fcfd63ac..e15ad9e1 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchant.java @@ -174,8 +174,6 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Watche Bukkit.getPluginManager().addPermission(permission); } - //WorldguardManager.registerFlag(this.getPermissionName() + "-enabled", true); - if (type.getRequiredToExtend() != null && !type.getRequiredToExtend().isInstance(this)) { return; } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/meta/EnchantmentRarity.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/meta/EnchantmentRarity.java index 8bca78b7..426f19d4 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/meta/EnchantmentRarity.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/meta/EnchantmentRarity.java @@ -1,10 +1,7 @@ package com.willfp.ecoenchants.enchantments.meta; -import com.willfp.eco.util.NumberUtils; import com.willfp.eco.util.StringUtils; import com.willfp.eco.util.config.updating.annotations.ConfigUpdater; -import com.willfp.eco.util.integrations.placeholder.PlaceholderEntry; -import com.willfp.eco.util.integrations.placeholder.PlaceholderManager; import com.willfp.ecoenchants.config.EcoEnchantsConfigs; import lombok.Getter; import org.jetbrains.annotations.NotNull; @@ -86,27 +83,6 @@ public class EnchantmentRarity { Optional matching = REGISTERED.stream().filter(rarity -> rarity.getName().equalsIgnoreCase(name)).findFirst(); matching.ifPresent(REGISTERED::remove); - PlaceholderManager.registerPlaceholder(new PlaceholderEntry( - "rarity_" + this.getName() + "_probability", - player -> NumberUtils.format(this.tableProbability) - )); - PlaceholderManager.registerPlaceholder(new PlaceholderEntry( - "rarity_" + this.getName() + "_minlevel", - player -> NumberUtils.format(this.minimumLevel) - )); - PlaceholderManager.registerPlaceholder(new PlaceholderEntry( - "rarity_" + this.getName() + "_villagerprobability", - player -> NumberUtils.format(this.villagerProbability) - )); - PlaceholderManager.registerPlaceholder(new PlaceholderEntry( - "rarity_" + this.getName() + "_lootprobability", - player -> NumberUtils.format(this.lootProbability) - )); - PlaceholderManager.registerPlaceholder(new PlaceholderEntry( - "rarity_" + this.getName() + "_color", - player -> this.customColor - )); - REGISTERED.add(this); } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/EnchantmentUtils.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/EnchantmentUtils.java index c47c5e3f..72703d8d 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/EnchantmentUtils.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/EnchantmentUtils.java @@ -8,7 +8,6 @@ import com.willfp.eco.util.integrations.placeholder.PlaceholderEntry; import com.willfp.eco.util.integrations.placeholder.PlaceholderManager; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.EcoEnchants; -import com.willfp.ecoenchants.enchantments.itemtypes.Spell; import lombok.experimental.UtilityClass; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; @@ -70,45 +69,5 @@ public class EnchantmentUtils { ) ); }); - - if (enchantment.getConfig().getRaw(EcoEnchants.CONFIG_LOCATION + "chance-per-level") != null) { - PlaceholderManager.registerPlaceholder( - new PlaceholderEntry( - enchantment.getPermissionName() + "_" + "chance_per_level", - player -> NumberUtils.format(enchantment.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "chance-per-level")) - ) - ); - } - - if (enchantment.getConfig().getRaw(EcoEnchants.CONFIG_LOCATION + "multiplier") != null) { - PlaceholderManager.registerPlaceholder( - new PlaceholderEntry( - enchantment.getPermissionName() + "_" + "multiplier", - player -> NumberUtils.format(enchantment.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier")) - ) - ); - PlaceholderManager.registerPlaceholder( - new PlaceholderEntry( - enchantment.getPermissionName() + "_" + "multiplier_percentage", - player -> NumberUtils.format(enchantment.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier") * 100) - ) - ); - } - - if (enchantment instanceof Spell) { - PlaceholderManager.registerPlaceholder( - new PlaceholderEntry( - enchantment.getPermissionName() + "_" + "cooldown", - player -> NumberUtils.format(Spell.getCooldown((Spell) enchantment, player)), - true - ) - ); - PlaceholderManager.registerPlaceholder( - new PlaceholderEntry( - enchantment.getPermissionName() + "_" + "cooldown_total", - player -> NumberUtils.format(((Spell) enchantment).getCooldownTime()) - ) - ); - } } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/FastTrig.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/FastTrig.java index c22ca7a9..f97ffed2 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/FastTrig.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/util/FastTrig.java @@ -17,10 +17,10 @@ public class FastTrig { /** * Sin lookup table. */ - private static final double[] sin = new double[modulus]; + private static final double[] SIN_LOOKUP = new double[modulus]; private static double sinLookup(final int a) { - return a >= 0 ? sin[a % modulus] : -sin[-a % modulus]; + return a >= 0 ? SIN_LOOKUP[a % modulus] : -SIN_LOOKUP[-a % modulus]; } /** @@ -45,8 +45,8 @@ public class FastTrig { static { - for (int i = 0; i < sin.length; i++) { - sin[i] = Math.sin((i * Math.PI) / (precision * 180)); + for (int i = 0; i < SIN_LOOKUP.length; i++) { + SIN_LOOKUP[i] = Math.sin((i * Math.PI) / (precision * 180)); } } }