mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-03 23:07:40 +01:00
66779f5c86
== AT == public net.minecraft.network.chat.HoverEvent$ItemStackInfo item public net.minecraft.network.chat.HoverEvent$ItemStackInfo count public net.minecraft.network.chat.HoverEvent$ItemStackInfo components public net.minecraft.network.chat.contents.TranslatableContents filterAllowedArguments(Ljava/lang/Object;)Lcom/mojang/serialization/DataResult; Co-authored-by: zml <zml@stellardrift.ca> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
25 lines
1.3 KiB
Diff
25 lines
1.3 KiB
Diff
--- a/net/minecraft/network/PacketEncoder.java
|
|
+++ b/net/minecraft/network/PacketEncoder.java
|
|
@@ -17,10 +17,12 @@
|
|
this.protocolInfo = state;
|
|
}
|
|
|
|
+ static final ThreadLocal<java.util.Locale> ADVENTURE_LOCALE = ThreadLocal.withInitial(() -> null); // Paper - adventure; set player's locale
|
|
protected void encode(ChannelHandlerContext channelHandlerContext, Packet<T> packet, ByteBuf byteBuf) throws Exception {
|
|
PacketType<? extends Packet<? super T>> packetType = packet.type();
|
|
|
|
try {
|
|
+ ADVENTURE_LOCALE.set(channelHandlerContext.channel().attr(io.papermc.paper.adventure.PaperAdventure.LOCALE_ATTRIBUTE).get()); // Paper - adventure; set player's locale
|
|
this.protocolInfo.codec().encode(byteBuf, packet);
|
|
int i = byteBuf.readableBytes();
|
|
if (LOGGER.isDebugEnabled()) {
|
|
@@ -31,7 +33,7 @@
|
|
|
|
JvmProfiler.INSTANCE.onPacketSent(this.protocolInfo.id(), packetType, channelHandlerContext.channel().remoteAddress(), i);
|
|
} catch (Throwable var9) {
|
|
- LOGGER.error("Error sending packet {}", packetType, var9);
|
|
+ LOGGER.error("Error sending packet {} (skippable? {})", packetType, packet.isSkippable(), var9);
|
|
if (packet.isSkippable()) {
|
|
throw new SkipPacketException(var9);
|
|
}
|