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:eaadb4a68fFix Java toolchain configuration to work on arm macOS8bebf48495Mark sensor and behavior timings as verbose6855505490Fix some inconsistency issues with empty map items (#6304)ed1dc272e6Add System.out.println catcher (#6278)112b6a508aAdd force getter to ParticleBuilder (#6300)a44f486694Allow plugins to use Log4J to log (#6288)8c28a33d4eDon't not shuffle visible chunks (#6283)0e978ea45eRewrite LogEvents to contain information about the source jar of stacktrace elements (#6142)6e7f9aafd6Prevent AFK kick while watching end credits (#6239). (#6265) Tuinity Changes:61c9a54783Don't use CI build number for implementation version (#356)dc9d19c984Update packet limiter config to accept mojang or spigot packet class names (#322)
85 lines
4.4 KiB
Diff
85 lines
4.4 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/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
index 1a3ffb49a2b5f65d6e7e4911aed0d4e527ed6f51..df5a573e7c097cb7b0d5c1b087fc4f2eea81548a 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -255,6 +255,7 @@ public abstract class LivingEntity extends Entity {
|
|
// CraftBukkit start
|
|
public int expToDrop;
|
|
public int maxAirTicks = 300;
|
|
+ public float safeFallDistance = 3.0F; // Purpur
|
|
public boolean forceDrops;
|
|
public ArrayList<org.bukkit.inventory.ItemStack> drops = new ArrayList<org.bukkit.inventory.ItemStack>();
|
|
public final org.bukkit.craftbukkit.attribute.CraftAttributeMap craftAttributes;
|
|
@@ -353,8 +354,8 @@ public abstract class LivingEntity extends Entity {
|
|
this.tryAddSoulSpeed();
|
|
}
|
|
|
|
- if (!this.level.isClientSide && this.fallDistance > 3.0F && onGround) {
|
|
- float f = (float) Mth.ceil(this.fallDistance - 3.0F);
|
|
+ if (!this.level.isClientSide && this.fallDistance > this.safeFallDistance && onGround) { // Purpur
|
|
+ float f = (float) Mth.ceil(this.fallDistance - this.safeFallDistance); // Purpur
|
|
|
|
if (!landedState.isAir()) {
|
|
double d1 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
|
@@ -1891,7 +1892,7 @@ public abstract class LivingEntity extends Entity {
|
|
MobEffectInstance mobeffect = this.getEffect(MobEffects.JUMP);
|
|
float f2 = mobeffect == null ? 0.0F : (float) (mobeffect.getAmplifier() + 1);
|
|
|
|
- return Mth.ceil((fallDistance - 3.0F - f2) * damageMultiplier);
|
|
+ return Mth.ceil((fallDistance - this.safeFallDistance - f2) * damageMultiplier); // Purpur
|
|
}
|
|
|
|
protected void playBlockFallSound() {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
|
index 54401524a2be27e18d5e616e9bb8481007c7af88..16b72398645757ca194cb638f46b4528283e2199 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/AbstractHorse.java
|
|
@@ -321,7 +321,7 @@ public abstract class AbstractHorse extends Animal implements ContainerListener,
|
|
|
|
@Override
|
|
protected int calculateFallDamage(float fallDistance, float damageMultiplier) {
|
|
- return Mth.ceil((fallDistance * 0.5F - 3.0F) * damageMultiplier);
|
|
+ return Mth.ceil((fallDistance * 0.5F - this.safeFallDistance) * damageMultiplier);
|
|
}
|
|
|
|
protected int getInventorySize() {
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/Giant.java b/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
|
index c67f33f2e2e0ff5c2a85782185103325a6bf4535..a8ffdc8810152d77668aad7bad15a00c4d194d4c 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/Giant.java
|
|
@@ -12,6 +12,7 @@ import net.minecraft.world.level.LevelReader;
|
|
public class Giant extends Monster {
|
|
public Giant(EntityType<? extends Giant> type, Level world) {
|
|
super(type, world);
|
|
+ this.safeFallDistance = 10.0F; // Purpur
|
|
}
|
|
|
|
// Purpur start
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
index 646ea844ed2cf674569937653f9920e4fdbf62a0..81b26444a7be0b20e83f32ec2ba3648e4997af45 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -893,4 +893,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|
throw new IllegalArgumentException(entityCategory + " is an unrecognized entity category");
|
|
}
|
|
// Paper end
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public float getSafeFallDistance() {
|
|
+ return getHandle().safeFallDistance;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void setSafeFallDistance(float safeFallDistance) {
|
|
+ getHandle().safeFallDistance = safeFallDistance;
|
|
+ }
|
|
+ // Purpur end
|
|
}
|