mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Updated Upstream (Paper)
Upstream has released updates that appears to apply and compile correctly Paper Changes: b75eeca0 Boost light task priority to ensure it doesnt hold up chunk loads 3d2bc848 Ensure VillagerTrades doesn't load async - fixes #3495 e470f1ef Add more information to Timing Reports f4a47db6 Improve Thread Pool usage to allow single threads for single cpu servers a4fe910f Fix sounds when using worldedit regen command 70ad51a8 Updated Upstream (Bukkit/CraftBukkit) d7cfa4fa Improve legacy format serialization more
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
From 5b5ba5db23982d2d32640b026f8e837318a7a5fd 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 4296aaa074..a2e3e60012 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 0ecdea6710..e099ef9a06 100644
|
||||
--- a/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
+++ b/src/main/java/net/minecraft/server/EntityHorseAbstract.java
|
||||
@@ -222,7 +222,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 0f8ba92a84..d6751e3cce 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 a461ac3614..4874c2242f 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
|
||||
|
||||
Reference in New Issue
Block a user