9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-22 16:29:26 +00:00

Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@681c013 Bundle spark (#11093)
PaperMC/Paper@5fee9c6 Move configuration option to a system property
PaperMC/Paper@aa3b356 Improve server startup logging (#11110)
PaperMC/Paper@9aea240 Properly lookup plugin classes when looked up by spark
PaperMC/Paper@7e91a2c Update the bundled spark version
This commit is contained in:
Dreeam
2024-07-21 07:11:14 +08:00
parent d4f0ad7103
commit a4ed88543a
125 changed files with 156 additions and 155 deletions

View File

@@ -0,0 +1,46 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Martijn Muijsers <martijnmuijsers@live.nl>
Date: Fri, 23 Dec 2022 20:42:50 +0100
Subject: [PATCH] Reduce block destruction packet allocations
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
This patch is based on the following patch:
"Cache block break animation packet"
By: VytskaLT <VytskaLT@protonmail.com>
As part of: SportPaper (https://github.com/Electroid/SportPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 5cbf0ec9d106d33556451a96dcc165e693764cde..7e94dcbf3adb8954800a6d577b39616638d673e8 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1619,7 +1619,17 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@Override
public void destroyBlockProgress(int entityId, BlockPos pos, int progress) {
- Iterator iterator = this.server.getPlayerList().getPlayers().iterator();
+
+ // Gale start - SportPaper - reduce block destruction packet allocations
+ var players = this.server.getPlayerList().getPlayers();
+ if (players.isEmpty()) {
+ return;
+ }
+
+ ClientboundBlockDestructionPacket packet = new ClientboundBlockDestructionPacket(entityId, pos, progress);
+
+ Iterator iterator = players.iterator();
+ // Gale end - SportPaper - reduce block destruction packet allocations
// CraftBukkit start
Player entityhuman = null;
@@ -1653,7 +1663,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// CraftBukkit end
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {
- entityplayer.connection.send(new ClientboundBlockDestructionPacket(entityId, pos, progress));
+ entityplayer.connection.send(packet); // Gale - SportPaper - reduce block destruction packet allocations
}
}
}