Yatopia/patches/server/0028-Fix-lead-fall-dmg-config.patch
Ivan Pekov 5765602020
Port more patches
I got all the purpur patches mentioned in #37 and ported them by also adding the squids EAR immunity patch.
Ported also 2 useful patches from Rainforest.

Unfortunately this is 1.16.2 only and thus 1.16.1 would only receive:
- from purpur: the MC-4 fix and the squid EAR immunity.
- from rainforest: all patches that have been ported.

Closes #37
2020-08-14 21:16:57 +03:00

34 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
Date: Tue, 4 Aug 2020 22:08:09 +0200
Subject: [PATCH] Fix lead fall dmg config
diff --git a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
index 0566088538c2b99ff74a408b67a9edee4751f904..db5e7cb183682f5cf7049190ae49a835738a065e 100644
--- a/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
+++ b/src/main/java/dev/tr7zw/yatopia/YatopiaConfig.java
@@ -231,4 +231,9 @@ public class YatopiaConfig {
simplerVillagerBehavior = getBoolean("settings.villager.simplerVillagerBehavior", false);
villagersHideAtNight = getBoolean("settings.villager.villagersHideAtNight", false);
}
+
+ public static boolean fixFallDistance = false;
+ private static void fixFallDistance() {
+ fixFallDistance = getBoolean("settings.fixFallDistance", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 39afc1fdd000f990675ea1d2ba067929e80dc5ad..678f9b908bbb3ccd847a8df55d7afbe5a301fdae 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1265,6 +1265,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
this.fallDistance = 0.0F;
} else if (d0 < 0.0D) {
this.fallDistance = (float) ((double) this.fallDistance - d0);
+ } else if (d0 > 0.0D && dev.tr7zw.yatopia.YatopiaConfig.fixFallDistance) { // Yatopia
+ this.fallDistance = 0.0F; // Yatopia
}
}