Improved reaper

This commit is contained in:
Auxilor 2021-03-04 18:16:30 +00:00
parent eb87c1dc06
commit dd9181f615
4 changed files with 16 additions and 12 deletions

View File

@ -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;

View File

@ -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.
}

View File

@ -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;

View File

@ -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