FrontAndTop .java

net.minecraft.core.FrontAndTop (enum): members: DOWN_EAST, DOWN_NORTH, DOWN_SOUTH, DOWN_WEST, UP_EAST, UP_NORTH, UP_SOUTH, UP_WEST, WEST_UP, EAST_UP, top.

net.minecraft.coreenum57 linescommon1.8 KB

Implements

API Surface (4)

String getSerializedName()
FrontAndTop fromFrontAndTop(final Direction front, final Direction top)
Direction front()
Direction top()

Fields & Constants (5)

NUM_DIRECTIONS
BY_TOP_FRONT
name
top
front

String literals (12)

"down_east"
"down_north"
"down_south"
"down_west"
"up_east"
"up_north"
"up_south"
"up_west"
"west_up"
"east_up"
"north_up"
"south_up"

Code Graph: Dependencies (3)

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

Full Source

FrontAndTop.java57 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.core;
2
3
import net.minecraft.util.StringRepresentable;
4
import net.minecraft.util.Util;
5
6
public enum FrontAndTop implements StringRepresentable {
7
	DOWN_EAST("down_east", Direction.DOWN, Direction.EAST),
8
	DOWN_NORTH("down_north", Direction.DOWN, Direction.NORTH),
9
	DOWN_SOUTH("down_south", Direction.DOWN, Direction.SOUTH),
10
	DOWN_WEST("down_west", Direction.DOWN, Direction.WEST),
11
	UP_EAST("up_east", Direction.UP, Direction.EAST),
12
	UP_NORTH("up_north", Direction.UP, Direction.NORTH),
13
	UP_SOUTH("up_south", Direction.UP, Direction.SOUTH),
14
	UP_WEST("up_west", Direction.UP, Direction.WEST),
15
	WEST_UP("west_up", Direction.WEST, Direction.UP),
16
	EAST_UP("east_up", Direction.EAST, Direction.UP),
17
	NORTH_UP("north_up", Direction.NORTH, Direction.UP),
18
	SOUTH_UP("south_up", Direction.SOUTH, Direction.UP);
19
20
	private static final int NUM_DIRECTIONS = Direction.values().length;
21
	private static final FrontAndTop[] BY_TOP_FRONT = Util.make(new FrontAndTop[NUM_DIRECTIONS * NUM_DIRECTIONS], map -> {
22
		for (FrontAndTop value : values()) {
23
			map[lookupKey(value.front, value.top)] = value;
24
		}
25
	});
26
	private final String name;
27
	private final Direction top;
28
	private final Direction front;
29
30
	private static int lookupKey(final Direction front, final Direction top) {
31
		return front.ordinal() * NUM_DIRECTIONS + top.ordinal();
32
	}
33
34
	FrontAndTop(final String name, final Direction front, final Direction top) {
35
		this.name = name;
36
		this.front = front;
37
		this.top = top;
38
	}
39
40
	@Override
41
	public String getSerializedName() {
42
		return this.name;
43
	}
44
45
	public static FrontAndTop fromFrontAndTop(final Direction front, final Direction top) {
46
		return BY_TOP_FRONT[lookupKey(front, top)];
47
	}
48
49
	public Direction front() {
50
		return this.front;
51
	}
52
53
	public Direction top() {
54
		return this.top;
55
	}
56
}
57

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