9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-30 12:29:15 +00:00

修复鞘翅模板

This commit is contained in:
XiaoMoMi
2025-05-31 15:23:33 +08:00
parent 0c3fc30708
commit 8211cc77e6
3 changed files with 13 additions and 18 deletions

View File

@@ -284,11 +284,6 @@ public class BukkitServerPlayer extends Player {
platformPlayer().closeInventory();
}
@Override
public void sendPacket(Object packet) {
this.nettyChannel().writeAndFlush(packet);
}
@Override
public void sendPacket(Object packet, boolean immediately) {
this.plugin.networkManager().sendPacket(this, packet, immediately);
@@ -305,7 +300,7 @@ public class BukkitServerPlayer extends Player {
dataPayload = Reflections.constructor$DiscardedPayload.newInstance(channelKey, Unpooled.wrappedBuffer(data));
}
Object responsePacket = Reflections.constructor$ClientboundCustomPayloadPacket.newInstance(dataPayload);
this.sendPacket(responsePacket);
this.nettyChannel().writeAndFlush(responsePacket);
} catch (Exception e) {
CraftEngine.instance().logger().warn("Failed to send custom payload to " + name(), e);
}
@@ -316,7 +311,7 @@ public class BukkitServerPlayer extends Player {
try {
Object reason = ComponentUtils.adventureToMinecraft(message);
Object kickPacket = Reflections.constructor$ClientboundDisconnectPacket.newInstance(reason);
this.sendPacket(kickPacket);
this.nettyChannel().writeAndFlush(kickPacket);
this.nettyChannel().disconnect();
} catch (Exception e) {
CraftEngine.instance().logger().warn("Failed to kick " + name(), e);