BrandPayload .java

net.minecraft.network.protocol.common.custom.BrandPayload (record, 23 lines): members: brand, write, TYPE, STREAM_CODEC, type. strings: "brand".

net.minecraft.network.protocol.common.customrecord23 linescommon735 B

Implements

API Surface (1)

CustomPacketPayload.Type<BrandPayload> type()

Fields & Constants (2)

STREAM_CODEC
TYPE

String literals (1)

"brand"

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

BrandPayload.java23 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.common.custom;
2
3
import net.minecraft.network.FriendlyByteBuf;
4
import net.minecraft.network.codec.StreamCodec;
5
6
public record BrandPayload(String brand) implements CustomPacketPayload {
7
	public static final StreamCodec<FriendlyByteBuf, BrandPayload> STREAM_CODEC = CustomPacketPayload.codec(BrandPayload::write, BrandPayload::new);
8
	public static final CustomPacketPayload.Type<BrandPayload> TYPE = CustomPacketPayload.createType("brand");
9
10
	private BrandPayload(final FriendlyByteBuf input) {
11
		this(input.readUtf());
12
	}
13
14
	private void write(final FriendlyByteBuf output) {
15
		output.writeUtf(this.brand);
16
	}
17
18
	@Override
19
	public CustomPacketPayload.Type<BrandPayload> type() {
20
		return TYPE;
21
	}
22
}
23

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