mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-01-26 01:01:22 +01:00
Fixed two minor bugs
This commit is contained in:
parent
4dc04eb2f4
commit
9b3763bb1f
@ -28,6 +28,8 @@ public class Parasitic extends EcoEnchant {
|
|||||||
if (newHealth > attacker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) {
|
if (newHealth > attacker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) {
|
||||||
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.bukkit.entity.Arrow;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -42,18 +43,19 @@ public class Soulbound extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.getKiller() != null) {
|
if (!(event.getEntity() instanceof Arrow)) {
|
||||||
Player killer = player.getKiller();
|
if (player.getKiller() != null) {
|
||||||
int reaperLevel = EnchantChecks.getMainhandLevel(killer, EcoEnchants.REAPER);
|
Player killer = player.getKiller();
|
||||||
if (reaperLevel > 0) {
|
int reaperLevel = EnchantChecks.getMainhandLevel(killer, EcoEnchants.REAPER);
|
||||||
if (!(EcoEnchants.REAPER.getDisabledWorlds().contains(killer.getWorld()))) {
|
if (reaperLevel > 0) {
|
||||||
if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, reaperLevel)) {
|
if (!(EcoEnchants.REAPER.getDisabledWorlds().contains(killer.getWorld()))) {
|
||||||
return;
|
if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, reaperLevel)) {
|
||||||
}
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for (ItemStack itemStack : player.getInventory().getContents()) {
|
for (ItemStack itemStack : player.getInventory().getContents()) {
|
||||||
if (itemStack == null) {
|
if (itemStack == null) {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user