ServerboundSignUpdatePacket .java

net.minecraft.network.protocol.game.ServerboundSignUpdatePacket (record): members: lines, slot, MAX_STRING_LENGTH, handle, pos, STREAM_CODEC, type.

net.minecraft.network.protocol.gamerecord33 linescommon1.2 KB

Implements

API Surface (2)

PacketType<ServerboundSignUpdatePacket> type()
void handle(final ServerGamePacketListener listener)

Fields & Constants (2)

MAX_STRING_LENGTH
STREAM_CODEC

Same Package (197)

Full Source

ServerboundSignUpdatePacket.java33 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.game;
2
3
import io.netty.buffer.ByteBuf;
4
import java.util.List;
5
import net.minecraft.core.BlockPos;
6
import net.minecraft.network.codec.ByteBufCodecs;
7
import net.minecraft.network.codec.StreamCodec;
8
import net.minecraft.network.protocol.Packet;
9
import net.minecraft.network.protocol.PacketType;
10
import net.minecraft.world.level.block.entity.SignTextSlot;
11
12
public record ServerboundSignUpdatePacket(BlockPos pos, List<String> lines, SignTextSlot slot) implements Packet<ServerGamePacketListener> {
13
	private static final int MAX_STRING_LENGTH = 384;
14
	public static final StreamCodec<ByteBuf, ServerboundSignUpdatePacket> STREAM_CODEC = StreamCodec.composite(
15
		BlockPos.STREAM_CODEC,
16
		ServerboundSignUpdatePacket::pos,
17
		ByteBufCodecs.stringUtf8(384).apply(ByteBufCodecs.fixedSizeList(4)),
18
		ServerboundSignUpdatePacket::lines,
19
		SignTextSlot.STREAM_CODEC,
20
		ServerboundSignUpdatePacket::slot,
21
		ServerboundSignUpdatePacket::new
22
	);
23
24
	@Override
25
	public PacketType<ServerboundSignUpdatePacket> type() {
26
		return GamePacketTypes.SERVERBOUND_SIGN_UPDATE;
27
	}
28
29
	public void handle(final ServerGamePacketListener listener) {
30
		listener.handleSignUpdate(this);
31
	}
32
}
33

Decompiled Minecraft 26.3 source of ServerboundSignUpdatePacket (net/minecraft/network/protocol/game/ServerboundSignUpdatePacket.java) with Mojang official mappings, stored verbatim on the site.