DebugEntrySectionPosition .java

net.minecraft.client.gui.components.debug.DebugEntrySectionPosition (class): members: isAllowed, serverOrClientLevel, displayer, clientChunk, display.

net.minecraft.client.gui.components.debugclass37 linesclient1.1 KB

Implements

API Surface (2)

void display(final DebugScreenDisplayer displayer, final @Nullable Level serverOrClientLevel, final @Nullable LevelChunk clientChunk, final @Nullable LevelChunk serverChunk)
boolean isAllowed(final boolean reducedDebugInfo)

Fields & Constants (3)

displayer
serverOrClientLevel
clientChunk

Code Graph: Dependencies (7)

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

Full Source

DebugEntrySectionPosition.java37 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.gui.components.debug;
2
3
import java.util.Locale;
4
import net.fabricmc.api.EnvType;
5
import net.fabricmc.api.Environment;
6
import net.minecraft.client.Minecraft;
7
import net.minecraft.core.BlockPos;
8
import net.minecraft.world.entity.Entity;
9
import net.minecraft.world.level.Level;
10
import net.minecraft.world.level.chunk.LevelChunk;
11
import org.jspecify.annotations.Nullable;
12
13
@Environment(EnvType.CLIENT)
14
public class DebugEntrySectionPosition implements DebugScreenEntry {
15
	@Override
16
	public void display(
17
		final DebugScreenDisplayer displayer,
18
		final @Nullable Level serverOrClientLevel,
19
		final @Nullable LevelChunk clientChunk,
20
		final @Nullable LevelChunk serverChunk
21
	) {
22
		Minecraft minecraft = Minecraft.getInstance();
23
		Entity entity = minecraft.getCameraEntity();
24
		if (entity != null) {
25
			BlockPos feetPos = minecraft.getCameraEntity().blockPosition();
26
			displayer.addToGroup(
27
				DebugEntryPosition.GROUP, String.format(Locale.ROOT, "Section-relative: %02d %02d %02d", feetPos.getX() & 15, feetPos.getY() & 15, feetPos.getZ() & 15)
28
			);
29
		}
30
	}
31
32
	@Override
33
	public boolean isAllowed(final boolean reducedDebugInfo) {
34
		return true;
35
	}
36
}
37

Decompiled Minecraft 26.3 source of DebugEntrySectionPosition (net/minecraft/client/gui/components/debug/DebugEntrySectionPosition.java) with Mojang official mappings, stored verbatim on the site.