mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
parent
a934251dce
commit
1adec8c753
@ -28,8 +28,6 @@ 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();
|
||||||
}
|
}
|
||||||
if (attacker.getHealth() > 0) {
|
attacker.setHealth(newHealth);
|
||||||
attacker.setHealth(newHealth);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ 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;
|
||||||
@ -43,19 +42,18 @@ public class Soulbound extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(event.getEntity() instanceof Arrow)) {
|
if (player.getKiller() != null) {
|
||||||
if (player.getKiller() != null) {
|
Player killer = player.getKiller();
|
||||||
Player killer = player.getKiller();
|
int reaperLevel = EnchantChecks.getMainhandLevel(killer, EcoEnchants.REAPER);
|
||||||
int reaperLevel = EnchantChecks.getMainhandLevel(killer, EcoEnchants.REAPER);
|
if (reaperLevel > 0) {
|
||||||
if (reaperLevel > 0) {
|
if (!(EcoEnchants.REAPER.getDisabledWorlds().contains(killer.getWorld()))) {
|
||||||
if (!(EcoEnchants.REAPER.getDisabledWorlds().contains(killer.getWorld()))) {
|
if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, reaperLevel)) {
|
||||||
if (EnchantmentUtils.passedChance(EcoEnchants.REAPER, reaperLevel)) {
|
return;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ItemStack itemStack : player.getInventory().getContents()) {
|
for (ItemStack itemStack : player.getInventory().getContents()) {
|
||||||
if (itemStack == null) {
|
if (itemStack == null) {
|
||||||
continue;
|
continue;
|
||||||
@ -66,7 +64,7 @@ public class Soulbound extends EcoEnchant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "on-books")) {
|
if (this.getConfig().getBool(EcoEnchants.CONFIG_LOCATION + "on-books")) {
|
||||||
if (itemStack.getItemMeta() instanceof EnchantmentStorageMeta && (((EnchantmentStorageMeta) itemStack.getItemMeta()).getStoredEnchants().containsKey(this))) {
|
if (itemStack.getItemMeta() instanceof EnchantmentStorageMeta && (((EnchantmentStorageMeta) itemStack.getItemMeta()).getStoredEnchants().containsKey(this.getEnchantment()))) {
|
||||||
soulboundItems.add(itemStack);
|
soulboundItems.add(itemStack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user