mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-21 07:59:26 +00:00
73 lines
4.2 KiB
Diff
73 lines
4.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: hayanesuru <hayanesuru@outlook.jp>
|
|
Date: Tue, 6 May 2025 17:44:16 +0900
|
|
Subject: [PATCH] Protocol Core
|
|
|
|
|
|
diff --git a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
|
index 56fd1ed7ccaf96e7eedea60fbdbf7f934939d563..d2f522ea6d0a209496848af073c9af1c45d6b6ce 100644
|
|
--- a/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
|
+++ b/net/minecraft/network/protocol/common/custom/CustomPacketPayload.java
|
|
@@ -46,6 +46,12 @@ public interface CustomPacketPayload {
|
|
return;
|
|
}
|
|
// Leaves end - protocol core
|
|
+ // Leaf start - Protocol core
|
|
+ if (value instanceof org.dreeam.leaf.protocol.LeafCustomPayload payload) {
|
|
+ org.dreeam.leaf.protocol.Protocols.write(buffer, payload);
|
|
+ return;
|
|
+ }
|
|
+ // Leaf end - Protocol core
|
|
this.writeCap(buffer, value.type(), value);
|
|
}
|
|
|
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
|
index 440427d23747474a400487d372d079694caa1c18..7be848b2058bddc13a20b44a1853f4aec0eb4769 100644
|
|
--- a/net/minecraft/server/MinecraftServer.java
|
|
+++ b/net/minecraft/server/MinecraftServer.java
|
|
@@ -1823,6 +1823,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
}
|
|
|
|
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handleTick(tickCount); // Leaves - protocol
|
|
+ org.dreeam.leaf.protocol.Protocols.tickServer(this); // Leaf - Protocol core
|
|
|
|
for (int i = 0; i < this.tickables.size(); i++) {
|
|
this.tickables.get(i).run();
|
|
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
|
|
index e5d302609638cbe29d7f379abab612650f9ff010..e1695c06fe9a2ca8ad9050993c36201b36af6649 100644
|
|
--- a/net/minecraft/server/level/ServerPlayer.java
|
|
+++ b/net/minecraft/server/level/ServerPlayer.java
|
|
@@ -810,6 +810,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
|
|
}
|
|
}
|
|
// Purpur end - Ridables
|
|
+ org.dreeam.leaf.protocol.Protocols.tickPlayer(this); // Leaf - Protocol core
|
|
}
|
|
|
|
private void updatePlayerAttributes() {
|
|
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
index 742ce07b527449f047bf162aadecdc2c4da9b3ba..87121e0366c6c1ca58bbc7cf09b94ae913ae0f13 100644
|
|
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
@@ -176,6 +176,8 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
|
|
|
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
|
|
|
|
+ org.dreeam.leaf.protocol.Protocols.handle(this.player, discardedPayload); // Leaf - Protocol core
|
|
+
|
|
final net.minecraft.resources.ResourceLocation identifier = packet.payload().type().id();
|
|
final byte[] data = discardedPayload.data();
|
|
try {
|
|
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
|
|
index 1a03bf5184b1b85d4cea97dc73795e8725bf2613..58e1b90132898e30aa15ed08c76b53165473999a 100644
|
|
--- a/net/minecraft/server/players/PlayerList.java
|
|
+++ b/net/minecraft/server/players/PlayerList.java
|
|
@@ -690,6 +690,7 @@ public abstract class PlayerList {
|
|
}
|
|
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
|
|
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerLeave(player); // Leaves - protocol
|
|
+ org.dreeam.leaf.protocol.Protocols.disconnected(player); // Leaf - Protocol core
|
|
// Paper end - Fix kick event leave message not being sent
|
|
org.purpurmc.purpur.task.BossBarTask.removeFromAll(player.getBukkitEntity()); // Purpur - Implement TPSBar
|
|
net.minecraft.server.network.ServerGamePacketListenerImpl.afkCooldown.remove(player.getBukkitEntity().getUniqueId()); // Leaf - Improve Purpur AFK system
|