mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appears to apply and compile correctly Paper Changes: a6ac47e5 Fix numerous item duplication issues and teleport issues b7402f11 Add phantom creative and insomniac controls (#3222) 75819fac Fix Potion#toItemStack swapping the extended and upgraded constructor values (#3216)
85 lines
3.6 KiB
Diff
85 lines
3.6 KiB
Diff
From 25a125f8ba5cf577c9b5550d77eb62d321022b22 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] Implement LivingEntity safeFallDistance
|
|
|
|
---
|
|
.../java/net/minecraft/server/EntityGiantZombie.java | 3 +++
|
|
.../net/minecraft/server/EntityHorseAbstract.java | 2 +-
|
|
src/main/java/net/minecraft/server/EntityLiving.java | 3 ++-
|
|
.../bukkit/craftbukkit/entity/CraftLivingEntity.java | 12 ++++++++++++
|
|
4 files changed, 18 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityGiantZombie.java b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
|
index 4296aaa07..a2e3e6001 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityGiantZombie.java
|
|
@@ -5,6 +5,9 @@ public class EntityGiantZombie extends EntityMonster {
|
|
public EntityGiantZombie(EntityTypes<? extends EntityGiantZombie> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
setStepHeight(world.purpurConfig.giantStepHeight); // Purpur
|
|
+ // Purpur start
|
|
+ this.safeFallDistance = 10.0F;
|
|
+ // Purpur end
|
|
}
|
|
|
|
// Purpur start
|
|
diff --git a/src/main/java/net/minecraft/server/EntityHorseAbstract.java b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
index 55e18e4c7..b14f67b3a 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
|
@@ -229,7 +229,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 006b498fd..c6a6befdc 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -125,6 +125,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 org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
|
@@ -1546,7 +1547,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 cZ() {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
index 8ffa3cb05..3dd0faea7 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -739,4 +739,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
}
|
|
|
|
// Paper end
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public float getSafeFallDistance() {
|
|
+ return getHandle().safeFallDistance;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setSafeFallDistance(float safeFallDistance) {
|
|
+ getHandle().safeFallDistance = safeFallDistance;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
--
|
|
2.24.0
|
|
|