DebugSubscriptions .java

net.minecraft.util.debug.DebugSubscriptions (class): members: DEDICATED_SERVER_TICK_TIME, ENTITY_BLOCK_INTERSECTIONS, REDSTONE_WIRE_ORIENTATIONS, BREEZES.

net.minecraft.util.debugclass60 linescommon3.7 KB

API Surface (1)

DebugSubscription<?> bootstrap(final Registry<DebugSubscription<?>> registry)

Fields & Constants (17)

DEDICATED_SERVER_TICK_TIME
BEES
BRAINS
BREEZES
GOAL_SELECTORS
ENTITY_PATHS
ENTITY_BLOCK_INTERSECTIONS
BEE_HIVES
POIS
REDSTONE_WIRE_ORIENTATIONS
VILLAGE_SECTIONS
RAIDS
STRUCTURES
GAME_EVENT_LISTENERS
NEIGHBOR_UPDATES
GAME_EVENTS
valueStreamCodec

String literals (16)

"dedicated_server_tick_time"
"bees"
"brains"
"breezes"
"goal_selectors"
"entity_paths"
"entity_block_intersections"
"bee_hives"
"pois"
"redstone_wire_orientations"
"village_sections"
"raids"
"structures"
"game_event_listeners"
"neighbor_updates"
"game_events"

Full Source

DebugSubscriptions.java60 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.debug;
2
3
import java.util.List;
4
import net.minecraft.core.BlockPos;
5
import net.minecraft.core.Registry;
6
import net.minecraft.core.registries.BuiltInRegistries;
7
import net.minecraft.network.RegistryFriendlyByteBuf;
8
import net.minecraft.network.codec.ByteBufCodecs;
9
import net.minecraft.network.codec.StreamCodec;
10
import net.minecraft.resources.Identifier;
11
import net.minecraft.util.Unit;
12
import net.minecraft.world.level.redstone.Orientation;
13
14
public class DebugSubscriptions<T> {
15
	public static final DebugSubscription<?> DEDICATED_SERVER_TICK_TIME = registerSimple("dedicated_server_tick_time");
16
	public static final DebugSubscription<DebugBeeInfo> BEES = registerWithValue("bees", DebugBeeInfo.STREAM_CODEC);
17
	public static final DebugSubscription<DebugBrainDump> BRAINS = registerWithValue("brains", DebugBrainDump.STREAM_CODEC);
18
	public static final DebugSubscription<DebugBreezeInfo> BREEZES = registerWithValue("breezes", DebugBreezeInfo.STREAM_CODEC);
19
	public static final DebugSubscription<DebugGoalInfo> GOAL_SELECTORS = registerWithValue("goal_selectors", DebugGoalInfo.STREAM_CODEC);
20
	public static final DebugSubscription<DebugPathInfo> ENTITY_PATHS = registerWithValue("entity_paths", DebugPathInfo.STREAM_CODEC);
21
	public static final DebugSubscription<DebugEntityBlockIntersection> ENTITY_BLOCK_INTERSECTIONS = registerTemporaryValue(
22
		"entity_block_intersections", DebugEntityBlockIntersection.STREAM_CODEC, 100
23
	);
24
	public static final DebugSubscription<DebugHiveInfo> BEE_HIVES = registerWithValue("bee_hives", DebugHiveInfo.STREAM_CODEC);
25
	public static final DebugSubscription<DebugPoiInfo> POIS = registerWithValue("pois", DebugPoiInfo.STREAM_CODEC);
26
	public static final DebugSubscription<Orientation> REDSTONE_WIRE_ORIENTATIONS = registerTemporaryValue(
27
		"redstone_wire_orientations", Orientation.STREAM_CODEC, 200
28
	);
29
	public static final DebugSubscription<Unit> VILLAGE_SECTIONS = registerWithValue("village_sections", Unit.STREAM_CODEC);
30
	public static final DebugSubscription<List<BlockPos>> RAIDS = registerWithValue("raids", BlockPos.STREAM_CODEC.apply(ByteBufCodecs.list()));
31
	public static final DebugSubscription<List<DebugStructureInfo>> STRUCTURES = registerWithValue(
32
		"structures", DebugStructureInfo.STREAM_CODEC.apply(ByteBufCodecs.list())
33
	);
34
	public static final DebugSubscription<DebugGameEventListenerInfo> GAME_EVENT_LISTENERS = registerWithValue(
35
		"game_event_listeners", DebugGameEventListenerInfo.STREAM_CODEC
36
	);
37
	public static final DebugSubscription<BlockPos> NEIGHBOR_UPDATES = registerTemporaryValue("neighbor_updates", BlockPos.STREAM_CODEC, 200);
38
	public static final DebugSubscription<DebugGameEventInfo> GAME_EVENTS = registerTemporaryValue("game_events", DebugGameEventInfo.STREAM_CODEC, 60);
39
40
	public static DebugSubscription<?> bootstrap(final Registry<DebugSubscription<?>> registry) {
41
		return DEDICATED_SERVER_TICK_TIME;
42
	}
43
44
	private static DebugSubscription<?> registerSimple(final String id) {
45
		return Registry.register(BuiltInRegistries.DEBUG_SUBSCRIPTION, Identifier.withDefaultNamespace(id), new DebugSubscription(null));
46
	}
47
48
	private static <T> DebugSubscription<T> registerWithValue(final String id, final StreamCodec<? super RegistryFriendlyByteBuf, T> valueStreamCodec) {
49
		return Registry.register(BuiltInRegistries.DEBUG_SUBSCRIPTION, Identifier.withDefaultNamespace(id), new DebugSubscription<>(valueStreamCodec));
50
	}
51
52
	private static <T> DebugSubscription<T> registerTemporaryValue(
53
		final String id, final StreamCodec<? super RegistryFriendlyByteBuf, T> valueStreamCodec, final int expireAfterTicks
54
	) {
55
		return Registry.register(
56
			BuiltInRegistries.DEBUG_SUBSCRIPTION, Identifier.withDefaultNamespace(id), new DebugSubscription<>(valueStreamCodec, expireAfterTicks)
57
		);
58
	}
59
}
60

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