diff --git a/patches/api/0004-Profile-switching.patch b/patches/api/0004-Profile-switching.patch index 887c4e1..ae8ced4 100644 --- a/patches/api/0004-Profile-switching.patch +++ b/patches/api/0004-Profile-switching.patch @@ -751,7 +751,7 @@ index 148c4aad384ae8e3b8b22d264a84bddfbcafdf1e..90a5f69d513833f116715f2f546593f9 this.damagerState = damagerState; } diff --git a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java -index 8ea4be529400b34df3d31b0f17c2d145345523d9..e9a87df62a86ee6ba3f2cabf702df25121b84ae1 100644 +index 8ea4be529400b34df3d31b0f17c2d145345523d9..d6faa1a1d571c6fa93ca99e0a789ba289c77579e 100644 --- a/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java +++ b/src/main/java/org/bukkit/event/entity/EntityDamageByEntityEvent.java @@ -2,8 +2,11 @@ package org.bukkit.event.entity; @@ -766,15 +766,16 @@ index 8ea4be529400b34df3d31b0f17c2d145345523d9..e9a87df62a86ee6ba3f2cabf702df251 import org.bukkit.entity.Entity; import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.NotNull; -@@ -27,24 +30,30 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent { +@@ -27,24 +30,31 @@ public class EntityDamageByEntityEvent extends EntityDamageEvent { this.critical = false; // Paper - add critical damage API } - @Deprecated(forRemoval = true) -+ public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage, DamageType type) { ++ public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, final double damage, PDamageType type) { + super(damagee, cause, damage); + this.damager = damager; + this.critical = false; // Paper - add critical damage API ++ this.pDamageType = type; + } + public EntityDamageByEntityEvent(@NotNull final Entity damager, @NotNull final Entity damagee, @NotNull final DamageCause cause, @NotNull final Map modifiers, @NotNull final Map> modifierFunctions) { diff --git a/patches/server/0004-Spellbook.patch b/patches/server/0004-Spellbook.patch index 102f40e..63898a9 100644 --- a/patches/server/0004-Spellbook.patch +++ b/patches/server/0004-Spellbook.patch @@ -938,7 +938,7 @@ index cb61462d4691a055a4b25f7b953609d8a154fdfe..73ccb55889de521c65c76c7e15bbd6d1 float f = this.spawnDimensionsScale * this.getWidth() / 2.0F; float f1 = this.spawnDimensionsScale * this.getHeight(); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index ccd9dff20a60f019e0c320acfb526b8bf3e5f806..76922d68702b6299fb2006dfd896d17faea1b05c 100644 +index ccd9dff20a60f019e0c320acfb526b8bf3e5f806..f582f93b3022ced29bbd08b63ce041df10d2a58b 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -11,6 +11,9 @@ import com.mojang.datafixers.util.Pair; @@ -1084,7 +1084,7 @@ index ccd9dff20a60f019e0c320acfb526b8bf3e5f806..76922d68702b6299fb2006dfd896d17f + resistance = resistance - living.getAttributeValue(type.pen); // Remove the value of the attackers penetration attribute from the victims resistance + } + finalDmg = amount - resistance; -+ EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(getBukkitEntity(), attacker.getBukkitEntity(), EntityDamageEvent.DamageCause.ENTITY_ATTACK, finalDmg); // TODO: Add type back ++ EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(attacker.getBukkitEntity(), getBukkitEntity(), EntityDamageEvent.DamageCause.ENTITY_ATTACK, finalDmg, type.apiType); // TODO: Add type back + Bukkit.getServer().getPluginManager().callEvent(event); + if (event.isCancelled()) { + return false;