ClientboundPlaceGhostRecipePacket.java

net.minecraft.network.protocol.game.ClientboundPlaceGhostRecipePacket

信息

  • 全限定名:net.minecraft.network.protocol.game.ClientboundPlaceGhostRecipePacket
  • 类型:public record
  • 包:net.minecraft.network.protocol.game
  • 源码路径:src/main/java/net/minecraft/network/protocol/game/ClientboundPlaceGhostRecipePacket.java
  • 起始行号:L10
  • 实现:Packet
  • 职责:

    TODO

字段/常量

  • STREAM_CODEC
    • 类型: StreamCodec<RegistryFriendlyByteBuf,ClientboundPlaceGhostRecipePacket>
    • 修饰符: public static final
    • 源码定位: L11
    • 说明:

      TODO

内部类/嵌套类型

构造器

方法

下面的方法块按源码顺序生成。

public PacketType<ClientboundPlaceGhostRecipePacket> type() @ L19

  • 方法名:type
  • 源码定位:L19
  • 返回类型:PacketType
  • 修饰符:public

参数:

说明:

TODO

public void handle(ClientGamePacketListener listener) @ L24

  • 方法名:handle
  • 源码定位:L24
  • 返回类型:void
  • 修饰符:public

参数:

  • listener: ClientGamePacketListener

说明:

TODO

代码

public record ClientboundPlaceGhostRecipePacket(int containerId, RecipeDisplay recipeDisplay) implements Packet<ClientGamePacketListener> {
    public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundPlaceGhostRecipePacket> STREAM_CODEC = StreamCodec.composite(
        ByteBufCodecs.CONTAINER_ID,
        ClientboundPlaceGhostRecipePacket::containerId,
        RecipeDisplay.STREAM_CODEC,
        ClientboundPlaceGhostRecipePacket::recipeDisplay,
        ClientboundPlaceGhostRecipePacket::new
    );
 
    @Override
    public PacketType<ClientboundPlaceGhostRecipePacket> type() {
        return GamePacketTypes.CLIENTBOUND_PLACE_GHOST_RECIPE;
    }
 
    public void handle(ClientGamePacketListener listener) {
        listener.handlePlaceRecipe(this);
    }
}

引用的其他类