mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 98a702c7d [CI-SKIP] [Auto] Rebuild Patches cab361600 Expose LivingEntity hurt direction 7ef05fbd8 Do not perform neighbour updates when using debug stick (Fixes #2134)
85 lines
4.1 KiB
Diff
85 lines
4.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <blake.galbreath@gmail.com>
|
|
Date: Sun, 5 May 2019 12:58:45 -0500
|
|
Subject: [PATCH] LivingEntity safeFallDistance
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
|
index 702242653a47051c9ed32304c427c27652af6157..9f4f56c47ecd4b35ebf33ca0bf9a040074ababf2 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
|
@@ -4,6 +4,7 @@ public class EntityGiantZombie extends EntityMonster {
|
|
|
|
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
+ this.safeFallDistance = 10.0F; // Purpur
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
index fcb31147622b4b81934be05ffc8de5e821ce69b7..ce26e65aaf25a41663ecd8c935967c33ff3de1dc 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
@@ -210,7 +210,7 @@ public abstract class EntityHorseAbstract extends EntityAnimal implements IInven
|
|
|
|
@Override
|
|
protected int e(float f, float f1) {
|
|
- return MathHelper.f((f * 0.5F - 3.0F) * f1);
|
|
+ return MathHelper.f((f * 0.5F - this.safeFallDistance) * f1); // Purpur
|
|
}
|
|
|
|
protected int getChestSlots() {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
index 9737c8b31482de140e14e58aa9baa8618d1c3fb4..e98e0ca17dbb683fad97be6b9f226e1ce579431f 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -132,6 +132,7 @@ public abstract class EntityLiving extends Entity {
|
|
// CraftBukkit start
|
|
public int expToDrop;
|
|
public int maxAirTicks = 300;
|
|
+ public float safeFallDistance = 3.0F; // Purpur
|
|
boolean forceDrops;
|
|
ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
|
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
|
@@ -226,8 +227,8 @@ public abstract class EntityLiving extends Entity {
|
|
this.cR();
|
|
}
|
|
|
|
- if (!this.world.isClientSide && this.fallDistance > 3.0F && flag) {
|
|
- float f = (float) MathHelper.f(this.fallDistance - 3.0F);
|
|
+ if (!this.world.isClientSide && this.fallDistance > this.safeFallDistance && flag) { // Purpur
|
|
+ float f = (float) MathHelper.f(this.fallDistance - this.safeFallDistance); // Purpur
|
|
|
|
if (!iblockdata.isAir()) {
|
|
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
|
@@ -1685,7 +1686,7 @@ public abstract class EntityLiving extends Entity {
|
|
MobEffect mobeffect = this.getEffect(MobEffects.JUMP);
|
|
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);
|
|
|
|
- return MathHelper.f((f - 3.0F - f2) * f1);
|
|
+ return MathHelper.f((f - this.safeFallDistance - f2) * f1); // Purpur
|
|
}
|
|
|
|
protected void playBlockStepSound() {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
index 16e69cfd4994fd6850ee3635ea819379412351c9..0292cae6225ae2ee156f436c8827a018e8ffa723 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -826,4 +826,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
getHandle().setHurtDirection(hurtDirection);
|
|
}
|
|
// Paper end
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public float getSafeFallDistance() {
|
|
+ return getHandle().safeFallDistance;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setSafeFallDistance(float safeFallDistance) {
|
|
+ getHandle().safeFallDistance = safeFallDistance;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|