ServerboundPlaceRecipePacket .java

net.minecraft.network.protocol.game.ServerboundPlaceRecipePacket (record, 30 lines): members: containerId, recipe, useMaxItems, handle, STREAM_CODEC, type.

net.minecraft.network.protocol.gamerecord30 linescommon1.1 KB

Implements

API Surface (2)

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

Fields & Constants (1)

STREAM_CODEC

Same Package (197)

Full Source

ServerboundPlaceRecipePacket.java30 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.game;
2
3
import net.minecraft.network.FriendlyByteBuf;
4
import net.minecraft.network.codec.ByteBufCodecs;
5
import net.minecraft.network.codec.StreamCodec;
6
import net.minecraft.network.protocol.Packet;
7
import net.minecraft.network.protocol.PacketType;
8
import net.minecraft.world.item.crafting.display.RecipeDisplayId;
9
10
public record ServerboundPlaceRecipePacket(int containerId, RecipeDisplayId recipe, boolean useMaxItems) implements Packet<ServerGamePacketListener> {
11
	public static final StreamCodec<FriendlyByteBuf, ServerboundPlaceRecipePacket> STREAM_CODEC = StreamCodec.composite(
12
		ByteBufCodecs.CONTAINER_ID,
13
		ServerboundPlaceRecipePacket::containerId,
14
		RecipeDisplayId.STREAM_CODEC,
15
		ServerboundPlaceRecipePacket::recipe,
16
		ByteBufCodecs.BOOL,
17
		ServerboundPlaceRecipePacket::useMaxItems,
18
		ServerboundPlaceRecipePacket::new
19
	);
20
21
	@Override
22
	public PacketType<ServerboundPlaceRecipePacket> type() {
23
		return GamePacketTypes.SERVERBOUND_PLACE_RECIPE;
24
	}
25
26
	public void handle(final ServerGamePacketListener listener) {
27
		listener.handlePlaceRecipe(this);
28
	}
29
}
30

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