DebugHiveInfo .java

net.minecraft.util.debug.DebugHiveInfo (record): members: occupantCount, honeyLevel, sedated, pack, STREAM_CODEC, type. imports: BeehiveBlockEntity, Block.

net.minecraft.util.debugrecord29 linescommon1.0 KB

API Surface (2)

record DebugHiveInfo(Block type, int occupantCount, int honeyLevel, boolean sedated)
DebugHiveInfo pack(final BeehiveBlockEntity beehive)

Fields & Constants (1)

STREAM_CODEC

Code Graph: Dependencies (6)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

DebugHiveInfo.java29 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.debug;
2
3
import net.minecraft.core.registries.Registries;
4
import net.minecraft.network.RegistryFriendlyByteBuf;
5
import net.minecraft.network.codec.ByteBufCodecs;
6
import net.minecraft.network.codec.StreamCodec;
7
import net.minecraft.world.level.block.Block;
8
import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
9
10
public record DebugHiveInfo(Block type, int occupantCount, int honeyLevel, boolean sedated) {
11
	public static final StreamCodec<RegistryFriendlyByteBuf, DebugHiveInfo> STREAM_CODEC = StreamCodec.composite(
12
		ByteBufCodecs.registry(Registries.BLOCK),
13
		DebugHiveInfo::type,
14
		ByteBufCodecs.VAR_INT,
15
		DebugHiveInfo::occupantCount,
16
		ByteBufCodecs.VAR_INT,
17
		DebugHiveInfo::honeyLevel,
18
		ByteBufCodecs.BOOL,
19
		DebugHiveInfo::sedated,
20
		DebugHiveInfo::new
21
	);
22
23
	public static DebugHiveInfo pack(final BeehiveBlockEntity beehive) {
24
		return new DebugHiveInfo(
25
			beehive.getBlockState().getBlock(), beehive.getOccupantCount(), BeehiveBlockEntity.getHoneyLevel(beehive.getBlockState()), beehive.isSedated()
26
		);
27
	}
28
}
29

Decompiled Minecraft 26.3 source of DebugHiveInfo (net/minecraft/util/debug/DebugHiveInfo.java) with Mojang official mappings, stored verbatim on the site.