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: PaperMC/Paper@f7e3976 Revert "Legacy data should look for legacy materials (Fixes #6618)" (Fixes #6664) PaperMC/Paper@ce1e7e8 Fix jline relocation (#6677) PaperMC/Paper@3e8fb21 Suggest PlayerPostRespawnEvent if changing player state (#6679) PaperMC/Paper@2b404b0 Fix nullability on Block#breakNaturally (#6651) PaperMC/Paper@8ee9bdd Fix stacktrace deobf where thrownProxy got initialized before rewriting (#6684) PaperMC/Paper@fce7905 Option to prevent NBT copy in smithing recipes (#6671) PaperMC/Paper@3b2b835 Fix click event when vanilla scoreboard name coloring is enabled (#6652) PaperMC/Paper@425edfa More CommandBlock API (#5746) PaperMC/Paper@6847f57 Improve ItemStack#editMeta (#6502) PaperMC/Paper@6703c13 Preserve overstacked loot (#5943) PaperMC/Paper@0032236 Make Levels Use Correct Spawn Settings (#6419) PaperMC/Paper@4a27a4a Update head rotation in missing places (#5481) PaperMC/Paper@ebfd70b Use null for null resource pack prompts (#6572) PaperMC/Paper@826acaf Fix plugin provides load order (#6687) PaperMC/Paper@f905057 Prevent unintended light block manipulation (#6601) PaperMC/Paper@45c4f90 Readd root/admin user detection (#6593) PaperMC/Paper@e8830b2 Revert "Readd root/admin user detection (#6593)" (#6699) PaperMC/Paper@cc38c16 Updated Upstream (Bukkit/CraftBukkit) (#6638) PaperMC/Paper@7dd7c0c [ci skip] update issue template to remove checkboxes and add datapacks (#6702) PaperMC/Paper@bde7b98 Make legacyRenderer a ViewerUnaware renderer (#6691) PaperMC/Paper@e391591 Update paperweight to 1.1.12 (#6653) PaperMC/Paper@e14aff9 Don't count named piglins and hoglins towards mob cap (#6452) PaperMC/Paper@a978f41 Start console thread after PaperConfig & MinecraftServer.console are initialized (#6716) PaperMC/Paper@b1f0cbd [ci skip] Remove redundant/broken readme badges (#6715) PaperMC/Paper@e3ef498 [ci skip] remove markdown from issue template (#6705) PaperMC/Paper@7ebf08a Handle missing Spawn Egg item meta for 1.17 mobs (#6700) PaperMC/Paper@90f717f Add missing team sidebar display slots (#6690)
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 d7282784d894e178a352819343ce5af173343bb5..be604faf54b061494df022e4af1b6ac0d6ff4b1f 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
|
@@ -254,6 +254,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;
|
|
@@ -352,8 +353,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);
|
|
@@ -1904,7 +1905,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 ace7f09ab3a3c1d32635679cbfa479afd9d3b1cb..41bd09ca3cfc722f03d6bf8361f56f8fe0721b87 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 fe71123dc07cb13ffad8f13e57aa9bda1cb0abf5..fd6a4e9a611e60ebbbbdc8974f77244d20eb169c 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
|
@@ -916,4 +916,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
|
|
}
|