Merge pull request #47

Fixed two minor bugs
This commit is contained in:
Auxilor 2021-06-10 20:32:54 +01:00 committed by GitHub
commit c0f240d254
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 13 deletions

View File

@ -28,6 +28,8 @@ public class Parasitic extends EcoEnchant {
if (newHealth > attacker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) {
newHealth = attacker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue();
}
attacker.setHealth(newHealth);
if (attacker.getHealth() > 0) {
attacker.setHealth(newHealth);
}
}
}

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;
@ -42,18 +43,19 @@ 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;
}
}
}
}
}
for (ItemStack itemStack : player.getInventory().getContents()) {
if (itemStack == null) {
continue;