Updated Upstream (Bukkit/CraftBukkit/Spigot) (#7359)

This commit is contained in:
Jake Potrebic 2022-01-22 16:59:56 -08:00 committed by GitHub
parent 60e46abb00
commit 512995c2a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
108 changed files with 345 additions and 363 deletions

View file

@ -6,10 +6,10 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent
This event is called when an entity receives knockback by another entity.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 8abdc2807abe27c31c1f2c7316dad6c8457efbc4..8d6ff08f8546450a1fc746c3332bc427748cccb6 100644
index c347c4e6f957118198adb1de7633d369bd012b82..9b6fcaaafa84853804f6183d02bd90b4f988d418 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1431,7 +1431,7 @@ public abstract class LivingEntity extends Entity {
@@ -1430,7 +1430,7 @@ public abstract class LivingEntity extends Entity {
}
this.hurtDir = (float) (Mth.atan2(d1, d0) * 57.2957763671875D - (double) this.getYRot());
@ -18,7 +18,7 @@ index 8abdc2807abe27c31c1f2c7316dad6c8457efbc4..8d6ff08f8546450a1fc746c3332bc427
} else {
this.hurtDir = (float) ((int) (Math.random() * 2.0D) * 180);
}
@@ -1479,7 +1479,7 @@ public abstract class LivingEntity extends Entity {
@@ -1478,7 +1478,7 @@ public abstract class LivingEntity extends Entity {
}
protected void blockedByShield(LivingEntity target) {
@ -27,7 +27,7 @@ index 8abdc2807abe27c31c1f2c7316dad6c8457efbc4..8d6ff08f8546450a1fc746c3332bc427
}
private boolean checkTotemDeathProtection(DamageSource source) {
@@ -1732,6 +1732,11 @@ public abstract class LivingEntity extends Entity {
@@ -1731,6 +1731,11 @@ public abstract class LivingEntity extends Entity {
}
public void knockback(double strength, double x, double z) {
@ -39,7 +39,7 @@ index 8abdc2807abe27c31c1f2c7316dad6c8457efbc4..8d6ff08f8546450a1fc746c3332bc427
strength *= 1.0D - this.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE);
if (strength > 0.0D) {
this.hasImpulse = true;
@@ -1739,6 +1744,15 @@ public abstract class LivingEntity extends Entity {
@@ -1738,6 +1743,15 @@ public abstract class LivingEntity extends Entity {
Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength);
this.setDeltaMovement(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + strength) : vec3d.y, vec3d.z / 2.0D - vec3d1.z);