DebugHiveInfo.java

net.minecraft.util.debug.DebugHiveInfo

信息

  • 全限定名:net.minecraft.util.debug.DebugHiveInfo
  • 类型:public record
  • 包:net.minecraft.util.debug
  • 源码路径:src/main/java/net/minecraft/util/debug/DebugHiveInfo.java
  • 起始行号:L10
  • 职责:

    TODO

字段/常量

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

      TODO

内部类/嵌套类型

构造器

方法

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

public static DebugHiveInfo pack(BeehiveBlockEntity beehive) @ L23

  • 方法名:pack
  • 源码定位:L23
  • 返回类型:DebugHiveInfo
  • 修饰符:public static

参数:

  • beehive: BeehiveBlockEntity

说明:

TODO

代码

public record DebugHiveInfo(Block type, int occupantCount, int honeyLevel, boolean sedated) {
    public static final StreamCodec<RegistryFriendlyByteBuf, DebugHiveInfo> STREAM_CODEC = StreamCodec.composite(
        ByteBufCodecs.registry(Registries.BLOCK),
        DebugHiveInfo::type,
        ByteBufCodecs.VAR_INT,
        DebugHiveInfo::occupantCount,
        ByteBufCodecs.VAR_INT,
        DebugHiveInfo::honeyLevel,
        ByteBufCodecs.BOOL,
        DebugHiveInfo::sedated,
        DebugHiveInfo::new
    );
 
    public static DebugHiveInfo pack(BeehiveBlockEntity beehive) {
        return new DebugHiveInfo(
            beehive.getBlockState().getBlock(), beehive.getOccupantCount(), BeehiveBlockEntity.getHoneyLevel(beehive.getBlockState()), beehive.isSedated()
        );
    }
}

引用的其他类