mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2026-01-06 15:41:56 +00:00
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
47 lines
2.2 KiB
Diff
47 lines
2.2 KiB
Diff
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
|
|
}
|
|
}
|
|
}
|