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: d4dcc1a2e Updated Upstream (CraftBukkit) e886d8118 Updated Upstream () 8bc0c6c31 Updated Upstream (CraftBukkit/Spigot) (#5169) 002f65b8b living entity allow attribute registration (#4723) 69a5c67b1 fix calling setSize on dead slimes causing invincibility (fixes #5137) (#5168) Tuinity Changes: 87e0cd99e Print exceptions for light scheduling
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 2a91f07ca9c4dc0cb3b5aef5c9c1db7f69773530..7604fd83de9cfe93d427a9a1f6bbbee76aa861e8 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 87b66c284208f12e9e7cd1c9950ada8d0fbf26a5..59699bb23a189b7e53737b2f8f5263608a64109c 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -133,6 +133,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;
|
|
@@ -227,8 +228,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);
|
|
@@ -1693,7 +1694,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 c1350bbf62fc5c5e18509f378edf16e8b210cfe8..84aeffac2c2c12d98e9cec05314668a93bb5ed91 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -833,4 +833,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
|
|
}
|