mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-01 12:42:05 -07:00
Fixs and Improvements for EndermanEscapeEvent (#12570)
This commit is contained in:
@@ -56,7 +56,20 @@
|
||||
this.setTarget(null);
|
||||
this.teleport();
|
||||
}
|
||||
@@ -369,11 +_,13 @@
|
||||
@@ -359,21 +_,25 @@
|
||||
AbstractThrownPotion abstractThrownPotion1 = damageSource.getDirectEntity() instanceof AbstractThrownPotion abstractThrownPotion
|
||||
? abstractThrownPotion
|
||||
: null;
|
||||
- if (!damageSource.is(DamageTypeTags.IS_PROJECTILE) && abstractThrownPotion1 == null) {
|
||||
+ if (!damageSource.is(DamageTypeTags.IS_PROJECTILE) && abstractThrownPotion1 == null) { // Paper - EndermanEscapeEvent - diff on change - below logic relies on this path covering non-projectile damage.
|
||||
boolean flag = super.hurtServer(level, damageSource, amount);
|
||||
if (!(damageSource.getEntity() instanceof LivingEntity) && this.random.nextInt(10) != 0) {
|
||||
+ if (this.tryEscape(damageSource.is(net.minecraft.tags.DamageTypeTags.IS_DROWNING) ? com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.DROWN : com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper - EndermanEscapeEvent
|
||||
this.teleport();
|
||||
+ } // Paper - EndermanEscapeEvent
|
||||
}
|
||||
|
||||
return flag;
|
||||
} else {
|
||||
boolean flag = abstractThrownPotion1 != null && this.hurtWithCleanWater(level, damageSource, abstractThrownPotion1, amount);
|
||||
|
||||
|
Reference in New Issue
Block a user