Zone .java

net.minecraft.util.profiling.Zone (class, 53 lines): members: addValue, addText, INACTIVE, profiler, setColor, close. imports: Nullable.

net.minecraft.util.profilingclass53 linescommon997 B

Implements

API Surface (5)

Zone addText(final String text)
Zone addText(final Supplier<String> text)
Zone addValue(final long value)
Zone setColor(final int color)
void close()

Fields & Constants (2)

INACTIVE
profiler

Code Graph: Dependencies (1)

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

Full Source

Zone.java53 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.util.profiling;
2
3
import java.util.function.Supplier;
4
import org.jspecify.annotations.Nullable;
5
6
public class Zone implements AutoCloseable {
7
	public static final Zone INACTIVE = new Zone(null);
8
	private final @Nullable ProfilerFiller profiler;
9
10
	Zone(final @Nullable ProfilerFiller profiler) {
11
		this.profiler = profiler;
12
	}
13
14
	public Zone addText(final String text) {
15
		if (this.profiler != null) {
16
			this.profiler.addZoneText(text);
17
		}
18
19
		return this;
20
	}
21
22
	public Zone addText(final Supplier<String> text) {
23
		if (this.profiler != null) {
24
			this.profiler.addZoneText(text.get());
25
		}
26
27
		return this;
28
	}
29
30
	public Zone addValue(final long value) {
31
		if (this.profiler != null) {
32
			this.profiler.addZoneValue(value);
33
		}
34
35
		return this;
36
	}
37
38
	public Zone setColor(final int color) {
39
		if (this.profiler != null) {
40
			this.profiler.setZoneColor(color);
41
		}
42
43
		return this;
44
	}
45
46
	@Override
47
	public void close() {
48
		if (this.profiler != null) {
49
			this.profiler.pop();
50
		}
51
	}
52
}
53

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