9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-23 17:09:29 +00:00
Files
Leaf/leaf-server/minecraft-patches/features/0227-Prevent-double-chunk-retrieving-in-entity-fluid-push.patch
Dreeam ccf2f9c0d2 Updated Upstream (Paper/Purpur)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@a9399451 Fixup sendAllDataToRemote calls
PaperMC/Paper@cb47e018 Remove more dead code, fix pre-existing desync when cancelling and closing container
PaperMC/Paper@40764534 Specify the class loader when loading services (#12829)
PaperMC/Paper@1bf6364b Update Mache for horse decompile fix
PaperMC/Paper@76fb5060 Add vanilla error message to precondition for DialogBaseImpl (#12831)

Purpur Changes:
PurpurMC/Purpur@5b26bab8 Updated Upstream (Paper)
PurpurMC/Purpur@8734844b sigh...
PurpurMC/Purpur@09ea9cb9 fix mobs not burning in daylight (#1689)
PurpurMC/Purpur@4d5a8e6e Updated Upstream (Paper)
PurpurMC/Purpur@7dbe4153 Add support for "/chase", a disabled Minecraft command. (#1690)
PurpurMC/Purpur@11c030a8 Updated Upstream (Paper)
2025-07-12 18:14:29 +08:00

42 lines
2.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Date: Wed, 26 Mar 2025 15:47:14 -0400
Subject: [PATCH] Prevent double chunk retrieving in entity fluid pushing check
and fluid height updating
This patch is based on the following patch:
"Reduce entity fluid lookups if no fluids"
By: Paul Sauve <paul@technove.co>
As part of: Airplane (https://github.com/TECHNOVE/Airplane)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index 4be8e90dfe99663ea84dae04d9bb2b0e3bb01098..aa1c937f8cee164b9e832b7d155bcbcf22e95b63 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -4812,10 +4812,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper start - optimise collisions
public boolean updateFluidHeightAndDoFluidPushing(final TagKey<Fluid> fluid, final double flowScale) {
- if (this.touchingUnloadedChunk()) {
- return false;
- }
-
+ // Leaf - Prevent double chunk retrieving in entity fluid pushing check and fluid height updating
final AABB boundingBox = this.getBoundingBox().deflate(1.0E-3);
final Level world = this.level;
@@ -4851,7 +4848,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
for (int currChunkZ = minChunkZ; currChunkZ <= maxChunkZ; ++currChunkZ) {
for (int currChunkX = minChunkX; currChunkX <= maxChunkX; ++currChunkX) {
- final net.minecraft.world.level.chunk.LevelChunkSection[] sections = chunkSource.getChunk(currChunkX, currChunkZ, net.minecraft.world.level.chunk.status.ChunkStatus.FULL, false).getSections();
+ // Leaf start - Prevent double chunk retrieving in entity fluid pushing check and fluid height updating
+ final net.minecraft.world.level.chunk.ChunkAccess chunk = chunkSource.getChunk(currChunkX, currChunkZ, net.minecraft.world.level.chunk.status.ChunkStatus.FULL, false);
+ if (chunk == null) continue;
+ final net.minecraft.world.level.chunk.LevelChunkSection[] sections = chunk.getSections();
+ // Leaf end - Prevent double chunk retrieving in entity fluid pushing check and fluid height updating
// bound y
for (int currChunkY = minChunkY; currChunkY <= maxChunkY; ++currChunkY) {