mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
* rebase * optimize LivingEntity#travel * cleanup * Replace fluid height map * reuse array list in Entity#collide * cleanup * fix fire and liquid collision shape * fix checkInside * inline betweenClosed * cleanup * optimize getOnPos * optimize equals in getOnPos * update mainSupportingBlockPos on dirty * cleanup * rename * merge same patch * rebase and remove properly * [ci skip] cleanup * rebase and rebuild * fix async locator * remove async locator * cleanup * rebase --------- Co-authored-by: Taiyou06 <kaandindar21@gmail.com>
77 lines
4.4 KiB
Diff
77 lines
4.4 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 01da8faee1bc8d656949106d5f88dea0c1ebfc89..926d0cf31be80fe1298c14411e65cd39a0962b32 100644
|
|
--- a/net/minecraft/server/MinecraftServer.java
|
|
+++ b/net/minecraft/server/MinecraftServer.java
|
|
@@ -1803,6 +1803,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 258a90b1a35c2899481c6b37f949670d4d44e2f5..29f250f78bdd3c523b859d09d5561db088c6e72b 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 6b73679351f786362daf988b02b2a226d6b43984..3e66777b784825e28b4055e9a981cb387489a188 100644
|
|
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
|
@@ -190,6 +190,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
|
|
|
net.minecraft.network.protocol.PacketUtils.ensureRunningOnSameThread(packet, this, this.server);
|
|
|
|
+ // Leaf start - Protocol core
|
|
+ if (this instanceof ServerGamePacketListenerImpl gamePacketListener) {
|
|
+ org.dreeam.leaf.protocol.Protocols.handle(gamePacketListener.player, discardedPayload);
|
|
+ }
|
|
+ // Leaf end - 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 76e7133c580725635d517bc8dd20aa10210133aa..d8bfb169b10bb2a742ecd0f4919db38da77998ad 100644
|
|
--- a/net/minecraft/server/players/PlayerList.java
|
|
+++ b/net/minecraft/server/players/PlayerList.java
|
|
@@ -689,6 +689,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
|