From 202c424052f201e0bef07dc04a793650e732b201 Mon Sep 17 00:00:00 2001 From: chronosacaria Date: Wed, 29 Nov 2023 22:05:34 -0500 Subject: [PATCH] Config Changes - Redid the McdwEnchantmentsConfig and McdwEnchantmentSettingsConfig to be easier to read and use - Removed EnchantStatsID.java, as it is no longer needed - Moved the following values from the McdwEnchantmentSettingsConfig to the McdwEnchantmentsConfig - `ENIGMA_RESONATOR_DIVISOR` -> `offset` value for `ENIGMA_RESONATOR` - `DYNAMO_STACK_CAP` -> `offset` value for `DYNAMO` - `ENCHANTMENT_TRIGGER_BASE_CHANCE` -> `procChance` value in proc-able enchantments - `HEALING_FACTOR` -> `offset` value for healing enchantments - `directDamageEnchantmentMultiplier` called the same thing, but moved to top of McdwEnchantmentsConfig - Propagated necessary changes throughout project - Configs will be reset; BACK UP YOUR CONFIG __BEFORE__ UPDATING --- .../chronosacaria/mcdw/client/McdwClient.java | 14 +- .../configs/EnchantmentIDConfigHelper.java | 57 ++ .../McdwEnchantmentSettingsConfig.java | 54 -- .../mcdw/configs/McdwEnchantmentsConfig.java | 585 +++++++++++++++++- .../mcdw/effects/EnchantmentEffects.java | 107 ++-- .../enchantments/AccelerateEnchantment.java | 12 +- .../enchantments/AmbushEnchantment.java | 12 +- .../enchantments/AnimaConduitEnchantment.java | 14 +- .../enchantments/BonusShotEnchantment.java | 12 +- .../BurstBowstringEnchantment.java | 12 +- .../ChainReactionEnchantment.java | 14 +- .../enchantments/ChainsEnchantment.java | 12 +- .../enchantments/ChargeEnchantment.java | 14 +- .../enchantments/CobwebShotEnchantment.java | 15 +- .../enchantments/CommittedEnchantment.java | 14 +- .../enchantments/CriticalHitEnchantment.java | 12 +- .../DippingPoisonEnchantment.java | 12 +- .../enchantments/DynamoEnchantment.java | 14 +- .../enchantments/EchoEnchantment.java | 14 +- .../EnigmaResonatorEnchantment.java | 12 +- .../enchantments/ExplodingEnchantment.java | 14 +- .../enchantments/FreezingEnchantment.java | 15 +- .../enchantments/FuseShotEnchantment.java | 12 +- .../enchantments/GravityEnchantment.java | 12 +- .../enchantments/GrowingEnchantment.java | 12 +- .../GuardingStrikeEnchantment.java | 14 +- .../enchantments/IllagersBaneEnchantment.java | 12 +- .../enchantments/JunglePoisonEnchantment.java | 15 +- .../enchantments/LeechingEnchantment.java | 14 +- .../LevitationShotEnchantment.java | 12 +- .../enchantments/OverchargeEnchantment.java | 12 +- .../enchantments/PainCycleEnchantment.java | 14 +- .../enchantments/PhantomsMarkEnchantment.java | 12 +- .../enchantments/PoisonCloudEnchantment.java | 12 +- .../enchantments/ProspectorEnchantment.java | 12 +- .../enchantments/RadianceEnchantment.java | 12 +- .../enchantments/RampagingEnchantment.java | 14 +- .../enchantments/RefreshmentEnchantment.java | 14 +- .../enchantments/ReplenishEnchantment.java | 12 +- .../enchantments/RicochetEnchantment.java | 12 +- .../enchantments/RushdownEnchantment.java | 14 +- .../enchantments/ShadowBarbEnchantment.java | 13 +- .../enchantments/ShadowShotEnchantment.java | 13 +- .../enchantments/SharedPainEnchantment.java | 15 +- .../enchantments/ShockwaveEnchantment.java | 14 +- .../enchantments/SmitingEnchantment.java | 14 +- .../enchantments/SoulDevourerEnchantment.java | 12 +- .../enchantments/SoulSiphonEnchantment.java | 14 +- .../enchantments/StunningEnchantment.java | 14 +- .../enchantments/SwirlingEnchantment.java | 14 +- .../enchantments/TempoTheftEnchantment.java | 12 +- .../enchantments/ThunderingEnchantment.java | 12 +- .../enchantments/VoidShotEnchantment.java | 12 +- .../enchantments/VoidStrikeEnchantment.java | 12 +- .../enchantments/WeakeningEnchantment.java | 14 +- .../enchantments/WildRageEnchantment.java | 12 +- .../mcdw/enums/EnchantStatsID.java | 8 - .../mcdw/enums/EnchantmentsID.java | 1 - .../mcdw/mixin/mcdw/BowItemMixin.java | 8 +- .../mcdw/mixin/mcdw/CrossbowItemMixin.java | 5 +- .../mixin/mcdw/ExperienceOrbEntityMixin.java | 4 +- .../mcdw/mixin/mcdw/LivingEntityMixin.java | 21 +- .../mcdw/LivingEntityPlayerEntityMixin.java | 68 +- .../mcdw/PersistentProjectileEntityMixin.java | 32 +- .../ModelPredicateProviderRegistryMixin.java | 7 +- .../mcdw/registries/CompatRegistry.java | 4 +- 66 files changed, 1117 insertions(+), 522 deletions(-) create mode 100644 src/main/java/chronosacaria/mcdw/configs/EnchantmentIDConfigHelper.java delete mode 100644 src/main/java/chronosacaria/mcdw/enums/EnchantStatsID.java diff --git a/src/main/java/chronosacaria/mcdw/client/McdwClient.java b/src/main/java/chronosacaria/mcdw/client/McdwClient.java index 8a60eed3..caadf4bb 100644 --- a/src/main/java/chronosacaria/mcdw/client/McdwClient.java +++ b/src/main/java/chronosacaria/mcdw/client/McdwClient.java @@ -44,7 +44,7 @@ public static void registerBowPredicates(McdwBow bow) { return 0.0F; } else { int useTicks = itemStack.getMaxUseTime() - livingEntity.getItemUseTimeLeft(); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled()) { int accelerateLevel = EnchantmentHelper.getLevel(EnchantsRegistry.ACCELERATE, itemStack); if (accelerateLevel > 0) { StatusEffectInstance accelerateInstance = livingEntity.getStatusEffect(StatusEffectsRegistry.ACCELERATE); @@ -53,7 +53,7 @@ public static void registerBowPredicates(McdwBow bow) { useTicks = (int) (useTicks * (1f + (MathHelper.clamp(consecutiveShots * (6.0f + 2.0f * accelerateLevel), 0f, 100f) / 100f))); } } - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.OVERCHARGE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsEnabled()) { int overchargeLevel = EnchantmentHelper.getLevel(EnchantsRegistry.OVERCHARGE, itemStack); if (overchargeLevel > 0) { int overcharge = (int) Math.min((useTicks / bow.getDrawSpeed()) - 1, overchargeLevel); @@ -77,7 +77,7 @@ public static void registerShortBowPredicates(McdwShortbow bow) { return 0.0F; } else { int useTicks = itemStack.getMaxUseTime() - livingEntity.getItemUseTimeLeft(); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled()) { int accelerateLevel = EnchantmentHelper.getLevel(EnchantsRegistry.ACCELERATE, itemStack); if (accelerateLevel > 0) { StatusEffectInstance accelerateInstance = livingEntity.getStatusEffect(StatusEffectsRegistry.ACCELERATE); @@ -86,7 +86,7 @@ public static void registerShortBowPredicates(McdwShortbow bow) { useTicks = (int) (useTicks * (1f + (MathHelper.clamp(consecutiveShots * (6.0f + 2.0f * accelerateLevel), 0f, 100f) / 100f))); } } - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.OVERCHARGE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsEnabled()) { int overchargeLevel = EnchantmentHelper.getLevel(EnchantsRegistry.OVERCHARGE, itemStack); if (overchargeLevel > 0) { int overcharge = (int) Math.min((useTicks / bow.getDrawSpeed()) - 1, overchargeLevel); @@ -110,7 +110,7 @@ public static void registerLongBowPredicates(McdwLongbow bow) { return 0.0F; } else { int useTicks = itemStack.getMaxUseTime() - livingEntity.getItemUseTimeLeft(); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled()) { int accelerateLevel = EnchantmentHelper.getLevel(EnchantsRegistry.ACCELERATE, itemStack); if (accelerateLevel > 0) { StatusEffectInstance accelerateInstance = livingEntity.getStatusEffect(StatusEffectsRegistry.ACCELERATE); @@ -119,7 +119,7 @@ public static void registerLongBowPredicates(McdwLongbow bow) { useTicks = (int) (useTicks * (1f + (MathHelper.clamp(consecutiveShots * (6.0f + 2.0f * accelerateLevel), 0f, 100f) / 100f))); } } - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.OVERCHARGE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsEnabled()) { int overchargeLevel = EnchantmentHelper.getLevel(EnchantsRegistry.OVERCHARGE, itemStack); if (overchargeLevel > 0) { int overcharge = (int) Math.min((useTicks / bow.getDrawSpeed()) - 1, overchargeLevel); @@ -143,7 +143,7 @@ public static void registerCrossbowPredicates(McdwCrossbow crossbow) { return 0.0F; } else { int useTicks = itemStack.getMaxUseTime() - livingEntity.getItemUseTimeLeft(); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled()) { int accelerateLevel = EnchantmentHelper.getLevel(EnchantsRegistry.ACCELERATE, itemStack); if (accelerateLevel > 0) { StatusEffectInstance accelerateInstance = livingEntity.getStatusEffect(StatusEffectsRegistry.ACCELERATE); diff --git a/src/main/java/chronosacaria/mcdw/configs/EnchantmentIDConfigHelper.java b/src/main/java/chronosacaria/mcdw/configs/EnchantmentIDConfigHelper.java new file mode 100644 index 00000000..03dc7361 --- /dev/null +++ b/src/main/java/chronosacaria/mcdw/configs/EnchantmentIDConfigHelper.java @@ -0,0 +1,57 @@ +package chronosacaria.mcdw.configs; + +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class EnchantmentIDConfigHelper { + List comment; + float offset = 0.0f; + boolean isEnabled = true; + boolean isAvailableForEnchantedBookOffer = true; + boolean isAvailableForRandomSelection = true; + int maxLevel = 3; + @Nullable Integer procChance = 0; + + public float mcdw$getOffset(){ + return offset; + } + public boolean mcdw$getIsEnabled() { + return isEnabled; + } + public boolean mcdw$getIsAvailableForEnchantedBookOffer() { + return isAvailableForEnchantedBookOffer; + } + public boolean mcdw$getIsAvailableForRandomSelection() { + return isAvailableForRandomSelection; + } + public int mcdw$getMaxLevel() { + return maxLevel; + } + public @Nullable Integer mcdw$getProcChance() { + return procChance; + } + + @SuppressWarnings("unused") + public EnchantmentIDConfigHelper(){ + } + + public EnchantmentIDConfigHelper(boolean isEnabled, boolean isAvailableForEnchantedBookOffer, boolean isAvailableForRandomSelection, int maxLevel, @Nullable Integer procChance) { + this.isEnabled = isEnabled; + this.isAvailableForEnchantedBookOffer = isAvailableForEnchantedBookOffer; + this.isAvailableForRandomSelection = isAvailableForRandomSelection; + this.maxLevel = maxLevel; + this.procChance = procChance; + } + + public EnchantmentIDConfigHelper(List comment, boolean isEnabled, boolean isAvailableForEnchantedBookOffer, boolean isAvailableForRandomSelection, int maxLevel, @Nullable Integer procChance, float effectOffset) { + this.comment = comment; + this.isEnabled = isEnabled; + this.isAvailableForEnchantedBookOffer = isAvailableForEnchantedBookOffer; + this.isAvailableForRandomSelection = isAvailableForRandomSelection; + this.maxLevel = maxLevel; + this.procChance = procChance; + this.offset = effectOffset; + } + +} diff --git a/src/main/java/chronosacaria/mcdw/configs/McdwEnchantmentSettingsConfig.java b/src/main/java/chronosacaria/mcdw/configs/McdwEnchantmentSettingsConfig.java index 51519790..c0ba6e3f 100644 --- a/src/main/java/chronosacaria/mcdw/configs/McdwEnchantmentSettingsConfig.java +++ b/src/main/java/chronosacaria/mcdw/configs/McdwEnchantmentSettingsConfig.java @@ -1,7 +1,5 @@ package chronosacaria.mcdw.configs; -import chronosacaria.mcdw.enums.EnchantStatsID; -import chronosacaria.mcdw.enums.EnchantmentsID; import chronosacaria.mcdw.enums.SettingsID; import me.shedaniel.autoconfig.ConfigData; import me.shedaniel.autoconfig.annotation.Config; @@ -25,26 +23,6 @@ Final Permission (4): Only hostile mobs // Enchantment Settings public final LinkedHashMap ENABLE_ENCHANTMENT_SETTINGS = new LinkedHashMap<>(); - @Comment("ENIGMA_RESONATOR_DIVISOR -> Higher number = lower damage. Default value = 3.25.") - public final LinkedHashMap ENIGMA_RESONATOR_DIVISOR = new LinkedHashMap<>(); - - @Comment("Dynamo Stack Cap, Higher number = more potential damage. Default value = 20.") - public final LinkedHashMap DYNAMO_STACK_CAP = new LinkedHashMap<>(); - - @Comment("Enchantment Trigger Chances Base. This is not the % to occur, but the higher this number, the higher " + - "the chance to trigger.") - public final LinkedHashMap ENCHANTMENT_TRIGGER_BASE_CHANCE = new LinkedHashMap<>(); - - @Comment(""" - A slider value for damage modifying enchantments: Ambush, Critical Hit, Void Strike, Pain Cycle, - Enigma Resonator, Dynamo, Shadow Form, Enigma Shot, Growing, Void Shot, Overcharge, Committed, - Hunter's Promise. - """) - public float directDamageEnchantmentMultiplier = 1.0f; - - @Comment("Healing Factor Slider. Percentage of healing -> 1.0 = 100%. Default value = 1.0.") - public final LinkedHashMap HEALING_FACTOR = new LinkedHashMap<>(); - public McdwEnchantmentSettingsConfig(){ ENABLE_ENCHANTMENT_SETTINGS.put(SettingsID.ENABLE_OP_ENCHANTMENT_MIXING, false); ENABLE_ENCHANTMENT_SETTINGS.put(SettingsID.LEECHING_CAN_BE_MIXED_WITH_HEALING, false); @@ -52,37 +30,5 @@ public McdwEnchantmentSettingsConfig(){ ENABLE_ENCHANTMENT_SETTINGS.put(SettingsID.SHARED_PAIN_CAN_DAMAGE_USER, false); ENABLE_ENCHANTMENT_SETTINGS.put(SettingsID.AREA_OF_EFFECT_ENCHANTS_DONT_AFFECT_PLAYERS, true); ENABLE_ENCHANTMENT_SETTINGS.put(SettingsID.ENABLE_INNATE_ENCHANTMENTS, true); - - ENIGMA_RESONATOR_DIVISOR.put(EnchantStatsID.ENIGMA_RESONATOR_DIVISOR, 3.25f); - DYNAMO_STACK_CAP.put(EnchantStatsID.DYNAMO_STACK_CAP, 20); - HEALING_FACTOR.put(EnchantStatsID.HEALING_FACTOR, 1.0f); - - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.CHAIN_REACTION, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.CHAINS, 20); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.CHARGE, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.COMMITTED, 30); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.CRITICAL_HIT, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.ECHO, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.EXPLODING, 20); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.FREEZING, 30); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.FUSE_SHOT, 20); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.GRAVITY, 30); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.POISONING, 30); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.POISON_CLOUD, 30); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.PROSPECTOR, 5); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.RADIANCE, 20); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.RAMPAGING, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.REPLENISH, 3); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.RUSHDOWN, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.SHADOW_SHOT, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.SHOCKWAVE, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.SOUL_SIPHON, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.STUNNING, 20); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.SWIRLING, 10); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.THUNDERING, 20); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.VOID_SHOT, 25); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.VOID_STRIKE, 15); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.WEAKENING, 30); - ENCHANTMENT_TRIGGER_BASE_CHANCE.put(EnchantmentsID.WILD_RAGE, 10); } } diff --git a/src/main/java/chronosacaria/mcdw/configs/McdwEnchantmentsConfig.java b/src/main/java/chronosacaria/mcdw/configs/McdwEnchantmentsConfig.java index 907f0836..55220657 100644 --- a/src/main/java/chronosacaria/mcdw/configs/McdwEnchantmentsConfig.java +++ b/src/main/java/chronosacaria/mcdw/configs/McdwEnchantmentsConfig.java @@ -3,31 +3,580 @@ import chronosacaria.mcdw.enums.EnchantmentsID; import me.shedaniel.autoconfig.ConfigData; import me.shedaniel.autoconfig.annotation.Config; +import me.shedaniel.cloth.clothconfig.shadowed.blue.endless.jankson.Comment; import java.util.LinkedHashMap; +import java.util.List; @Config(name = "mcdw_enchantments_config") public class McdwEnchantmentsConfig implements ConfigData { - // Enable or Disable Enchantments - public final LinkedHashMap ENABLE_ENCHANTMENTS = new LinkedHashMap<>(); - public final LinkedHashMap ENABLE_VILLAGER_TRADING = new LinkedHashMap<>(); - public final LinkedHashMap ENABLE_RANDOM_SELECTION = new LinkedHashMap<>(); + @Comment(""" + A slider value for damage modifying enchantments: + Ambush, Critical Hit, Void Strike, Pain Cycle, Enigma Resonator, Dynamo, Shadow Form, + Enigma Shot, Growing, Void Shot, Overcharge, Committed and Hunter's Promise. + """) + public float directDamageEnchantmentMultiplier = 1.0f; - public McdwEnchantmentsConfig(){ - for (EnchantmentsID enchantmentsID : EnchantmentsID.values()) - ENABLE_ENCHANTMENTS.put(enchantmentsID, true); - - for (EnchantmentsID enchantmentsID : EnchantmentsID.values()) - ENABLE_VILLAGER_TRADING.put(enchantmentsID, true); - ENABLE_VILLAGER_TRADING.replace(EnchantmentsID.BURST_BOWSTRING, false); - ENABLE_VILLAGER_TRADING.replace(EnchantmentsID.DYNAMO, false); - ENABLE_VILLAGER_TRADING.replace(EnchantmentsID.SHARED_PAIN, false); + public final LinkedHashMap ENCHANTMENT_CONFIG = new LinkedHashMap<>(); - for (EnchantmentsID enchantmentsID : EnchantmentsID.values()) - ENABLE_RANDOM_SELECTION.put(enchantmentsID, true); - ENABLE_RANDOM_SELECTION.replace(EnchantmentsID.BURST_BOWSTRING, false); - ENABLE_RANDOM_SELECTION.replace(EnchantmentsID.DYNAMO, false); - ENABLE_RANDOM_SELECTION.replace(EnchantmentsID.SHARED_PAIN, false); + public McdwEnchantmentsConfig(){ + ENCHANTMENT_CONFIG.put( + EnchantmentsID.ACCELERATE, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.AMBUSH, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.ANIMA_CONDUIT, + new EnchantmentIDConfigHelper( + List.of("Effect Offset: Healing Percentage,", + "Offset Note: higher offset = more health recovered,", + "Default: 100f" + ), + true, + true, + true, + 3, + null, + 100f + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.BONUS_SHOT, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.BURST_BOWSTRING, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.BUZZY_BEE, + new EnchantmentIDConfigHelper( + true, + false, + false, + 1, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.CHAIN_REACTION, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.CHAINS, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 20 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.CHARGE, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.COBWEB_SHOT, + new EnchantmentIDConfigHelper( + true, + true, + true, + 1, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.COMMITTED, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.CRITICAL_HIT, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.DIPPING_POISON, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.DYNAMO, + new EnchantmentIDConfigHelper( + List.of("Effect Offset: Maximum Stacks,", + "Offset Note: higher offset = more potential stacks,", + "Default: 20f" + ), + true, + false, + false, + 3, + null, + 20f + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.ECHO, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.ENIGMA_RESONATOR, + new EnchantmentIDConfigHelper( + List.of("Effect Offset: Damage Divisor,", + "Formula: Math.max((Math.log(numSouls * level + 20) / offset) - 1, 0)", + "Offset Note: higher offset = less damage,", + "Default: 3.25f" + ), + true, + true, + true, + 3, + null, + 3.25f + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.EXPLODING, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 20 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.FREEZING, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 30 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.FUSE_SHOT, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 20 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.GRAVITY, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 30 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.GROWING, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.GUARDING_STRIKE, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.ILLAGERS_BANE, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.POISONING, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 30 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.LEECHING, + new EnchantmentIDConfigHelper( + List.of("Effect Offset: Healing Percentage,", + "Offset Note: higher offset = more health recovered,", + "Default: 100f" + ), + true, + true, + true, + 3, + null, + 100f + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.LEVITATION_SHOT, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.MULTI_SHOT, + new EnchantmentIDConfigHelper( + true, + true, + true, + 1, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.OVERCHARGE, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.PAIN_CYCLE, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.PHANTOMS_MARK, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.POISON_CLOUD, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 30 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.PROSPECTOR, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 5 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.RADIANCE, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 20 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.RAMPAGING, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.REFRESHMENT, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.REPLENISH, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 3 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.RICOCHET, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.RUSHDOWN, + new EnchantmentIDConfigHelper( + true, + true, + true, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.SHADOW_BARB, + new EnchantmentIDConfigHelper( + true, + false, + false, + 1, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.SHADOW_SHOT, + new EnchantmentIDConfigHelper( + true, + false, + false, + 1, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.SHARED_PAIN, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.SHOCKWAVE, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.SMITING, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.SOUL_DEVOURER, + new EnchantmentIDConfigHelper( + List.of("Effect Offset: Additional XP,", + "Formula: amount * (1 + (level / offset)),", + "Offset Note: higher offset = less additional XP,", + "Default: 3.0f" + ), + true, + false, + false, + 3, + null, + 3.0f + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.SOUL_SIPHON, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.STUNNING, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + 20 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.SWIRLING, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + 10 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.TEMPO_THEFT, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + null + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.THUNDERING, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + 20 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.VOID_SHOT, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + 25 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.VOID_STRIKE, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + 15 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.WEAKENING, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + 30 + ) + ); + ENCHANTMENT_CONFIG.put( + EnchantmentsID.WILD_RAGE, + new EnchantmentIDConfigHelper( + true, + false, + false, + 3, + 10 + ) + ); } } diff --git a/src/main/java/chronosacaria/mcdw/effects/EnchantmentEffects.java b/src/main/java/chronosacaria/mcdw/effects/EnchantmentEffects.java index 1de9dc7b..123ad78b 100644 --- a/src/main/java/chronosacaria/mcdw/effects/EnchantmentEffects.java +++ b/src/main/java/chronosacaria/mcdw/effects/EnchantmentEffects.java @@ -1,11 +1,9 @@ package chronosacaria.mcdw.effects; -import chronosacaria.mcdw.Mcdw; import chronosacaria.mcdw.api.interfaces.IMcdwEnchantedArrow; import chronosacaria.mcdw.api.util.*; import chronosacaria.mcdw.enchants.goals.WildRageAttackGoal; import chronosacaria.mcdw.enums.BowsID; -import chronosacaria.mcdw.enums.EnchantStatsID; import chronosacaria.mcdw.enums.EnchantmentsID; import chronosacaria.mcdw.mixin.mcdw.CreeperEntityAccessor; import chronosacaria.mcdw.mixin.mcdw.MobEntityAccessor; @@ -42,12 +40,12 @@ import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; -import java.util.LinkedHashMap; import java.util.UUID; -public class EnchantmentEffects { +import static chronosacaria.mcdw.Mcdw.CONFIG; - static final LinkedHashMap CONFIG_CHANCE = Mcdw.CONFIG.mcdwEnchantmentSettingsConfig.ENCHANTMENT_TRIGGER_BASE_CHANCE; +@SuppressWarnings("DataFlowIssue") +public class EnchantmentEffects { public static int mcdw$getEnchantmentLevel(Enchantment enchantment, LivingEntity enchantedEntity, boolean isOffHandStack) { if (FabricLoader.getInstance().isModLoaded("bettercombat")) { @@ -68,7 +66,9 @@ public static int soulDevourerExperience(PlayerEntity playerEntity, int amount) int soulDevourerLevel = mainHandLevel + offHandLevel; if (soulDevourerLevel > 0) - return Math.round((float) amount * (1 + ((float) soulDevourerLevel / 3f))); + return Math.round((float) amount * (1 + ((float) soulDevourerLevel / + CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.SOUL_DEVOURER).mcdw$getOffset()))); return amount; } @@ -79,7 +79,9 @@ public static int animaConduitExperience(PlayerEntity playerEntity, int amount, float missingHealth = playerEntity.getMaxHealth() - playerEntity.getHealth(); if (missingHealth > 0) { float i = Math.min(AbilityHelper.getAnimaRepairAmount(amount, animaLevel), missingHealth); - playerEntity.heal(i * Mcdw.CONFIG.mcdwEnchantmentSettingsConfig.HEALING_FACTOR.get(EnchantStatsID.HEALING_FACTOR)); + playerEntity.heal(i * + (CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.ANIMA_CONDUIT).mcdw$getOffset())/100f); amount -= (int) (i * 5); return Math.max(amount, 0); } @@ -90,7 +92,7 @@ public static int animaConduitExperience(PlayerEntity playerEntity, int amount, /* LivingEntityMixin */ //mcdw$damageModifiers public static float huntersPromiseDamage(PlayerEntity owner, ServerWorld serverWorld) { - if (Mcdw.CONFIG.mcdwEnableItemsConfig.BOWS_ENABLED.get(BowsID.BOW_HUNTERS_PROMISE)) { + if (CONFIG.mcdwEnableItemsConfig.BOWS_ENABLED.get(BowsID.BOW_HUNTERS_PROMISE)) { if (owner.getMainHandStack().isOf(BowsID.BOW_HUNTERS_PROMISE.getItem())) { UUID petOwnerUUID = owner.getUuid(); @@ -110,7 +112,7 @@ public static void applyProspector(LivingEntity prospectingEntity, LivingEntity if (prospectorLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.PROSPECTOR) * prospectorLevel)) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PROSPECTOR).mcdw$getProcChance() * prospectorLevel)) { if (victim instanceof Monster){ CleanlinessHelper.mcdw$dropItem(victim, Items.EMERALD); } @@ -123,7 +125,7 @@ public static void applyRushdown(LivingEntity rushingEntity, boolean isOffHandSt if (rushdownLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.RUSHDOWN))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RUSHDOWN).mcdw$getProcChance())) { StatusEffectInstance rushdown = new StatusEffectInstance(StatusEffects.SPEED, 100 * rushdownLevel, 2, false, false); rushingEntity.addStatusEffect(rushdown); @@ -136,7 +138,7 @@ public static void applySoulSiphon(PlayerEntity siphoningEntity, boolean isOffHa if (soulLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.SOUL_SIPHON))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_SIPHON).mcdw$getProcChance())) { siphoningEntity.addExperience(3 * soulLevel); } } @@ -145,7 +147,7 @@ public static void applySoulSiphon(PlayerEntity siphoningEntity, boolean isOffHa public static void applyShadowShotShadowForm(LivingEntity shadowShotEntity, PersistentProjectileEntity ppe, int duration){ int shadowShotLevel = ((IMcdwEnchantedArrow)ppe).mcdw$getShadowShotLevel(); if (shadowShotLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.SHADOW_SHOT))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getProcChance())) { shadowShotEntity.addStatusEffect(new StatusEffectInstance(StatusEffectsRegistry.SHADOW_FORM, duration, 0, false, true, true)); } } @@ -171,7 +173,7 @@ public static float criticalHitDamage(LivingEntity crittingEntity, LivingEntity if (criticalHitLevel > 0) { - if (CleanlinessHelper.percentToOccur(10 + (CONFIG_CHANCE.get(EnchantmentsID.CRITICAL_HIT) * criticalHitLevel))) { + if (CleanlinessHelper.percentToOccur(10 + (CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CRITICAL_HIT).mcdw$getProcChance() * criticalHitLevel))) { if (!AbilityHelper.entityCanCrit(crittingEntity)) { CleanlinessHelper.playCenteredSound(target, SoundEvents.ENTITY_PLAYER_ATTACK_CRIT, 0.5F, 1.0F); @@ -187,7 +189,7 @@ public static float voidStrikeDamage(LivingEntity voidEntity, LivingEntity targe if (voidlevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.VOID_STRIKE) + (5 * voidlevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_STRIKE).mcdw$getProcChance() + (5 * voidlevel))) { CleanlinessHelper.playCenteredSound(target, SoundEvents.ENTITY_ENDERMAN_TELEPORT, 0.5F, 1.0F); return (2f * voidlevel) - 1f; // -1f accounts for change to storedAmount calc } @@ -235,7 +237,8 @@ private static float calcEnigmaResonatorDamage(PlayerEntity resonatingEntity, Li CleanlinessHelper.playCenteredSound(target, SoundEvents.PARTICLE_SOUL_ESCAPE, 0.5F, 1.0F); float extraDamageMultiplier = (float) (Math.log(numSouls * resonatorLevel + 20)) / - Mcdw.CONFIG.mcdwEnchantmentSettingsConfig.ENIGMA_RESONATOR_DIVISOR.get(EnchantStatsID.ENIGMA_RESONATOR_DIVISOR); + CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.ENIGMA_RESONATOR).mcdw$getOffset(); return Math.max(extraDamageMultiplier - 1, 0f); } @@ -260,7 +263,7 @@ public static float voidShotDamage(LivingEntity target, PersistentProjectileEnti int voidlevel = ((IMcdwEnchantedArrow)ppe).mcdw$getVoidShotLevel(); if (voidlevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.VOID_SHOT) + (5 * voidlevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_SHOT).mcdw$getProcChance() + (5 * voidlevel))) { CleanlinessHelper.playCenteredSound(target, SoundEvents.ENTITY_ENDERMAN_TELEPORT, 0.5F, 1.0F); return voidlevel; } @@ -273,7 +276,8 @@ public static float committedDamage(LivingEntity committedEntity, LivingEntity t if (committedLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.COMMITTED))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.COMMITTED).mcdw$getProcChance())) { CleanlinessHelper.playCenteredSound(target, SoundEvents.ENTITY_GENERIC_EXPLODE, 0.5F, 1.0F); @@ -343,7 +347,7 @@ public static void applyFreezing(LivingEntity freezerEntity, LivingEntity target int freezingLevel = mcdw$getEnchantmentLevel(EnchantsRegistry.FREEZING, freezerEntity, isOffHandStack); if (freezingLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.FREEZING) + (10 * freezingLevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FREEZING).mcdw$getProcChance() + (10 * freezingLevel))) { AbilityHelper.causeFreezing(target, 100); } } @@ -353,7 +357,7 @@ public static void applyPoisoning(LivingEntity poisoningEntity, LivingEntity tar int poisoningLevel = mcdw$getEnchantmentLevel(EnchantsRegistry.JUNGLE_POISON, poisoningEntity, isOffHandStack); if (poisoningLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.POISONING))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISONING).mcdw$getProcChance())) { StatusEffectInstance poison = new StatusEffectInstance(StatusEffects.POISON, 60, poisoningLevel - 1); target.addStatusEffect(poison); } @@ -364,7 +368,7 @@ public static void applyPoisonCloud(LivingEntity poisoningEntity, LivingEntity t int poisoningLevel = mcdw$getEnchantmentLevel(EnchantsRegistry.POISON_CLOUD, poisoningEntity, isOffHandStack); if (poisoningLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.POISON_CLOUD))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getProcChance())) { AOECloudHelper.spawnPickyStatusCloud(poisoningEntity, target, StatusEffects.POISON, 60, poisoningLevel - 1, true, true, false); } @@ -376,7 +380,8 @@ public static void applyRadianceCloud(LivingEntity radiantEntity, boolean isOffH if (radianceLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.RADIANCE))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.RADIANCE).mcdw$getProcChance())) { AOECloudHelper.spawnPickyStatusCloud(radiantEntity, radiantEntity, StatusEffects.REGENERATION, 100, radianceLevel - 1, false, false, true); } @@ -388,7 +393,8 @@ public static void applyShockwave(LivingEntity shockwaveEntity, LivingEntity tar if (shockwaveLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.SHOCKWAVE) + (15 * shockwaveLevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.SHOCKWAVE).mcdw$getProcChance() + (15 * shockwaveLevel))) { causeShockwaveAttack(shockwaveEntity, target, 3.0f, amount); @@ -402,7 +408,10 @@ public static void applyShockwave(LivingEntity shockwaveEntity, LivingEntity tar public static void causeShockwaveAttack(LivingEntity user, LivingEntity target, float distance, float amount) { AOEHelper.getEntitiesByConfig(user, distance).stream() .filter(nearbyEntity -> nearbyEntity != target) - .forEach(nearbyEntity -> nearbyEntity.damage(nearbyEntity.getWorld().getDamageSources().generic(), amount * 0.25f)); + .forEach(nearbyEntity -> nearbyEntity.damage( + nearbyEntity.getWorld().getDamageSources().generic(), + amount * 0.25f) + ); } public static void causeSmitingAttack(LivingEntity user, LivingEntity target, float distance, float amount) { @@ -415,7 +424,8 @@ public static void applyStunning(LivingEntity stunningEntity, LivingEntity targe int stunningLevel = mcdw$getEnchantmentLevel(EnchantsRegistry.STUNNING, stunningEntity, isOffHandStack); if (stunningLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.STUNNING) + (15 * stunningLevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.STUNNING).mcdw$getProcChance() + (15 * stunningLevel))) { target.addStatusEffect(new StatusEffectInstance(StatusEffects.SLOWNESS, 60, 10)); target.addStatusEffect(new StatusEffectInstance(StatusEffects.NAUSEA, 60, 1)); } @@ -427,7 +437,8 @@ public static void applyThundering(LivingEntity thunderingEntity, float amount, if (thunderingLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.THUNDERING))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.THUNDERING).mcdw$getProcChance())) { electrocuteNearbyEnemies(thunderingEntity, 5 * thunderingLevel, amount, Integer.MAX_VALUE); @@ -474,7 +485,8 @@ public static void applyWeakeningCloud(LivingEntity weakeningEntity, LivingEntit if (weakeningLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.WEAKENING))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.WEAKENING).mcdw$getProcChance())) { AOECloudHelper.spawnPickyStatusCloud(weakeningEntity, target, StatusEffects.WEAKNESS, 60, weakeningLevel - 1, true, true, false); } @@ -486,7 +498,8 @@ public static void applySwirling(LivingEntity swirlingEntity, LivingEntity targe if (swirlingLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.SWIRLING) + (15 * swirlingLevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.SWIRLING).mcdw$getProcChance() + (15 * swirlingLevel))) { causeSwirlingAttack(swirlingEntity, swirlingEntity, 1.5f, amount); @@ -505,7 +518,8 @@ public static void applyChains(LivingEntity chainingEntity, LivingEntity target, if (chainsLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.CHAINS))) + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.CHAINS).mcdw$getProcChance())) chainNearbyEntities(chainingEntity, target, 1.5F * chainsLevel, chainsLevel); } } @@ -528,7 +542,8 @@ public static void applyGravity(LivingEntity gravityEntity, LivingEntity target, if (gravityLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.GRAVITY))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.GRAVITY).mcdw$getProcChance())) { pullInNearbyEntities(gravityEntity, target, (gravityLevel + 1) * 3); } @@ -559,7 +574,8 @@ public static void echoDamage(LivingEntity echoEntity, LivingEntity target, floa if (echoLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.ECHO) + (15 * echoLevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.ECHO).mcdw$getProcChance() + (15 * echoLevel))) { causeEchoAttack(echoEntity, target, 3.0f, echoLevel, amount); @@ -584,7 +600,8 @@ public static void explodingDamage(LivingEntity exploderEntity, LivingEntity tar int explodingLevel = mcdw$getEnchantmentLevel(EnchantsRegistry.EXPLODING, exploderEntity, isOffHandStack); if (explodingLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.EXPLODING))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.EXPLODING).mcdw$getProcChance())) { CleanlinessHelper.playCenteredSound(target, SoundEvents.ENTITY_GENERIC_EXPLODE, 0.5F, 1.0F); AOECloudHelper.spawnExplosionCloud(exploderEntity, target, 3.0F); @@ -604,7 +621,8 @@ public static void applyRampaging(LivingEntity rampagingEntity, boolean isOffHan int rampagingLevel = mcdw$getEnchantmentLevel(EnchantsRegistry.RAMPAGING, rampagingEntity, isOffHandStack); if (rampagingLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.RAMPAGING))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.RAMPAGING).mcdw$getProcChance())) { StatusEffectInstance rampage = new StatusEffectInstance(StatusEffects.HASTE, rampagingLevel * 100, 2, false, false); rampagingEntity.addStatusEffect(rampage); @@ -627,7 +645,9 @@ public static void applyLeeching(LivingEntity leechingEntity, LivingEntity targe if (leechingLevel > 0) { if (leechingEntity.getHealth() < leechingEntity.getMaxHealth()) { float healthRegained = (0.2F + 0.2F * leechingLevel) * target.getMaxHealth(); - leechingEntity.heal(healthRegained * Mcdw.CONFIG.mcdwEnchantmentSettingsConfig.HEALING_FACTOR.get(EnchantStatsID.HEALING_FACTOR)); + leechingEntity.heal(healthRegained * + (CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.LEECHING).mcdw$getOffset())/100f); } } } @@ -646,7 +666,7 @@ public static void applyChainReaction(LivingEntity shooter, LivingEntity target, int chainReactionLevel = ((IMcdwEnchantedArrow) ppe).mcdw$getChainReactionLevel(); if (chainReactionLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.CHAIN_REACTION) * chainReactionLevel)){ + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAIN_REACTION).mcdw$getProcChance() * chainReactionLevel)){ ProjectileEffectHelper.mcdw$fireChainReactionProjectileFromTarget(target.getEntityWorld(), target, shooter, 3.15F,1.0F); } @@ -657,7 +677,7 @@ public static void applyCharge(LivingEntity chargingEntity, PersistentProjectile int chargeLevel = ((IMcdwEnchantedArrow) ppe).mcdw$getChargeLevel(); if (chargeLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.CHARGE))) + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHARGE).mcdw$getProcChance())) chargingEntity.addStatusEffect(new StatusEffectInstance(StatusEffects.SPEED, chargeLevel * 20, 4)); } @@ -677,7 +697,7 @@ public static void applyFuseShot(LivingEntity shooter, LivingEntity target, Pers int fuseShotLevel = ((IMcdwEnchantedArrow) ppe).mcdw$getFuseShotLevel(); if (fuseShotLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.FUSE_SHOT) + (15 * fuseShotLevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FUSE_SHOT).mcdw$getProcChance() + (15 * fuseShotLevel))) { CleanlinessHelper.playCenteredSound(target, SoundEvents.ENTITY_GENERIC_EXPLODE, 0.5F, 1.0F); AOECloudHelper.spawnExplosionCloud(shooter, target, 3.0F); @@ -692,7 +712,7 @@ public static void applyGravityShot(LivingEntity shooter, LivingEntity target, P int gravityLevel = ((IMcdwEnchantedArrow) ppe).mcdw$getGravityLevel(); if (gravityLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.GRAVITY))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GRAVITY).mcdw$getProcChance())) { pullInNearbyEntities(shooter, target, (gravityLevel + 1) * 3); } } @@ -718,7 +738,7 @@ public static void applyPoisonCloudShot(LivingEntity shooter, LivingEntity targe int poisonCloudLevel = ((IMcdwEnchantedArrow) ppe).mcdw$getPoisonCloudLevel(); if (poisonCloudLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.POISON_CLOUD))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getProcChance())) { AOECloudHelper.spawnStatusCloud(shooter, target, StatusEffects.POISON, poisonCloudLevel - 1); } } @@ -728,7 +748,7 @@ public static void applyRadianceShot(LivingEntity shooter, LivingEntity target, int radianceLevel = ((IMcdwEnchantedArrow) ppe).mcdw$getRadianceLevel(); if (radianceLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.RADIANCE))) + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getProcChance())) AOECloudHelper.spawnRegenCloudAtPos(shooter, true, target.getBlockPos(), radianceLevel - 1); } } @@ -747,7 +767,7 @@ public static void applyReplenish(PlayerEntity shooter, PersistentProjectileEnti int replenishLevel = ((IMcdwEnchantedArrow) ppe).mcdw$getReplenishLevel(); if (replenishLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.REPLENISH) + (7 * replenishLevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REPLENISH).mcdw$getProcChance() + (7 * replenishLevel))) { CleanlinessHelper.mcdw$dropItem(shooter, Items.ARROW); } } @@ -766,7 +786,7 @@ public static void applyThunderingShot(LivingEntity shooter, PersistentProjectil if (thunderingLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.THUNDERING))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.THUNDERING).mcdw$getProcChance())) { electrocuteNearbyEnemies(shooter, 5 * thunderingLevel, 5, Integer.MAX_VALUE); @@ -777,7 +797,7 @@ public static void applyThunderingShot(LivingEntity shooter, PersistentProjectil public static void applyWildRage(MobEntity ragingEntity, PersistentProjectileEntity ppe) { int wildRageLevel = ((IMcdwEnchantedArrow)ppe).mcdw$getWildRageLevel(); if (wildRageLevel > 0) { - if (CleanlinessHelper.percentToOccur(CONFIG_CHANCE.get(EnchantmentsID.WILD_RAGE) + (10 * wildRageLevel))) { + if (CleanlinessHelper.percentToOccur(CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WILD_RAGE).mcdw$getProcChance() + (10 * wildRageLevel))) { sendIntoWildRage(ragingEntity); } } @@ -829,7 +849,8 @@ public static void handleAddDynamoEffect(PlayerEntity playerEntity) { } else { --i; } - i = MathHelper.clamp(i, 0, Mcdw.CONFIG.mcdwEnchantmentSettingsConfig.DYNAMO_STACK_CAP.get(EnchantStatsID.DYNAMO_STACK_CAP)); + i = MathHelper.clamp(i, 0, (int) CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG + .get(EnchantmentsID.DYNAMO).mcdw$getOffset()); StatusEffectInstance dynamoUpdateInstance = new StatusEffectInstance(StatusEffectsRegistry.DYNAMO, 120000, i, false, false, true); playerEntity.addStatusEffect(dynamoUpdateInstance); } diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/AccelerateEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/AccelerateEnchantment.java index fa744afe..7bd7e77d 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/AccelerateEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/AccelerateEnchantment.java @@ -20,7 +20,7 @@ public class AccelerateEnchantment extends RangedEnchantment { public AccelerateEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("accelerate"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,19 +32,19 @@ public AccelerateEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.ACCELERATE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.ACCELERATE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/AmbushEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/AmbushEnchantment.java index fe6dbe53..5c11cd28 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/AmbushEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/AmbushEnchantment.java @@ -24,7 +24,7 @@ public class AmbushEnchantment extends DamageBoostEnchantment { public AmbushEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.AMBUSH)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.AMBUSH).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("ambush"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -36,7 +36,7 @@ public AmbushEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, Equ @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.AMBUSH).mcdw$getMaxLevel(); } @Override @@ -48,14 +48,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.AMBUSH) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.AMBUSH); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.AMBUSH).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.AMBUSH).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.AMBUSH) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.AMBUSH); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.AMBUSH).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.AMBUSH).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/AnimaConduitEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/AnimaConduitEnchantment.java index d6ab85c7..339e1428 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/AnimaConduitEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/AnimaConduitEnchantment.java @@ -22,7 +22,7 @@ public class AnimaConduitEnchantment extends HealingEnchantment { public AnimaConduitEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ANIMA_CONDUIT)){ + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ANIMA_CONDUIT).mcdw$getIsEnabled()){ Registry.register(Registries.ENCHANTMENT, Mcdw.ID("anima_conduit"),this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -33,8 +33,8 @@ public AnimaConduitEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarge } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ANIMA_CONDUIT).mcdw$getMaxLevel(); } @Override @@ -45,14 +45,14 @@ protected boolean canAccept(Enchantment other) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ANIMA_CONDUIT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.ANIMA_CONDUIT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ANIMA_CONDUIT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ANIMA_CONDUIT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ANIMA_CONDUIT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.ANIMA_CONDUIT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ANIMA_CONDUIT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ANIMA_CONDUIT).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/BonusShotEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/BonusShotEnchantment.java index 84cb0014..6c85a9da 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/BonusShotEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/BonusShotEnchantment.java @@ -20,7 +20,7 @@ public class BonusShotEnchantment extends RangedEnchantment { public BonusShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BONUS_SHOT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BONUS_SHOT).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("bonus_shot"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,7 +32,7 @@ public BonusShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BONUS_SHOT).mcdw$getMaxLevel(); } @Override @@ -42,14 +42,14 @@ protected boolean canAccept(Enchantment other) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BONUS_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.BONUS_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BONUS_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BONUS_SHOT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BONUS_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.BONUS_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BONUS_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BONUS_SHOT).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/BurstBowstringEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/BurstBowstringEnchantment.java index ee518fec..d8d30c9d 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/BurstBowstringEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/BurstBowstringEnchantment.java @@ -22,7 +22,7 @@ public class BurstBowstringEnchantment extends RangedEnchantment { public BurstBowstringEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BURST_BOWSTRING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BURST_BOWSTRING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("burst_bowstring"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -34,7 +34,7 @@ public BurstBowstringEnchantment(Rarity rarity, EnchantmentTarget enchantmentTar @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BURST_BOWSTRING).mcdw$getMaxLevel(); } @Override @@ -45,14 +45,14 @@ protected boolean canAccept (Enchantment other) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BURST_BOWSTRING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.BURST_BOWSTRING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BURST_BOWSTRING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BURST_BOWSTRING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BURST_BOWSTRING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.BURST_BOWSTRING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BURST_BOWSTRING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BURST_BOWSTRING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChainReactionEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChainReactionEnchantment.java index a29fea6d..1e7e4dce 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChainReactionEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChainReactionEnchantment.java @@ -22,7 +22,7 @@ public class ChainReactionEnchantment extends RangedEnchantment { public ChainReactionEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHAIN_REACTION)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAIN_REACTION).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("chain_reaction"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,8 +32,8 @@ public ChainReactionEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarg } } - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAIN_REACTION).mcdw$getMaxLevel(); } @Override @@ -44,14 +44,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHAIN_REACTION) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.CHAIN_REACTION); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAIN_REACTION).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAIN_REACTION).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHAIN_REACTION) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.CHAIN_REACTION); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAIN_REACTION).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAIN_REACTION).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChainsEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChainsEnchantment.java index d49a8caa..75d70f17 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChainsEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChainsEnchantment.java @@ -23,7 +23,7 @@ public class ChainsEnchantment extends AOEEnchantment { public ChainsEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHAINS)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAINS).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("chains"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -35,7 +35,7 @@ public ChainsEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, Equ @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAINS).mcdw$getMaxLevel(); } @Override @@ -46,14 +46,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHAINS) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.CHAINS); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAINS).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAINS).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHAINS) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.CHAINS); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAINS).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAINS).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChargeEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChargeEnchantment.java index 5d6b3dd7..661d3b3a 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChargeEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ChargeEnchantment.java @@ -18,7 +18,7 @@ public class ChargeEnchantment extends RangedEnchantment { public ChargeEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHARGE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHARGE).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("charge"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -29,8 +29,8 @@ public ChargeEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, Equ } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHARGE).mcdw$getMaxLevel(); } @Override @@ -41,14 +41,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHARGE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.CHARGE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHARGE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHARGE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHARGE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.CHARGE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHARGE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHARGE).mcdw$getIsAvailableForEnchantedBookOffer(); } } diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/CobwebShotEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/CobwebShotEnchantment.java index 54b5b8da..2c8bebad 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/CobwebShotEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/CobwebShotEnchantment.java @@ -22,7 +22,7 @@ public class CobwebShotEnchantment extends RangedEnchantment { public CobwebShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.COBWEB_SHOT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COBWEB_SHOT).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("cobweb_shot"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,6 +32,11 @@ public CobwebShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } } + @Override + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COBWEB_SHOT).mcdw$getMaxLevel(); + } + @Override protected boolean canAccept (Enchantment other){ return Mcdw.CONFIG.mcdwEnchantmentSettingsConfig.ENABLE_ENCHANTMENT_SETTINGS.get(SettingsID.ENABLE_OP_ENCHANTMENT_MIXING) @@ -40,14 +45,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.COBWEB_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.COBWEB_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COBWEB_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COBWEB_SHOT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.COBWEB_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.COBWEB_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COBWEB_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COBWEB_SHOT).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/CommittedEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/CommittedEnchantment.java index 10f4edf4..5a2ecd2f 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/CommittedEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/CommittedEnchantment.java @@ -23,7 +23,7 @@ public class CommittedEnchantment extends DamageBoostEnchantment { public CommittedEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.COMMITTED)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COMMITTED).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("committed"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -34,8 +34,8 @@ public CommittedEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COMMITTED).mcdw$getMaxLevel(); } @Override @@ -46,14 +46,14 @@ protected boolean canAccept(Enchantment other) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.COMMITTED) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.COMMITTED); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COMMITTED).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COMMITTED).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.COMMITTED) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.COMMITTED); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COMMITTED).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COMMITTED).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/CriticalHitEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/CriticalHitEnchantment.java index c8128a59..41702551 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/CriticalHitEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/CriticalHitEnchantment.java @@ -23,7 +23,7 @@ public class CriticalHitEnchantment extends DamageBoostEnchantment { public CriticalHitEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CRITICAL_HIT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CRITICAL_HIT).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("critical_hit"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -35,7 +35,7 @@ public CriticalHitEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CRITICAL_HIT).mcdw$getMaxLevel(); } @Override @@ -46,14 +46,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CRITICAL_HIT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.CRITICAL_HIT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CRITICAL_HIT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CRITICAL_HIT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CRITICAL_HIT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.CRITICAL_HIT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CRITICAL_HIT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CRITICAL_HIT).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/DippingPoisonEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/DippingPoisonEnchantment.java index a3172d52..dac394a9 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/DippingPoisonEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/DippingPoisonEnchantment.java @@ -21,7 +21,7 @@ public class DippingPoisonEnchantment extends RangedEnchantment { public DippingPoisonEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DIPPING_POISON)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DIPPING_POISON).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("dipping_poison"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -33,7 +33,7 @@ public DippingPoisonEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarg @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DIPPING_POISON).mcdw$getMaxLevel(); } @Override @@ -44,14 +44,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DIPPING_POISON) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.DIPPING_POISON); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DIPPING_POISON).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DIPPING_POISON).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DIPPING_POISON) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.DIPPING_POISON); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DIPPING_POISON).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DIPPING_POISON).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/DynamoEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/DynamoEnchantment.java index c9b6bcf4..2553a799 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/DynamoEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/DynamoEnchantment.java @@ -18,7 +18,7 @@ public class DynamoEnchantment extends DamageBoostEnchantment { public DynamoEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DYNAMO)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DYNAMO).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("dynamo"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -29,7 +29,9 @@ public DynamoEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, Equ } @Override - public int getMaxLevel() { return 3; } + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DYNAMO).mcdw$getMaxLevel(); + } @Override protected boolean canAccept (Enchantment other) { @@ -44,14 +46,14 @@ public boolean isTreasure() { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DYNAMO) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.DYNAMO); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DYNAMO).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DYNAMO).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DYNAMO) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.DYNAMO); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DYNAMO).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DYNAMO).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/EchoEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/EchoEnchantment.java index 4cbabdd6..3c6502d8 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/EchoEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/EchoEnchantment.java @@ -24,7 +24,7 @@ public class EchoEnchantment extends AOEEnchantment { public EchoEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ECHO)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ECHO).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("echo"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -35,8 +35,8 @@ public EchoEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, Equip } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ECHO).mcdw$getMaxLevel(); } @Override @@ -48,14 +48,14 @@ protected boolean canAccept (Enchantment other) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ECHO) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.ECHO); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ECHO).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ECHO).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ECHO) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.ECHO); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ECHO).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ECHO).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/EnigmaResonatorEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/EnigmaResonatorEnchantment.java index adf4f0bf..ecd26656 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/EnigmaResonatorEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/EnigmaResonatorEnchantment.java @@ -21,7 +21,7 @@ public class EnigmaResonatorEnchantment extends DamageBoostEnchantment { public EnigmaResonatorEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ENIGMA_RESONATOR)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ENIGMA_RESONATOR).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("enigma_resonator"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -33,7 +33,7 @@ public EnigmaResonatorEnchantment(Rarity rarity, EnchantmentTarget enchantmentTa @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ENIGMA_RESONATOR).mcdw$getMaxLevel(); } @Override @@ -44,14 +44,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ENIGMA_RESONATOR) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.ENIGMA_RESONATOR); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ENIGMA_RESONATOR).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ENIGMA_RESONATOR).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ENIGMA_RESONATOR) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.ENIGMA_RESONATOR); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ENIGMA_RESONATOR).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ENIGMA_RESONATOR).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ExplodingEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ExplodingEnchantment.java index 8d27f83f..548dc4ed 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ExplodingEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ExplodingEnchantment.java @@ -23,7 +23,7 @@ public class ExplodingEnchantment extends AOEEnchantment { public ExplodingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.EXPLODING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.EXPLODING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("exploding"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -34,8 +34,8 @@ public ExplodingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.EXPLODING).mcdw$getMaxLevel(); } @Override @@ -46,14 +46,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.EXPLODING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.EXPLODING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.EXPLODING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.EXPLODING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.EXPLODING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.EXPLODING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.EXPLODING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.EXPLODING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/FreezingEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/FreezingEnchantment.java index f7b9f364..08bb2d46 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/FreezingEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/FreezingEnchantment.java @@ -21,7 +21,7 @@ public class FreezingEnchantment extends Enchantment{ public FreezingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.FREEZING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FREEZING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("freezing"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -31,8 +31,9 @@ public FreezingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E } } - public int getMaxLevel() { - return 3; + @Override + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FREEZING).mcdw$getMaxLevel(); } @Override @@ -42,14 +43,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.FREEZING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.FREEZING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FREEZING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FREEZING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.FREEZING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.FREEZING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FREEZING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FREEZING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/FuseShotEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/FuseShotEnchantment.java index 6222a9b3..47bca683 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/FuseShotEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/FuseShotEnchantment.java @@ -20,7 +20,7 @@ public class FuseShotEnchantment extends RangedEnchantment { public FuseShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.FUSE_SHOT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FUSE_SHOT).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("fuse_shot"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,7 +32,7 @@ public FuseShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FUSE_SHOT).mcdw$getMaxLevel(); } @Override @@ -43,14 +43,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.FUSE_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.FUSE_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FUSE_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FUSE_SHOT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.FUSE_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.FUSE_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FUSE_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FUSE_SHOT).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/GravityEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/GravityEnchantment.java index 5648bda7..570f53fc 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/GravityEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/GravityEnchantment.java @@ -20,7 +20,7 @@ public class GravityEnchantment extends AOEEnchantment { public GravityEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GRAVITY)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GRAVITY).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("gravity"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,7 +32,7 @@ public GravityEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, Eq @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GRAVITY).mcdw$getMaxLevel(); } @Override @@ -43,14 +43,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GRAVITY) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.GRAVITY); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GRAVITY).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GRAVITY).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GRAVITY) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.GRAVITY); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GRAVITY).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GRAVITY).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/GrowingEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/GrowingEnchantment.java index 9a1559e8..09ef29e7 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/GrowingEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/GrowingEnchantment.java @@ -18,7 +18,7 @@ public class GrowingEnchantment extends RangedEnchantment { public GrowingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GROWING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GROWING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("growing"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -30,19 +30,19 @@ public GrowingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, Eq @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GROWING).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GROWING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.GROWING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GROWING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GROWING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GROWING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.GROWING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GROWING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GROWING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/GuardingStrikeEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/GuardingStrikeEnchantment.java index b65e772a..e66c89e0 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/GuardingStrikeEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/GuardingStrikeEnchantment.java @@ -20,7 +20,7 @@ public class GuardingStrikeEnchantment extends Enchantment { public GuardingStrikeEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GUARDING_STRIKE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GUARDING_STRIKE).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("guarding_strike"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -31,20 +31,20 @@ public GuardingStrikeEnchantment(Rarity rarity, EnchantmentTarget enchantmentTar } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GUARDING_STRIKE).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GUARDING_STRIKE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.GUARDING_STRIKE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GUARDING_STRIKE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GUARDING_STRIKE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GUARDING_STRIKE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.GUARDING_STRIKE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GUARDING_STRIKE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GUARDING_STRIKE).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/IllagersBaneEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/IllagersBaneEnchantment.java index 99df1210..9a18f0e1 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/IllagersBaneEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/IllagersBaneEnchantment.java @@ -22,7 +22,7 @@ public class IllagersBaneEnchantment extends Enchantment { public IllagersBaneEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ILLAGERS_BANE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ILLAGERS_BANE).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("illagers_bane"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -34,7 +34,7 @@ public IllagersBaneEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarge @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ILLAGERS_BANE).mcdw$getMaxLevel(); } @Override @@ -54,14 +54,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ILLAGERS_BANE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.ILLAGERS_BANE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ILLAGERS_BANE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ILLAGERS_BANE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ILLAGERS_BANE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.ILLAGERS_BANE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ILLAGERS_BANE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ILLAGERS_BANE).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/JunglePoisonEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/JunglePoisonEnchantment.java index 0f34abfb..465ae3f0 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/JunglePoisonEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/JunglePoisonEnchantment.java @@ -20,7 +20,7 @@ public class JunglePoisonEnchantment extends Enchantment{ public JunglePoisonEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.POISONING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISONING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("jungle_poison"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -30,20 +30,21 @@ public JunglePoisonEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarge } } - public int getMaxLevel() { - return 3; + @Override + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISONING).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.POISONING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.POISONING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISONING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISONING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.POISONING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.POISONING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISONING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISONING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/LeechingEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/LeechingEnchantment.java index 667d7496..f08e9542 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/LeechingEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/LeechingEnchantment.java @@ -22,7 +22,7 @@ public class LeechingEnchantment extends HealingEnchantment { public LeechingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.LEECHING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEECHING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("leeching"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -33,8 +33,8 @@ public LeechingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEECHING).mcdw$getMaxLevel(); } @Override @@ -45,14 +45,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.LEECHING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.LEECHING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEECHING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEECHING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.LEECHING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.LEECHING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEECHING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEECHING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/LevitationShotEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/LevitationShotEnchantment.java index a594d423..cb9f9f59 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/LevitationShotEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/LevitationShotEnchantment.java @@ -22,7 +22,7 @@ public class LevitationShotEnchantment extends RangedEnchantment { public LevitationShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.LEVITATION_SHOT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEVITATION_SHOT).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("levitation_shot"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -34,7 +34,7 @@ public LevitationShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTar @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEVITATION_SHOT).mcdw$getMaxLevel(); } @Override @@ -45,14 +45,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.LEVITATION_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.LEVITATION_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEVITATION_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEVITATION_SHOT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.LEVITATION_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.LEVITATION_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEVITATION_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEVITATION_SHOT).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/OverchargeEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/OverchargeEnchantment.java index 4ae12ddd..434b0600 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/OverchargeEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/OverchargeEnchantment.java @@ -16,7 +16,7 @@ public class OverchargeEnchantment extends RangedEnchantment { public OverchargeEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.OVERCHARGE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("overcharge"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -28,7 +28,7 @@ public OverchargeEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getMaxLevel(); } @Override @@ -38,14 +38,14 @@ protected boolean canAccept(Enchantment other) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.OVERCHARGE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.OVERCHARGE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.OVERCHARGE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.OVERCHARGE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/PainCycleEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/PainCycleEnchantment.java index f2a8cee8..3bad30aa 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/PainCycleEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/PainCycleEnchantment.java @@ -22,7 +22,7 @@ public class PainCycleEnchantment extends DamageBoostEnchantment { public PainCycleEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PAIN_CYCLE)){ + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PAIN_CYCLE).mcdw$getIsEnabled()){ Registry.register(Registries.ENCHANTMENT, Mcdw.ID("pain_cycle"),this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -33,8 +33,8 @@ public PainCycleEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PAIN_CYCLE).mcdw$getMaxLevel(); } @Override @@ -45,14 +45,14 @@ protected boolean canAccept(Enchantment other) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PAIN_CYCLE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.PAIN_CYCLE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PAIN_CYCLE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PAIN_CYCLE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PAIN_CYCLE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.PAIN_CYCLE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PAIN_CYCLE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PAIN_CYCLE).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/PhantomsMarkEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/PhantomsMarkEnchantment.java index 41d256d2..d987913d 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/PhantomsMarkEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/PhantomsMarkEnchantment.java @@ -19,7 +19,7 @@ public class PhantomsMarkEnchantment extends Enchantment { public PhantomsMarkEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PHANTOMS_MARK)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PHANTOMS_MARK).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("phantoms_mark"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -31,19 +31,19 @@ public PhantomsMarkEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarge @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PHANTOMS_MARK).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PHANTOMS_MARK) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.PHANTOMS_MARK); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PHANTOMS_MARK).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PHANTOMS_MARK).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PHANTOMS_MARK) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.PHANTOMS_MARK); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PHANTOMS_MARK).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PHANTOMS_MARK).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/PoisonCloudEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/PoisonCloudEnchantment.java index 29462da7..23913a57 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/PoisonCloudEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/PoisonCloudEnchantment.java @@ -19,7 +19,7 @@ public class PoisonCloudEnchantment extends AOEEnchantment { public PoisonCloudEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.POISON_CLOUD)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("poison_cloud"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -31,7 +31,7 @@ public PoisonCloudEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getMaxLevel(); } @Override @@ -42,14 +42,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.POISON_CLOUD) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.POISON_CLOUD); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.POISON_CLOUD) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.POISON_CLOUD); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ProspectorEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ProspectorEnchantment.java index cc37f7f5..a5f4ce50 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ProspectorEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ProspectorEnchantment.java @@ -20,7 +20,7 @@ public class ProspectorEnchantment extends Enchantment { public ProspectorEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PROSPECTOR)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PROSPECTOR).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("prospector"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,19 +32,19 @@ public ProspectorEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PROSPECTOR).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PROSPECTOR) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.PROSPECTOR); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PROSPECTOR).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PROSPECTOR).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PROSPECTOR) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.PROSPECTOR); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PROSPECTOR).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PROSPECTOR).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RadianceEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RadianceEnchantment.java index eee09db2..601da2db 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RadianceEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RadianceEnchantment.java @@ -20,7 +20,7 @@ public class RadianceEnchantment extends HealingEnchantment { public RadianceEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RADIANCE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("radiance"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,7 +32,7 @@ public RadianceEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getMaxLevel(); } @Override @@ -43,14 +43,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RADIANCE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.RADIANCE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RADIANCE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.RADIANCE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RampagingEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RampagingEnchantment.java index ca0ae78e..519184a3 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RampagingEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RampagingEnchantment.java @@ -19,7 +19,7 @@ public class RampagingEnchantment extends Enchantment { public RampagingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RAMPAGING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RAMPAGING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("rampaging"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -30,20 +30,20 @@ public RampagingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RAMPAGING).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RAMPAGING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.RAMPAGING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RAMPAGING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RAMPAGING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RAMPAGING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.RAMPAGING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RAMPAGING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RAMPAGING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RefreshmentEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RefreshmentEnchantment.java index 23c22f34..93ecd57a 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RefreshmentEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RefreshmentEnchantment.java @@ -17,7 +17,7 @@ public class RefreshmentEnchantment extends Enchantment{ public RefreshmentEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.REFRESHMENT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REFRESHMENT).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("refreshment"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -28,8 +28,8 @@ public RefreshmentEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REFRESHMENT).mcdw$getMaxLevel(); } @Override @@ -41,13 +41,13 @@ public boolean isAcceptableItem(ItemStack stack) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.REFRESHMENT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.REFRESHMENT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REFRESHMENT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REFRESHMENT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.REFRESHMENT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.REFRESHMENT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REFRESHMENT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REFRESHMENT).mcdw$getIsAvailableForEnchantedBookOffer(); } } diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ReplenishEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ReplenishEnchantment.java index 3b90a43b..9041634b 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ReplenishEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ReplenishEnchantment.java @@ -21,7 +21,7 @@ public class ReplenishEnchantment extends RangedEnchantment { public ReplenishEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.REPLENISH)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REPLENISH).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("replenish"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -33,7 +33,7 @@ public ReplenishEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REPLENISH).mcdw$getMaxLevel(); } @Override @@ -44,14 +44,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.REPLENISH) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.REPLENISH); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REPLENISH).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REPLENISH).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.REPLENISH) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.REPLENISH); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REPLENISH).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REPLENISH).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RicochetEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RicochetEnchantment.java index 502ffaf4..83439aed 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RicochetEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RicochetEnchantment.java @@ -18,7 +18,7 @@ public class RicochetEnchantment extends RangedEnchantment { public RicochetEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RICOCHET)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RICOCHET).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("ricochet"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -30,19 +30,19 @@ public RicochetEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RICOCHET).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RICOCHET) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.RICOCHET); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RICOCHET).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RICOCHET).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RICOCHET) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.RICOCHET); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RICOCHET).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RICOCHET).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RushdownEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RushdownEnchantment.java index 69c1016b..7b757d0f 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/RushdownEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/RushdownEnchantment.java @@ -19,7 +19,7 @@ public class RushdownEnchantment extends Enchantment { public RushdownEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RUSHDOWN)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RUSHDOWN).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("rushdown"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -30,20 +30,20 @@ public RushdownEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RUSHDOWN).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RUSHDOWN) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.RUSHDOWN); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RUSHDOWN).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RUSHDOWN).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RUSHDOWN) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.RUSHDOWN); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RUSHDOWN).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RUSHDOWN).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShadowBarbEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShadowBarbEnchantment.java index 5ea0ec0e..283961ee 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShadowBarbEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShadowBarbEnchantment.java @@ -18,7 +18,7 @@ public class ShadowBarbEnchantment extends RangedEnchantment { public ShadowBarbEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHADOW_BARB)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_BARB).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("shadow_barb"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -28,14 +28,21 @@ public ShadowBarbEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } } + @Override + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_BARB).mcdw$getMaxLevel(); + } + @Override public boolean isAvailableForRandomSelection() { - return false; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_BARB).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_BARB).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return false; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_BARB).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_BARB).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShadowShotEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShadowShotEnchantment.java index 2199a7a4..2fe76db7 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShadowShotEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShadowShotEnchantment.java @@ -18,7 +18,7 @@ public class ShadowShotEnchantment extends RangedEnchantment { public ShadowShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHADOW_SHOT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("shadow_shot"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -28,14 +28,21 @@ public ShadowShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } } + @Override + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getMaxLevel(); + } + @Override public boolean isAvailableForRandomSelection() { - return false; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return false; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SharedPainEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SharedPainEnchantment.java index 63ab5338..a49a7f3e 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SharedPainEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SharedPainEnchantment.java @@ -18,7 +18,7 @@ public class SharedPainEnchantment extends Enchantment { public SharedPainEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHARED_PAIN)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHARED_PAIN).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("shared_pain"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -28,16 +28,21 @@ public SharedPainEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } } + @Override + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHARED_PAIN).mcdw$getMaxLevel(); + } + @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHARED_PAIN) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.SHARED_PAIN); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHARED_PAIN).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHARED_PAIN).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHARED_PAIN) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.SHARED_PAIN); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHARED_PAIN).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHARED_PAIN).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShockwaveEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShockwaveEnchantment.java index b14c0fd2..c6525ae6 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShockwaveEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ShockwaveEnchantment.java @@ -23,7 +23,7 @@ public class ShockwaveEnchantment extends AOEEnchantment { public ShockwaveEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHOCKWAVE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHOCKWAVE).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("shockwave"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -34,8 +34,8 @@ public ShockwaveEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHOCKWAVE).mcdw$getMaxLevel(); } @Override @@ -46,14 +46,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHOCKWAVE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.SHOCKWAVE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHOCKWAVE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHOCKWAVE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHOCKWAVE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.SHOCKWAVE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHOCKWAVE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHOCKWAVE).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SmitingEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SmitingEnchantment.java index 5a8ee9cc..076bcfab 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SmitingEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SmitingEnchantment.java @@ -24,7 +24,7 @@ public class SmitingEnchantment extends AOEEnchantment { public SmitingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SMITING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SMITING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("smiting"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -35,8 +35,8 @@ public SmitingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, Eq } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SMITING).mcdw$getMaxLevel(); } @Override @@ -47,14 +47,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SMITING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.SMITING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SMITING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SMITING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SMITING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.SMITING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SMITING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SMITING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SoulDevourerEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SoulDevourerEnchantment.java index 381d82c2..3e9ce531 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SoulDevourerEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SoulDevourerEnchantment.java @@ -20,7 +20,7 @@ public class SoulDevourerEnchantment extends Enchantment { public SoulDevourerEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SOUL_DEVOURER)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_DEVOURER).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("soul_devourer"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,19 +32,19 @@ public SoulDevourerEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarge @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_DEVOURER).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SOUL_DEVOURER) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.SOUL_DEVOURER); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_DEVOURER).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_DEVOURER).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SOUL_DEVOURER) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.SOUL_DEVOURER); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_DEVOURER).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_DEVOURER).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SoulSiphonEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SoulSiphonEnchantment.java index fda2360e..a924cb6b 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SoulSiphonEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SoulSiphonEnchantment.java @@ -21,7 +21,7 @@ public class SoulSiphonEnchantment extends Enchantment { public SoulSiphonEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SOUL_SIPHON)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_SIPHON).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("soul_siphon"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,8 +32,8 @@ public SoulSiphonEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_SIPHON).mcdw$getMaxLevel(); } @Override @@ -44,14 +44,14 @@ protected boolean canAccept(Enchantment other) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SOUL_SIPHON) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.SOUL_SIPHON); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_SIPHON).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_SIPHON).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SOUL_SIPHON) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.SOUL_SIPHON); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_SIPHON).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_SIPHON).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/StunningEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/StunningEnchantment.java index cbb1c352..f0be46b7 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/StunningEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/StunningEnchantment.java @@ -20,7 +20,7 @@ public class StunningEnchantment extends Enchantment{ public StunningEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.STUNNING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.STUNNING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("stunning"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -30,20 +30,20 @@ public StunningEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E } } - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.STUNNING).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.STUNNING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.STUNNING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.STUNNING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.STUNNING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.STUNNING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.STUNNING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.STUNNING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.STUNNING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SwirlingEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SwirlingEnchantment.java index ddb6d76a..4ce2438e 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/SwirlingEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/SwirlingEnchantment.java @@ -23,7 +23,7 @@ public class SwirlingEnchantment extends AOEEnchantment { public SwirlingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SWIRLING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SWIRLING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("swirling"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -34,8 +34,8 @@ public SwirlingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SWIRLING).mcdw$getMaxLevel(); } @Override @@ -46,14 +46,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SWIRLING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.SWIRLING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SWIRLING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SWIRLING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SWIRLING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.SWIRLING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SWIRLING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SWIRLING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/TempoTheftEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/TempoTheftEnchantment.java index cc451ce1..1a37874f 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/TempoTheftEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/TempoTheftEnchantment.java @@ -20,7 +20,7 @@ public class TempoTheftEnchantment extends RangedEnchantment { public TempoTheftEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.TEMPO_THEFT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.TEMPO_THEFT).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("tempo_theft"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -32,7 +32,7 @@ public TempoTheftEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.TEMPO_THEFT).mcdw$getMaxLevel(); } @Override @@ -43,14 +43,14 @@ protected boolean canAccept (Enchantment other) { @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.TEMPO_THEFT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.TEMPO_THEFT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.TEMPO_THEFT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.TEMPO_THEFT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.TEMPO_THEFT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.TEMPO_THEFT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.TEMPO_THEFT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.TEMPO_THEFT).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ThunderingEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ThunderingEnchantment.java index 76c2e899..d9332117 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/ThunderingEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/ThunderingEnchantment.java @@ -22,7 +22,7 @@ public class ThunderingEnchantment extends AOEEnchantment { public ThunderingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.THUNDERING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.THUNDERING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("thundering"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -34,7 +34,7 @@ public ThunderingEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.THUNDERING).mcdw$getMaxLevel(); } @Override @@ -45,14 +45,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.THUNDERING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.THUNDERING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.THUNDERING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.THUNDERING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.THUNDERING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.THUNDERING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.THUNDERING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.THUNDERING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/VoidShotEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/VoidShotEnchantment.java index 2350adbc..fbbb04f9 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/VoidShotEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/VoidShotEnchantment.java @@ -22,7 +22,7 @@ public class VoidShotEnchantment extends DamageBoostEnchantment { public VoidShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.VOID_SHOT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_SHOT).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("void_shot"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -34,7 +34,7 @@ public VoidShotEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_SHOT).mcdw$getMaxLevel(); } @Override @@ -45,14 +45,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.VOID_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.VOID_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_SHOT).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.VOID_SHOT) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.VOID_SHOT); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_SHOT).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_SHOT).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/VoidStrikeEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/VoidStrikeEnchantment.java index b94b512a..650b4d8d 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/VoidStrikeEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/VoidStrikeEnchantment.java @@ -24,7 +24,7 @@ public class VoidStrikeEnchantment extends DamageBoostEnchantment { public VoidStrikeEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.VOID_STRIKE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_STRIKE).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("void_strike"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -36,7 +36,7 @@ public VoidStrikeEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_STRIKE).mcdw$getMaxLevel(); } @Override @@ -47,14 +47,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.VOID_STRIKE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.VOID_STRIKE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_STRIKE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_STRIKE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.VOID_STRIKE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.VOID_STRIKE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_STRIKE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_STRIKE).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/WeakeningEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/WeakeningEnchantment.java index 625d1e70..6f8a06c2 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/WeakeningEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/WeakeningEnchantment.java @@ -22,7 +22,7 @@ public class WeakeningEnchantment extends AOEEnchantment { public WeakeningEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.WEAKENING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WEAKENING).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("weakening"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -33,8 +33,8 @@ public WeakeningEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, } @Override - public int getMaxLevel() { - return 3; + public int getMaxLevel(){ + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WEAKENING).mcdw$getMaxLevel(); } @Override @@ -45,14 +45,14 @@ protected boolean canAccept (Enchantment other){ @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.WEAKENING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.WEAKENING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WEAKENING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WEAKENING).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.WEAKENING) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.WEAKENING); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WEAKENING).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WEAKENING).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enchants/enchantments/WildRageEnchantment.java b/src/main/java/chronosacaria/mcdw/enchants/enchantments/WildRageEnchantment.java index 515ac4dc..2b74be7c 100644 --- a/src/main/java/chronosacaria/mcdw/enchants/enchantments/WildRageEnchantment.java +++ b/src/main/java/chronosacaria/mcdw/enchants/enchantments/WildRageEnchantment.java @@ -19,7 +19,7 @@ public class WildRageEnchantment extends RangedEnchantment { public WildRageEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, EquipmentSlot[] equipmentSlots) { super(rarity, enchantmentTarget, equipmentSlots); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.WILD_RAGE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WILD_RAGE).mcdw$getIsEnabled()) { Registry.register(Registries.ENCHANTMENT, Mcdw.ID("wild_rage"), this); ItemGroupEvents.modifyEntriesEvent(ItemGroupRegistry.ENCHANTMENTS).register(entries -> { // For loop creates first 3 levels of enchanted books @@ -31,19 +31,19 @@ public WildRageEnchantment(Rarity rarity, EnchantmentTarget enchantmentTarget, E @Override public int getMaxLevel(){ - return 3; + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WILD_RAGE).mcdw$getMaxLevel(); } @Override public boolean isAvailableForRandomSelection() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.WILD_RAGE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_RANDOM_SELECTION.get(EnchantmentsID.WILD_RAGE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WILD_RAGE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WILD_RAGE).mcdw$getIsAvailableForRandomSelection(); } @Override public boolean isAvailableForEnchantedBookOffer() { - return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.WILD_RAGE) - && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_VILLAGER_TRADING.get(EnchantmentsID.WILD_RAGE); + return Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WILD_RAGE).mcdw$getIsEnabled() + && Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WILD_RAGE).mcdw$getIsAvailableForEnchantedBookOffer(); } @Override diff --git a/src/main/java/chronosacaria/mcdw/enums/EnchantStatsID.java b/src/main/java/chronosacaria/mcdw/enums/EnchantStatsID.java deleted file mode 100644 index 2c0c5d19..00000000 --- a/src/main/java/chronosacaria/mcdw/enums/EnchantStatsID.java +++ /dev/null @@ -1,8 +0,0 @@ -package chronosacaria.mcdw.enums; - -public enum EnchantStatsID { - ENIGMA_RESONATOR_DIVISOR, - DYNAMO_STACK_CAP, - HEALING_FACTOR, - ENCHANTMENT_STRENGTH_SLIDER -} \ No newline at end of file diff --git a/src/main/java/chronosacaria/mcdw/enums/EnchantmentsID.java b/src/main/java/chronosacaria/mcdw/enums/EnchantmentsID.java index 5b11d200..8180a0dd 100644 --- a/src/main/java/chronosacaria/mcdw/enums/EnchantmentsID.java +++ b/src/main/java/chronosacaria/mcdw/enums/EnchantmentsID.java @@ -34,7 +34,6 @@ public enum EnchantmentsID { POISON_CLOUD, PROSPECTOR, RADIANCE, - RADIANCE_SHOT, RAMPAGING, REPLENISH, REFRESHMENT, diff --git a/src/main/java/chronosacaria/mcdw/mixin/mcdw/BowItemMixin.java b/src/main/java/chronosacaria/mcdw/mixin/mcdw/BowItemMixin.java index 145aba90..b7d5dcf9 100644 --- a/src/main/java/chronosacaria/mcdw/mixin/mcdw/BowItemMixin.java +++ b/src/main/java/chronosacaria/mcdw/mixin/mcdw/BowItemMixin.java @@ -47,7 +47,7 @@ public void setLivingEntity(LivingEntity livingEntity){ @Inject(method = "onStoppedUsing", at = @At("HEAD")) public void mcdw$onStoppedUsingBow(ItemStack stack, World world, LivingEntity user, int remainingUseTicks, CallbackInfo ci){ - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BONUS_SHOT)){ + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BONUS_SHOT).mcdw$getIsEnabled()){ int bonusShotLevel = EnchantmentHelper.getLevel(EnchantsRegistry.BONUS_SHOT, stack); if (bonusShotLevel > 0){ float damageMultiplier = 0.03F + (bonusShotLevel * 0.07F); @@ -57,7 +57,7 @@ public void setLivingEntity(LivingEntity livingEntity){ } } } - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.MULTI_SHOT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.MULTI_SHOT).mcdw$getIsEnabled()) { int multiShotLevel = EnchantmentHelper.getLevel(Enchantments.MULTISHOT, stack); if (multiShotLevel > 0) { PersistentProjectileEntity projectile = ProjectileEffectHelper.mcdw$createAbstractArrow(user); @@ -179,7 +179,7 @@ public void setLivingEntity(LivingEntity livingEntity){ value /= (mcdwBow.getDrawSpeed() / 20); } - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled()) { int accelerateLevel = EnchantmentHelper.getLevel(EnchantsRegistry.ACCELERATE, bowStack); if (accelerateLevel > 0) { StatusEffectInstance accelerateInstance = livingEntity.getStatusEffect(StatusEffectsRegistry.ACCELERATE); @@ -194,7 +194,7 @@ public void setLivingEntity(LivingEntity livingEntity){ } } - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.OVERCHARGE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsEnabled()) { int overchargeLevel = EnchantmentHelper.getLevel(EnchantsRegistry.OVERCHARGE, bowStack); if (overchargeLevel > 0) { overcharge = Math.min((value / 20) - 1, overchargeLevel); diff --git a/src/main/java/chronosacaria/mcdw/mixin/mcdw/CrossbowItemMixin.java b/src/main/java/chronosacaria/mcdw/mixin/mcdw/CrossbowItemMixin.java index 2eb1557c..ae4e6798 100644 --- a/src/main/java/chronosacaria/mcdw/mixin/mcdw/CrossbowItemMixin.java +++ b/src/main/java/chronosacaria/mcdw/mixin/mcdw/CrossbowItemMixin.java @@ -127,11 +127,12 @@ public class CrossbowItemMixin { ((IMcdwEnchantedArrow)ppe).mcdw$setWildRageLevel(wildRageLevel); } - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BONUS_SHOT)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BONUS_SHOT).mcdw$getIsEnabled()) { int bonusShotLevel = EnchantmentHelper.getLevel(EnchantsRegistry.BONUS_SHOT, crossbow); if (bonusShotLevel > 0) { float damageMultiplier = 0.1F + ((bonusShotLevel - 1) * 0.07F); + @SuppressWarnings("unused") float arrowVelocity = RangedAttackHelper.getVanillaOrModdedCrossbowArrowVelocity(crossbow); ProjectileEffectHelper.mcdw$spawnExtraArrows(user, user, 1, 10, damageMultiplier); } @@ -148,7 +149,7 @@ public class CrossbowItemMixin { private int mcdw$acceleratedPullProgress(int useTicks) { ItemStack crossbowStack = livingEntity.getActiveItem(); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled()) { int accelerateLevel = EnchantmentHelper.getLevel(EnchantsRegistry.ACCELERATE, crossbowStack); if (accelerateLevel > 0) { StatusEffectInstance accelerateInstance = livingEntity.getStatusEffect(StatusEffectsRegistry.ACCELERATE); diff --git a/src/main/java/chronosacaria/mcdw/mixin/mcdw/ExperienceOrbEntityMixin.java b/src/main/java/chronosacaria/mcdw/mixin/mcdw/ExperienceOrbEntityMixin.java index 429a4b98..4882d9a0 100644 --- a/src/main/java/chronosacaria/mcdw/mixin/mcdw/ExperienceOrbEntityMixin.java +++ b/src/main/java/chronosacaria/mcdw/mixin/mcdw/ExperienceOrbEntityMixin.java @@ -35,7 +35,7 @@ public class ExperienceOrbEntityMixin { mcdw$setPlayerEntity(playerEntity); int amount = args.get(1); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SOUL_DEVOURER)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_DEVOURER).mcdw$getIsEnabled()) amount = EnchantmentEffects.soulDevourerExperience(playerEntity, amount); args.set(1, amount); @@ -47,7 +47,7 @@ public class ExperienceOrbEntityMixin { PlayerEntity playerEntity = mcdw$getPlayerEntity(); boolean isOffHandAttack = playerEntity.getRecentDamageSource() instanceof OffHandDamageSource; - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ANIMA_CONDUIT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ANIMA_CONDUIT).mcdw$getIsEnabled()) return EnchantmentEffects.animaConduitExperience(playerEntity, experience, isOffHandAttack); return experience; } diff --git a/src/main/java/chronosacaria/mcdw/mixin/mcdw/LivingEntityMixin.java b/src/main/java/chronosacaria/mcdw/mixin/mcdw/LivingEntityMixin.java index a29ecddd..574582c4 100644 --- a/src/main/java/chronosacaria/mcdw/mixin/mcdw/LivingEntityMixin.java +++ b/src/main/java/chronosacaria/mcdw/mixin/mcdw/LivingEntityMixin.java @@ -44,6 +44,7 @@ import java.util.Comparator; import java.util.List; +@SuppressWarnings("ConstantValue") @Mixin(LivingEntity.class) public abstract class LivingEntityMixin extends Entity { @Unique @@ -60,7 +61,7 @@ public LivingEntityMixin(EntityType type, World world) { return amount; if (amount > 0) { - float storedAmount = amount * Mcdw.CONFIG.mcdwEnchantmentSettingsConfig.directDamageEnchantmentMultiplier; + float storedAmount = amount * Mcdw.CONFIG.mcdwEnchantmentsConfig.directDamageEnchantmentMultiplier; if (attackingEntity instanceof TameableEntity petSource && petSource.getWorld() instanceof ServerWorld serverWorld && petSource.getOwner() instanceof PlayerEntity owner) { @@ -79,15 +80,15 @@ public LivingEntityMixin(EntityType type, World world) { if (source.getAttacker() instanceof LivingEntity attackingEntity) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PROSPECTOR)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PROSPECTOR).mcdw$getIsEnabled()) EnchantmentEffects.applyProspector(attackingEntity, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RUSHDOWN)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RUSHDOWN).mcdw$getIsEnabled()) EnchantmentEffects.applyRushdown(attackingEntity, isOffHandAttack); } if (source.getAttacker() instanceof PlayerEntity attackingPlayer) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SOUL_SIPHON)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_SIPHON).mcdw$getIsEnabled()) EnchantmentEffects.applySoulSiphon(attackingPlayer, isOffHandAttack); } } @@ -106,7 +107,7 @@ public LivingEntityMixin(EntityType type, World world) { ItemStack mainHandStack = user.getMainHandStack(); ItemStack offHandStack = user.getOffHandStack(); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SMITING)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SMITING).mcdw$getIsEnabled()) { mcdw$applySmite(amount, user, target, mainHandStack); mcdw$applySmite(amount, user, target, offHandStack); } @@ -137,7 +138,7 @@ public LivingEntityMixin(EntityType type, World world) { if(!(attacker instanceof PlayerEntity attackingPlayer)) return; - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BUZZY_BEE) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BUZZY_BEE).mcdw$getIsEnabled() && ((IBeeSummoning)attackingPlayer).isReadyForBeeSummon(attackingPlayer.age)) { ItemStack mainHandStack = attackingPlayer.getMainHandStack(); ItemStack offHandStack = attackingPlayer.getOffHandStack(); @@ -160,7 +161,7 @@ public LivingEntityMixin(EntityType type, World world) { ItemStack poisonTippedArrow = PotionUtil.setPotion(new ItemStack(Items.TIPPED_ARROW, 8), Potions.POISON); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DIPPING_POISON)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DIPPING_POISON).mcdw$getIsEnabled()) { if (user.getOffHandStack() != null && (EnchantmentHelper.getLevel(EnchantsRegistry.DIPPING_POISON, user.getOffHandStack()) > 0)) { int level = EnchantmentHelper.getLevel(EnchantsRegistry.DIPPING_POISON, user.getOffHandStack()); if (level > 0) { @@ -180,9 +181,9 @@ public LivingEntityMixin(EntityType type, World world) { return; if (playerEntity != null) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.BURST_BOWSTRING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.BURST_BOWSTRING).mcdw$getIsEnabled()) EnchantmentEffects.activateBurstBowstringOnJump(playerEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DYNAMO)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DYNAMO).mcdw$getIsEnabled()) EnchantmentEffects.handleAddDynamoEffect(playerEntity); } } @@ -192,7 +193,7 @@ public LivingEntityMixin(EntityType type, World world) { if (source.getSource() instanceof PlayerEntity player) { int sharedPainLevel = EnchantmentEffects.mcdw$getEnchantmentLevel(EnchantsRegistry.SHARED_PAIN, player, false); if (sharedPainLevel <= 0) return; - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHARED_PAIN)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHARED_PAIN).mcdw$getIsEnabled()) { if ((Object) this instanceof LivingEntity target) { float targetHealth = target.getHealth() - amount; if (targetHealth < 0) { diff --git a/src/main/java/chronosacaria/mcdw/mixin/mcdw/LivingEntityPlayerEntityMixin.java b/src/main/java/chronosacaria/mcdw/mixin/mcdw/LivingEntityPlayerEntityMixin.java index 8fff6d65..0da98efe 100644 --- a/src/main/java/chronosacaria/mcdw/mixin/mcdw/LivingEntityPlayerEntityMixin.java +++ b/src/main/java/chronosacaria/mcdw/mixin/mcdw/LivingEntityPlayerEntityMixin.java @@ -30,46 +30,46 @@ public class LivingEntityPlayerEntityMixin { if (amount > 0) { - float storedAmount = amount * Mcdw.CONFIG.mcdwEnchantmentSettingsConfig.directDamageEnchantmentMultiplier; + float storedAmount = amount * Mcdw.CONFIG.mcdwEnchantmentsConfig.directDamageEnchantmentMultiplier; if (source.getSource() instanceof LivingEntity) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.AMBUSH)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.AMBUSH).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.ambushDamage(attackingEntity, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CRITICAL_HIT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CRITICAL_HIT).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.criticalHitDamage(attackingEntity, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.VOID_STRIKE)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_STRIKE).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.voidStrikeDamage(attackingEntity, victim, isOffHandAttack); if (!PlayerAttackHelper.mcdw$isLikelyNotMeleeDamage(source)) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PAIN_CYCLE)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PAIN_CYCLE).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.painCycleDamage(attackingEntity, isOffHandAttack); } } if (source.getSource() instanceof PlayerEntity attackingPlayer) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ENIGMA_RESONATOR)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ENIGMA_RESONATOR).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.enigmaResonatorDamage(attackingPlayer, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DYNAMO)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DYNAMO).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.dynamoDamage(attackingEntity, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHADOW_SHOT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.shadowFormDamage(attackingEntity); } if (source.getSource() instanceof PersistentProjectileEntity ppe) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ENIGMA_RESONATOR)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ENIGMA_RESONATOR).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.enigmaShotDamage(attackingEntity, victim, ppe); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GROWING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GROWING).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.growingDamage(attackingEntity, victim, ppe); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.VOID_SHOT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.VOID_SHOT).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.voidShotDamage(victim, ppe); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.DYNAMO)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.DYNAMO).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.dynamoShotDamage(attackingEntity, ppe); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHADOW_SHOT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.shadowFormShotDamage(attackingEntity, ppe); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.OVERCHARGE)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsEnabled()) amount += storedAmount * EnchantmentEffects.overchargeDamage(ppe); } - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.COMMITTED)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COMMITTED).mcdw$getIsEnabled()) amount += EnchantmentEffects.committedDamage(attackingEntity, victim, isOffHandAttack); } @@ -89,29 +89,29 @@ public class LivingEntityPlayerEntityMixin { if (source.getSource() instanceof LivingEntity) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.FREEZING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FREEZING).mcdw$getIsEnabled()) EnchantmentEffects.applyFreezing(attackingEntity, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.POISONING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISONING).mcdw$getIsEnabled()) EnchantmentEffects.applyPoisoning(attackingEntity, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.POISON_CLOUD)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getIsEnabled()) EnchantmentEffects.applyPoisonCloud(attackingEntity, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RADIANCE)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getIsEnabled()) EnchantmentEffects.applyRadianceCloud(attackingEntity, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHOCKWAVE)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHOCKWAVE).mcdw$getIsEnabled()) EnchantmentEffects.applyShockwave(attackingEntity, victim, amount, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.STUNNING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.STUNNING).mcdw$getIsEnabled()) EnchantmentEffects.applyStunning(attackingEntity, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SWIRLING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SWIRLING).mcdw$getIsEnabled()) EnchantmentEffects.applySwirling(attackingEntity, victim, amount, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.THUNDERING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.THUNDERING).mcdw$getIsEnabled()) EnchantmentEffects.applyThundering(attackingEntity, amount, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.WEAKENING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WEAKENING).mcdw$getIsEnabled()) EnchantmentEffects.applyWeakeningCloud(attackingEntity, victim, isOffHandAttack); if (!source.isOf(DamageTypes.ARROW)) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHAINS)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAINS).mcdw$getIsEnabled()) EnchantmentEffects.applyChains(attackingEntity, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GRAVITY)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GRAVITY).mcdw$getIsEnabled()) EnchantmentEffects.applyGravity(attackingEntity, victim, isOffHandAttack); } } @@ -130,7 +130,7 @@ public class LivingEntityPlayerEntityMixin { if (amount > 0) { if (source.getSource() instanceof LivingEntity) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ECHO)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ECHO).mcdw$getIsEnabled()) EnchantmentEffects.echoDamage(attackingEntity, victim, amount, isOffHandAttack); } } @@ -144,15 +144,15 @@ public class LivingEntityPlayerEntityMixin { LivingEntity victim = (LivingEntity) (Object) this; if (source.getSource() instanceof LivingEntity) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.EXPLODING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.EXPLODING).mcdw$getIsEnabled()) EnchantmentEffects.explodingDamage(attackingEntity, victim, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RAMPAGING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RAMPAGING).mcdw$getIsEnabled()) EnchantmentEffects.applyRampaging(attackingEntity, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.LEECHING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEECHING).mcdw$getIsEnabled()) EnchantmentEffects.applyLeeching(attackingEntity, victim, isOffHandAttack); if (!PlayerAttackHelper.mcdw$isLikelyNotMeleeDamage(source)) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GUARDING_STRIKE)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GUARDING_STRIKE).mcdw$getIsEnabled()) EnchantmentEffects.applyGuardingStrike(attackingEntity, isOffHandAttack); } } @@ -161,14 +161,14 @@ public class LivingEntityPlayerEntityMixin { if (source.getAttacker() instanceof PlayerEntity attackingEntity) { if (source.getSource() instanceof LivingEntity) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.REFRESHMENT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REFRESHMENT).mcdw$getIsEnabled()) EnchantmentEffects.applyRefreshment(attackingEntity, isOffHandAttack); } if (source.getSource() instanceof PersistentProjectileEntity ppe) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.REFRESHMENT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REFRESHMENT).mcdw$getIsEnabled()) EnchantmentEffects.applyRefreshment(attackingEntity, isOffHandAttack); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SHADOW_SHOT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SHADOW_SHOT).mcdw$getIsEnabled()) EnchantmentEffects.applyShadowShotShadowForm(attackingEntity, ppe, 80); } } diff --git a/src/main/java/chronosacaria/mcdw/mixin/mcdw/PersistentProjectileEntityMixin.java b/src/main/java/chronosacaria/mcdw/mixin/mcdw/PersistentProjectileEntityMixin.java index 70822d28..bb2504fe 100644 --- a/src/main/java/chronosacaria/mcdw/mixin/mcdw/PersistentProjectileEntityMixin.java +++ b/src/main/java/chronosacaria/mcdw/mixin/mcdw/PersistentProjectileEntityMixin.java @@ -328,31 +328,31 @@ public abstract class PersistentProjectileEntityMixin implements IMcdwEnchantedA PersistentProjectileEntity persProjEntity = (PersistentProjectileEntity) (Object) this; if (persProjEntity.getOwner() instanceof LivingEntity shooter) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHAIN_REACTION)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHAIN_REACTION).mcdw$getIsEnabled()) EnchantmentEffects.applyChainReaction(shooter, target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.CHARGE)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.CHARGE).mcdw$getIsEnabled()) EnchantmentEffects.applyCharge(shooter, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.COBWEB_SHOT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COBWEB_SHOT).mcdw$getIsEnabled()) EnchantmentEffects.applyCobwebShotEntity(target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.FUSE_SHOT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.FUSE_SHOT).mcdw$getIsEnabled()) EnchantmentEffects.applyFuseShot(shooter, target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.GRAVITY)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.GRAVITY).mcdw$getIsEnabled()) EnchantmentEffects.applyGravityShot(shooter, target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.LEVITATION_SHOT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.LEVITATION_SHOT).mcdw$getIsEnabled()) EnchantmentEffects.applyLevitationShot(target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.PHANTOMS_MARK)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.PHANTOMS_MARK).mcdw$getIsEnabled()) EnchantmentEffects.applyPhantomsMark(target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.POISON_CLOUD)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.POISON_CLOUD).mcdw$getIsEnabled()) EnchantmentEffects.applyPoisonCloudShot(shooter, target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RADIANCE)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getIsEnabled()) EnchantmentEffects.applyRadianceShot(shooter, target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RICOCHET)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RICOCHET).mcdw$getIsEnabled()) EnchantmentEffects.applyRicochet(shooter, target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.TEMPO_THEFT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.TEMPO_THEFT).mcdw$getIsEnabled()) EnchantmentEffects.applyTempoTheft(shooter, target, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.THUNDERING)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.THUNDERING).mcdw$getIsEnabled()) EnchantmentEffects.applyThunderingShot(shooter, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.WILD_RAGE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.WILD_RAGE).mcdw$getIsEnabled()) { if (!(target instanceof EnderDragonEntity || target instanceof WardenEntity) && target instanceof MobEntity) { EnchantmentEffects.applyWildRage((MobEntity) target, persProjEntity); } @@ -361,7 +361,7 @@ public abstract class PersistentProjectileEntityMixin implements IMcdwEnchantedA if (persProjEntity.getOwner() instanceof PlayerEntity shooter) { - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.REPLENISH)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.REPLENISH).mcdw$getIsEnabled()) EnchantmentEffects.applyReplenish(shooter, persProjEntity); } } @@ -372,9 +372,9 @@ public abstract class PersistentProjectileEntityMixin implements IMcdwEnchantedA if (!(persProjEntity.getOwner() instanceof LivingEntity shooter)) return; - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.COBWEB_SHOT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.COBWEB_SHOT).mcdw$getIsEnabled()) EnchantmentEffects.applyCobwebShotBlock(blockHitResult, persProjEntity); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.RADIANCE_SHOT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.RADIANCE).mcdw$getIsEnabled()) EnchantmentEffects.applyRadianceShotBlock(blockHitResult, shooter, persProjEntity); } diff --git a/src/main/java/chronosacaria/mcdw/mixin/mcdw/client/ModelPredicateProviderRegistryMixin.java b/src/main/java/chronosacaria/mcdw/mixin/mcdw/client/ModelPredicateProviderRegistryMixin.java index 83c2ae67..1281358c 100644 --- a/src/main/java/chronosacaria/mcdw/mixin/mcdw/client/ModelPredicateProviderRegistryMixin.java +++ b/src/main/java/chronosacaria/mcdw/mixin/mcdw/client/ModelPredicateProviderRegistryMixin.java @@ -19,6 +19,7 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +@SuppressWarnings("InjectCouldBeOverwrite") @Environment(EnvType.CLIENT) @Mixin(ModelPredicateProviderRegistry.class) public class ModelPredicateProviderRegistryMixin { @@ -32,7 +33,7 @@ public class ModelPredicateProviderRegistryMixin { cir.setReturnValue(0.0F); } else { int useTicks = stack.getMaxUseTime() - entity.getItemUseTimeLeft(); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled()) { int accelerateLevel = EnchantmentHelper.getLevel(EnchantsRegistry.ACCELERATE, stack); if (accelerateLevel > 0) { StatusEffectInstance accelerateInstance = entity.getStatusEffect(StatusEffectsRegistry.ACCELERATE); @@ -40,7 +41,7 @@ public class ModelPredicateProviderRegistryMixin { useTicks = (int) (useTicks * (1f + (MathHelper.clamp(consecutiveShots * (6.0f + 2.0f * accelerateLevel), 0f, 100f) / 100f))); } } - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.OVERCHARGE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.OVERCHARGE).mcdw$getIsEnabled()) { int overchargeLevel = EnchantmentHelper.getLevel(EnchantsRegistry.OVERCHARGE, stack); if (overchargeLevel > 0) { int overcharge = Math.min((useTicks / 20) - 1, overchargeLevel); @@ -61,7 +62,7 @@ public class ModelPredicateProviderRegistryMixin { cir.setReturnValue(0.0F); } else { int useTicks = stack.getMaxUseTime() - entity.getItemUseTimeLeft(); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ACCELERATE)) { + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ACCELERATE).mcdw$getIsEnabled()) { int accelerateLevel = EnchantmentHelper.getLevel(EnchantsRegistry.ACCELERATE, stack); if (accelerateLevel > 0) { StatusEffectInstance accelerateInstance = entity.getStatusEffect(StatusEffectsRegistry.ACCELERATE); diff --git a/src/main/java/chronosacaria/mcdw/registries/CompatRegistry.java b/src/main/java/chronosacaria/mcdw/registries/CompatRegistry.java index 748f9202..13b14934 100644 --- a/src/main/java/chronosacaria/mcdw/registries/CompatRegistry.java +++ b/src/main/java/chronosacaria/mcdw/registries/CompatRegistry.java @@ -16,10 +16,10 @@ public static void register() { PlayerEntity playerEntity = event.getPlayer(); boolean isOffHandAttack = playerEntity.getRecentDamageSource() instanceof OffHandDamageSource; - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.SOUL_DEVOURER)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.SOUL_DEVOURER).mcdw$getIsEnabled()) amount = EnchantmentEffects.soulDevourerExperience(playerEntity, amount); - if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENABLE_ENCHANTMENTS.get(EnchantmentsID.ANIMA_CONDUIT)) + if (Mcdw.CONFIG.mcdwEnchantmentsConfig.ENCHANTMENT_CONFIG.get(EnchantmentsID.ANIMA_CONDUIT).mcdw$getIsEnabled()) amount = EnchantmentEffects.animaConduitExperience(playerEntity, amount, isOffHandAttack); event.setValue(amount);