Fixed various codestyle / misc issues

This commit is contained in:
Auxilor 2021-07-16 14:21:19 +02:00
parent d5948d6cf0
commit 4b2e3ba533
8 changed files with 13 additions and 6 deletions

View File

@ -112,7 +112,7 @@ public class EcoEnchantsPlugin extends EcoPlugin {
public void onReload() {
targetYml.update();
rarityYml.update();
((EnchantDisplay) this.getDisplayModule()).update();
this.getDisplayModule().update();
EcoEnchants.values().forEach((ecoEnchant -> {
HandlerList.unregisterAll(ecoEnchant);

View File

@ -133,7 +133,7 @@ public class EnchantmentCache {
String rawName = name;
name = color + name;
description.replaceAll(line -> Display.PREFIX + ((EnchantDisplay) PLUGIN.getDisplayModule()).getOptions().getDescriptionOptions().getColor() + line);
description.replaceAll(line -> Display.PREFIX + PLUGIN.getDisplayModule().getOptions().getDescriptionOptions().getColor() + line);
CACHE.put(enchantment.getKey(), new CacheEntry(enchantment, name, rawName, description, type, rarity));
}

View File

@ -591,6 +591,8 @@ public class EcoEnchants {
/**
* Update all {@link EcoEnchant}s.
*
* @param plugin Instance of EcoEnchants.
*/
@ConfigUpdater
public static void update(@NotNull final EcoEnchantsPlugin plugin) {

View File

@ -92,6 +92,8 @@ public class EnchantmentRarity {
/**
* Update all rarities.
*
* @param plugin Instance of EcoEnchants.
*/
@ConfigUpdater
public static void update(@NotNull final EcoEnchantsPlugin plugin) {

View File

@ -65,6 +65,8 @@ public class EnchantmentTarget {
/**
* Update all targets.
*
* @param plugin Instance of EcoEnchants.
*/
@ConfigUpdater
public static void update(@NotNull final EcoEnchantsPlugin plugin) {

View File

@ -179,9 +179,7 @@ public class VillagerListeners extends PluginDependent<EcoPlugin> implements Lis
anyConflicts.set(true);
}
EcoEnchant ecoEnchant = enchant;
if (enchantment.getType().equals(ecoEnchant.getType()) && ecoEnchant.getType().isSingular()) {
if (enchantment.getType().equals(enchant.getType()) && enchant.getType().isSingular()) {
anyConflicts.set(true);
}
});

View File

@ -1,6 +1,5 @@
package com.willfp.ecoenchants.enchantments.support.vanilla;
import com.willfp.eco.core.EcoPlugin;
import com.willfp.ecoenchants.EcoEnchantsPlugin;
import com.willfp.ecoenchants.proxy.proxies.EcoCraftEnchantmentManagerProxy;
import com.willfp.ecoenchants.util.ProxyUtils;
@ -33,6 +32,8 @@ public class VanillaEnchantments {
/**
* Update the map.
*
* @param plugin Instance of EcoEnchants.
*/
public static void update(@NotNull final EcoEnchantsPlugin plugin) {
Map<Enchantment, VanillaEnchantmentMetadata> map = new HashMap<>();

View File

@ -51,6 +51,8 @@ public class WatcherTriggers extends PluginDependent<EcoPlugin> implements Liste
/**
* Update if allowed on npc.
*
* @param plugin Instance of EcoEnchants.
*/
@ConfigUpdater
public static void update(@NotNull final EcoEnchantsPlugin plugin) {