Skip to content

Commit

Permalink
Fix wrong entity behavior in fluid caused by inconsistent fluid count
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Nov 9, 2024
1 parent 055222d commit 0e27d48
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <[email protected]>
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

0 comments on commit 0e27d48

Please sign in to comment.