9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-28 19:39:17 +00:00

Updated Upstream (Paper/Purpur)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@6ea679eb Allow listening to plugin messages during configuration phase (#12775)
PaperMC/Paper@c3be00f0 Always call plugin message dispatch on PlayerConnection
PaperMC/Paper@3fec37a9 Move the double call into the dispatch method
PaperMC/Paper@108255cb Reduce PlayerLoginEvent alt behavior nag for now (#12782)
PaperMC/Paper@2141ca52 Port plugins command to brigadier (#12632)
PaperMC/Paper@0cadaefc Fix quitmessage nullability issues (#12783)

Purpur Changes:
PurpurMC/Purpur@2d8cdd15 Updated Upstream (Paper)
This commit is contained in:
Dreeam
2025-07-02 15:30:58 +08:00
parent 47ac7c20cd
commit 419ae9c420
23 changed files with 146 additions and 131 deletions

View File

@@ -1,6 +1,7 @@
package org.leavesmc.leaves.protocol.core;
import io.netty.buffer.ByteBuf;
import io.papermc.paper.connection.PluginMessageBridgeImpl;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
@@ -14,6 +15,9 @@ import org.leavesmc.leaves.protocol.core.invoker.MinecraftRegisterInvokerHolder;
import org.leavesmc.leaves.protocol.core.invoker.PayloadReceiverInvokerHolder;
import org.leavesmc.leaves.protocol.core.invoker.PlayerInvokerHolder;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
@@ -294,7 +298,16 @@ public class LeavesProtocolManager {
}
}
public static void handleMinecraftRegister(String channelId, ServerPlayer player) {
public static void handleMinecraftRegister(String channelId, PluginMessageBridgeImpl bridge) {
ServerPlayer player = null;
if (bridge instanceof CraftPlayer craftPlayer) {
player = craftPlayer.getHandle();
}
if (player == null) {
return;
}
ResourceLocation location = ResourceLocation.tryParse(channelId);
if (location == null) {
return;