diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java index 4e0eaa01..d43e25b1 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/EcoEnchants.java @@ -223,7 +223,7 @@ import com.willfp.ecoenchants.enchantments.ecoenchants.special.Pentashot; import com.willfp.ecoenchants.enchantments.ecoenchants.special.Preservation; import com.willfp.ecoenchants.enchantments.ecoenchants.special.Prosperity; import com.willfp.ecoenchants.enchantments.ecoenchants.special.Razor; -import com.willfp.ecoenchants.enchantments.ecoenchants.special.Reaper; +import com.willfp.ecoenchants.enchantments.ecoenchants.normal.Reaper; import com.willfp.ecoenchants.enchantments.ecoenchants.special.Repairing; import com.willfp.ecoenchants.enchantments.ecoenchants.special.Soulbound; import com.willfp.ecoenchants.enchantments.ecoenchants.special.Spring; diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Reaper.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reaper.java similarity index 59% rename from eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Reaper.java rename to eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reaper.java index 42c38cee..52abe244 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Reaper.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Reaper.java @@ -1,4 +1,4 @@ -package com.willfp.ecoenchants.enchantments.ecoenchants.special; +package com.willfp.ecoenchants.enchantments.ecoenchants.normal; import com.willfp.ecoenchants.enchantments.EcoEnchant; import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; @@ -6,7 +6,9 @@ import com.willfp.ecoenchants.enchantments.meta.EnchantmentType; public class Reaper extends EcoEnchant { public Reaper() { super( - "reaper", EnchantmentType.SPECIAL + "reaper", EnchantmentType.NORMAL ); } + + // Actual code is in soulbound. } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java index b4c01aa9..a5dfbec3 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/special/Soulbound.java @@ -42,17 +42,18 @@ public class Soulbound extends EcoEnchant { return; } - if (player.getKiller() instanceof Player) { - Player killer = (Player) player.getKiller(); - if (EnchantChecks.mainhand(killer, EcoEnchants.REAPER)) { + if (player.getKiller() != null) { + Player killer = player.getKiller(); + int reaperLevel = EnchantChecks.getMainhandLevel(killer, EcoEnchants.REAPER); + if (reaperLevel > 0) { if (!(EcoEnchants.REAPER.getDisabledWorlds().contains(killer.getWorld()))) { - int points = EnchantChecks.getMainhandLevel(killer, EcoEnchants.REAPER); - if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, points)) { + if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, reaperLevel)) { return; } } } } + for (ItemStack itemStack : player.getInventory().getContents()) { if (itemStack == null) { continue; diff --git a/eco-core/core-plugin/src/main/resources/enchants/special/reaper.yml b/eco-core/core-plugin/src/main/resources/enchants/normal/reaper.yml similarity index 64% rename from eco-core/core-plugin/src/main/resources/enchants/special/reaper.yml rename to eco-core/core-plugin/src/main/resources/enchants/normal/reaper.yml index 4df1549a..085a0511 100644 --- a/eco-core/core-plugin/src/main/resources/enchants/special/reaper.yml +++ b/eco-core/core-plugin/src/main/resources/enchants/normal/reaper.yml @@ -3,22 +3,23 @@ # name: "Reaper" -description: Gives you a chance to knock out things with a soulbound. +description: Chance to prevent your opponents soulbound from working. enabled: true obtaining: table: true villager: false loot: false - rarity: veryspecial + rarity: legendary general-config: targets: - - hoe + - sword + - axe grindstoneable: true disabled-in-worlds: [] conflicts: [] - maximum-level: 5 + maximum-level: 3 config: chance-per-level: 2