39 lines
1.4 KiB
Java
39 lines
1.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* org.jspecify.annotations.Nullable
|
|
*/
|
|
package net.minecraft.client.gui.components.debug;
|
|
|
|
import java.util.Locale;
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.client.gui.components.debug.DebugEntryPosition;
|
|
import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
|
|
import net.minecraft.client.gui.components.debug.DebugScreenEntry;
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.level.Level;
|
|
import net.minecraft.world.level.chunk.LevelChunk;
|
|
import org.jspecify.annotations.Nullable;
|
|
|
|
public class DebugEntrySectionPosition
|
|
implements DebugScreenEntry {
|
|
@Override
|
|
public void display(DebugScreenDisplayer displayer, @Nullable Level serverOrClientLevel, @Nullable LevelChunk clientChunk, @Nullable LevelChunk serverChunk) {
|
|
Minecraft minecraft = Minecraft.getInstance();
|
|
Entity entity = minecraft.getCameraEntity();
|
|
if (entity == null) {
|
|
return;
|
|
}
|
|
BlockPos feetPos = minecraft.getCameraEntity().blockPosition();
|
|
displayer.addToGroup(DebugEntryPosition.GROUP, String.format(Locale.ROOT, "Section-relative: %02d %02d %02d", feetPos.getX() & 0xF, feetPos.getY() & 0xF, feetPos.getZ() & 0xF));
|
|
}
|
|
|
|
@Override
|
|
public boolean isAllowed(boolean reducedDebugInfo) {
|
|
return true;
|
|
}
|
|
}
|
|
|