From 3fffc18729842c874ace86decb86df51439ca95d Mon Sep 17 00:00:00 2001 From: LexManos Date: Tue, 14 Mar 2023 23:56:29 -0700 Subject: [PATCH] Fix crouching while sprinting stopping the player when step height is modified. Closes #9376 --- .../net/minecraftforge/fml/config/IConfigEvent.java | 10 ++-------- .../minecraft/world/entity/player/Player.java.patch | 7 ++++--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/fmlcore/src/main/java/net/minecraftforge/fml/config/IConfigEvent.java b/fmlcore/src/main/java/net/minecraftforge/fml/config/IConfigEvent.java index 124010fe1c..42e34a44fb 100644 --- a/fmlcore/src/main/java/net/minecraftforge/fml/config/IConfigEvent.java +++ b/fmlcore/src/main/java/net/minecraftforge/fml/config/IConfigEvent.java @@ -10,17 +10,11 @@ import net.minecraftforge.fml.Bindings; import java.util.function.Function; -import org.jetbrains.annotations.ApiStatus; import org.jetbrains.annotations.Nullable; public interface IConfigEvent { - record ConfigConfig(Function loading, Function reloading, @Nullable Function unloading) { - @Deprecated(since = "1.19.3", forRemoval = true) - @ApiStatus.Internal - ConfigConfig(Function loading, Function reloading) { - this(loading, reloading, null); - } - } + record ConfigConfig(Function loading, Function reloading, @Nullable Function unloading) {} + ConfigConfig CONFIGCONFIG = Bindings.getConfigConfiguration().get(); static IConfigEvent reloading(ModConfig modConfig) { diff --git a/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch b/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch index 5fd3f72612..77d9ab128a 100644 --- a/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/player/Player.java.patch @@ -202,12 +202,13 @@ protected Vec3 m_5763_(Vec3 p_36201_, MoverType p_36202_) { if (!this.f_36077_.f_35935_ && p_36201_.f_82480_ <= 0.0D && (p_36202_ == MoverType.SELF || p_36202_ == MoverType.PLAYER) && this.m_36343_() && this.m_36386_()) { double d0 = p_36201_.f_82479_; -@@ -1047,10 +_,11 @@ +@@ -1046,11 +_,13 @@ + return p_36201_; } ++ // Forge: Don't update this method to use IForgeEntity#getStepHeight() - https://github.com/MinecraftForge/MinecraftForge/issues/9376 private boolean m_36386_() { -- return this.f_19861_ || this.f_19789_ < this.m_274421_() && !this.f_19853_.m_45756_(this, this.m_20191_().m_82386_(0.0D, (double)(this.f_19789_ - this.m_274421_()), 0.0D)); -+ return this.f_19861_ || this.f_19789_ < this.getStepHeight() && !this.f_19853_.m_45756_(this, this.m_20191_().m_82386_(0.0D, (double)(this.f_19789_ - this.getStepHeight()), 0.0D)); + return this.f_19861_ || this.f_19789_ < this.m_274421_() && !this.f_19853_.m_45756_(this, this.m_20191_().m_82386_(0.0D, (double)(this.f_19789_ - this.m_274421_()), 0.0D)); } public void m_5706_(Entity p_36347_) {