Merge pull request #85

Fix REAPER
This commit is contained in:
Will FP 2021-10-06 10:42:53 +01:00 committed by GitHub
commit 2cc9579e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,7 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.jetbrains.annotations.NotNull;
import org.bukkit.entity.Arrow;
import java.util.ArrayList;
import java.util.List;
@ -46,13 +47,15 @@ public class Soulbound extends EcoEnchant {
return;
}
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()))) {
if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, reaperLevel)) {
return;
if (!(event.getEntity() instanceof Arrow)) {
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()))) {
if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, reaperLevel)) {
return;
}
}
}
}