-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix wrong entity behavior in fluid caused by inconsistent fluid count
- Loading branch information
1 parent
055222d
commit 0e27d48
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
patches/server/0135-Fix-wrong-entity-behavior-in-fluid-caused-by-inconsi.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |