mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@09e9afd2 Avoid off-main mutations of state Gale Changes: Dreeam-qwq/Gale@84684276 Updated Upstream (Paper)
29 lines
2.2 KiB
Diff
29 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Taiyou06 <kaandindar21@gmail.com>
|
|
Date: Thu, 8 May 2025 10:08:54 +0200
|
|
Subject: [PATCH] Reduce PlayerChunk Updates
|
|
|
|
|
|
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
index 1415043bee5fbbfcf9dab9184a9418d52f531f62..1a09ea1953169b72d67126283b5f581c2797506a 100644
|
|
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
|
@@ -1368,6 +1368,8 @@ public class ServerGamePacketListenerImpl
|
|
this.resetPosition();
|
|
}
|
|
|
|
+ final net.minecraft.world.level.ChunkPos playerStartChunkPosition = this.player.chunkPosition(); // Leaf - Reduce PlayerChunk Updates
|
|
+
|
|
if (!this.updateAwaitingTeleport() && this.player.hasClientLoaded()) {
|
|
double d = clampHorizontal(packet.getX(this.player.getX())); final double toX = d; // Paper - OBFHELPER
|
|
double d1 = clampVertical(packet.getY(this.player.getY())); final double toY = d1; // Paper - OBFHELPER
|
|
@@ -1639,7 +1641,7 @@ public class ServerGamePacketListenerImpl
|
|
&& !isFallFlying
|
|
&& !isAutoSpinAttack
|
|
&& this.noBlocksAround(this.player);
|
|
- this.player.serverLevel().getChunkSource().move(this.player);
|
|
+ if (!org.dreeam.leaf.config.modules.opt.ReduceChunkSourceUpdates.enabled || this.player.serverLevel() != serverLevel || this.player.chunkPosition() == playerStartChunkPosition) this.player.serverLevel().getChunkSource().move(this.player); // Leaf - Reduce PlayerChunk Updates
|
|
Vec3 vec3 = new Vec3(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z);
|
|
this.player.setOnGroundWithMovement(packet.isOnGround(), packet.horizontalCollision(), vec3);
|
|
this.player.doCheckFallDamage(vec3.x, vec3.y, vec3.z, packet.isOnGround());
|