From 0e27d480421620c5e11ce9395d427fb4635edd99 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Sat, 9 Nov 2024 02:15:07 -0500 Subject: [PATCH] Fix wrong entity behavior in fluid caused by inconsistent fluid count --- ...-behavior-in-fluid-caused-by-inconsi.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 patches/server/0135-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch diff --git a/patches/server/0135-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch b/patches/server/0135-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch new file mode 100644 index 000000000..c549f990d --- /dev/null +++ b/patches/server/0135-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> +Date: Fri, 8 Nov 2024 23:38:51 -0500 +Subject: [PATCH] Fix wrong entity behavior in fluid caused by inconsistent + fluid count + +Revert Gale (Airplane)'s `no entity fluid lookup if no fluid`, to fix +wrong entity behavior on water. +This issue caused by inconsistent fluid count, because of a condition change +in LevelChunkSection#setBlockState, introduced by Moonrise's block count optimisation + +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 976d72b611011cccf4b4efadc9772ce1c68ef5ee..1309fa679b4e73645fac6ae04044709915092574 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -4797,7 +4797,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess + for (int currY = minYIterate; currY < maxYIterate; ++currY) { + net.minecraft.world.level.chunk.LevelChunkSection section = sections[(currY >> 4) - minSection]; + +- if (section == null || section.hasOnlyAir() || section.fluidStateCount == 0) { // if no fluids, nothing in this section ++ if (section == null || section.hasOnlyAir()) { // Leaf - Fix wrong entity behavior in fluid caused by inconsistent fluid count + // empty + // skip to next section + currY = (currY & ~(15)) + 15; // increment by 15: iterator loop increments by the extra one