ScreenAxis .java

net.minecraft.client.gui.navigation.ScreenAxis (enum): members: HORIZONTAL, VERTICAL, getNegative, getPositive, orthogonal, getDirection. imports: EnvType.

net.minecraft.client.gui.navigationenum36 linesclient776 B

API Surface (4)

ScreenAxis orthogonal()
ScreenDirection getPositive()
ScreenDirection getNegative()
ScreenDirection getDirection(final boolean positive)

Fields & Constants (1)

VERTICAL

Code Graph: Dependencies (1)

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

Full Source

ScreenAxis.java36 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.client.gui.navigation;
2
3
import net.fabricmc.api.EnvType;
4
import net.fabricmc.api.Environment;
5
6
@Environment(EnvType.CLIENT)
7
public enum ScreenAxis {
8
	HORIZONTAL,
9
	VERTICAL;
10
11
	public ScreenAxis orthogonal() {
12
		return switch (this) {
13
			case HORIZONTAL -> VERTICAL;
14
			case VERTICAL -> HORIZONTAL;
15
		};
16
	}
17
18
	public ScreenDirection getPositive() {
19
		return switch (this) {
20
			case HORIZONTAL -> ScreenDirection.RIGHT;
21
			case VERTICAL -> ScreenDirection.DOWN;
22
		};
23
	}
24
25
	public ScreenDirection getNegative() {
26
		return switch (this) {
27
			case HORIZONTAL -> ScreenDirection.LEFT;
28
			case VERTICAL -> ScreenDirection.UP;
29
		};
30
	}
31
32
	public ScreenDirection getDirection(final boolean positive) {
33
		return positive ? this.getPositive() : this.getNegative();
34
	}
35
}
36

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