mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-21 16:09:19 +00:00
25 lines
1.6 KiB
Diff
25 lines
1.6 KiB
Diff
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
|