mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
first 50 patches done
This commit is contained in:
@@ -1,91 +0,0 @@
|
||||
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 67f6432160ddd85051305bc830bab4f922cdbba6..0d8c8f9529003a4a216e12e231e212058bb0fb28 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -253,6 +253,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
private boolean skipDropExperience;
|
||||
// CraftBukkit start
|
||||
public int expToDrop;
|
||||
+ 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,7 +354,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
this.tryAddSoulSpeed();
|
||||
}
|
||||
|
||||
- if (!this.level().isClientSide && this.fallDistance > 3.0F && onGround && !state.isAir()) {
|
||||
+ if (!this.level().isClientSide && this.fallDistance > this.safeFallDistance && onGround && !state.isAir()) { // Purpur
|
||||
double d1 = this.getX();
|
||||
double d2 = this.getY();
|
||||
double d3 = this.getZ();
|
||||
@@ -368,7 +369,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
d3 = (double) landedPosition.getZ() + 0.5D + d5 / d6 * 0.5D;
|
||||
}
|
||||
|
||||
- float f = (float) Mth.ceil(this.fallDistance - 3.0F);
|
||||
+ float f = (float) Mth.ceil(this.fallDistance - this.safeFallDistance); // Purpur
|
||||
double d7 = Math.min((double) (0.2F + f / 15.0F), 2.5D);
|
||||
int i = (int) (150.0D * d7);
|
||||
|
||||
@@ -2058,7 +2059,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
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 7a7466092a2cd194abec3abdb77a7c649b4b433c..fdf41f4990923aa4309febb9c0ca8009de8e16f1 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
|
||||
@@ -384,7 +384,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 3f7d21a5be726d301e1bcaa11f1788b51c23a7cd..db95323da1aef267aa4fbe56aaff63cb8684e15b 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 9e3baf31775326e67a5a3bd5d9e836833b4810ba..4ba5c78fa10c1e30962f30d97821fa105f804904 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -1099,4 +1099,16 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
getHandle().knockback(strength, directionX, directionZ);
|
||||
};
|
||||
// Paper end
|
||||
+
|
||||
+ // Purpur start
|
||||
+ @Override
|
||||
+ public float getSafeFallDistance() {
|
||||
+ return getHandle().safeFallDistance;
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public void setSafeFallDistance(float safeFallDistance) {
|
||||
+ getHandle().safeFallDistance = safeFallDistance;
|
||||
+ }
|
||||
+ // Purpur end
|
||||
}
|
||||
Reference in New Issue
Block a user