ClientboundPlaceGhostRecipePacket .java

net.minecraft.network.protocol.game.ClientboundPlaceGhostRecipePacket (record, 28 lines): members: containerId, recipeDisplay, handle, STREAM_CODEC, type.

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

Implements

API Surface (2)

PacketType<ClientboundPlaceGhostRecipePacket> type()
void handle(final ClientGamePacketListener listener)

Fields & Constants (1)

STREAM_CODEC

Same Package (197)

Full Source

ClientboundPlaceGhostRecipePacket.java28 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.game;
2
3
import net.minecraft.network.RegistryFriendlyByteBuf;
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.RecipeDisplay;
9
10
public record ClientboundPlaceGhostRecipePacket(int containerId, RecipeDisplay recipeDisplay) implements Packet<ClientGamePacketListener> {
11
	public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundPlaceGhostRecipePacket> STREAM_CODEC = StreamCodec.composite(
12
		ByteBufCodecs.CONTAINER_ID,
13
		ClientboundPlaceGhostRecipePacket::containerId,
14
		RecipeDisplay.STREAM_CODEC,
15
		ClientboundPlaceGhostRecipePacket::recipeDisplay,
16
		ClientboundPlaceGhostRecipePacket::new
17
	);
18
19
	@Override
20
	public PacketType<ClientboundPlaceGhostRecipePacket> type() {
21
		return GamePacketTypes.CLIENTBOUND_PLACE_GHOST_RECIPE;
22
	}
23
24
	public void handle(final ClientGamePacketListener listener) {
25
		listener.handlePlaceRecipe(this);
26
	}
27
}
28

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