minecraft-src/net/minecraft/network/protocol/game/ServerboundRecipeBookSeenRecipePacket.java
2025-07-04 02:00:41 +03:00

25 lines
1,004 B
Java

package net.minecraft.network.protocol.game;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.PacketType;
import net.minecraft.world.item.crafting.display.RecipeDisplayId;
public record ServerboundRecipeBookSeenRecipePacket(RecipeDisplayId recipe) implements Packet<ServerGamePacketListener> {
public static final StreamCodec<FriendlyByteBuf, ServerboundRecipeBookSeenRecipePacket> STREAM_CODEC = StreamCodec.composite(
RecipeDisplayId.STREAM_CODEC, ServerboundRecipeBookSeenRecipePacket::recipe, ServerboundRecipeBookSeenRecipePacket::new
);
@Override
public PacketType<ServerboundRecipeBookSeenRecipePacket> type() {
return GamePacketTypes.SERVERBOUND_RECIPE_BOOK_SEEN_RECIPE;
}
/**
* Passes this Packet on to the NetHandler for processing.
*/
public void handle(ServerGamePacketListener handler) {
handler.handleRecipeBookSeenRecipePacket(this);
}
}