mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
27 lines
1.7 KiB
Diff
27 lines
1.7 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
|
|
|
|
Removed since Leaf 1.21.3, no need
|
|
|
|
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 d55560a12be8846db7c0969f5e72f3d79bf0d9c4..3c467580195355fb1a04568e628f601365fdbfe0 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -4799,7 +4799,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
|