From 897f683cbb93d422519cdddb843047466276e8dc Mon Sep 17 00:00:00 2001 From: "neoforged-automation[bot]" <177631280+neoforged-automation[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 12:44:23 +0800 Subject: [PATCH] Backport to 1.21.3: Fix entity movement in custom fluid types (#1925) Co-authored-by: sciwhiz12 <21304337+sciwhiz12@users.noreply.github.com> --- .../minecraft/world/entity/LivingEntity.java.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/net/minecraft/world/entity/LivingEntity.java.patch b/patches/net/minecraft/world/entity/LivingEntity.java.patch index 982040cc467..10961208348 100644 --- a/patches/net/minecraft/world/entity/LivingEntity.java.patch +++ b/patches/net/minecraft/world/entity/LivingEntity.java.patch @@ -521,6 +521,18 @@ } protected float getWaterSlowDown() { +@@ -2184,8 +_,9 @@ + public void travel(Vec3 p_21280_) { + if (this.isControlledByLocalInstance()) { + FluidState fluidstate = this.level().getFluidState(this.blockPosition()); +- if ((this.isInWater() || this.isInLava()) && this.isAffectedByFluids() && !this.canStandOnFluid(fluidstate)) { +- this.travelInFluid(p_21280_); ++ // Neo: Call (patched-in overload of) #travelInFluid for custom fluid types ++ if ((this.isInWater() || this.isInLava() || this.isInFluidType(fluidstate)) && this.isAffectedByFluids() && !this.canStandOnFluid(fluidstate)) { ++ this.travelInFluid(p_21280_, fluidstate); + } else if (this.isFallFlying()) { + this.travelFallFlying(); + } else { @@ -2196,7 +_,7 @@ private void travelInAir(Vec3 p_362457_) {