Yatopia/patches/server/0028-Fix-lead-fall-dmg-config.patch
Ivan Pekov 5f55124016
Initial 1.16.2 support
This update had major internal changes, which took us 8 hours to figure out and resolve all things untill we have a successful build.
YatopiaMC members wish you happy playing using Yatopia for your server software

MAKE A BACKUP OF YOUR WORLD BEFORE RUNNING IT ON YOUR SERVER. YOU HAVE BEEN WARNED.
People have reported to paper that after upgrading villagers are gone. There could be even more issues we are unknown of.
MAKE A BACKUP OF YOUR WORLD BEFORE RUNNING IT ON YOUR SERVER. YOU HAVE BEEN WARNED.

Co-authored-by: Ovydux <68059159+Ovydux@users.noreply.github.com>
Co-authored-by: Simon Gardling <Titaniumtown@gmail.com>
Co-authored-by: budgidiere <sgidiere@gmail.com>
2020-08-13 18:53:32 +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 724aab2cc747940e31c01a52a258e3519e6bda79..e19d363e76158335acbabaee2bae295dfee38cf8 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -1264,6 +1264,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
}
}