MoonPhase .java

net.minecraft.world.level.MoonPhase (enum, 40 lines): members: FULL_MOON, WANING_GIBBOUS, THIRD_QUARTER, WANING_CRESCENT, NEW_MOON, WAXING_CRESCENT, COUNT.

net.minecraft.world.levelenum40 linescommon982 B

Implements

API Surface (3)

int index()
int startTick()
String getSerializedName()

Fields & Constants (5)

CODEC
COUNT
PHASE_LENGTH
index
name

String literals (8)

"full_moon"
"waning_gibbous"
"third_quarter"
"waning_crescent"
"new_moon"
"waxing_crescent"
"first_quarter"
"waxing_gibbous"

Code Graph: Dependencies (1)

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

Full Source

MoonPhase.java40 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.level;
2
3
import com.mojang.serialization.Codec;
4
import net.minecraft.util.StringRepresentable;
5
6
public enum MoonPhase implements StringRepresentable {
7
	FULL_MOON(0, "full_moon"),
8
	WANING_GIBBOUS(1, "waning_gibbous"),
9
	THIRD_QUARTER(2, "third_quarter"),
10
	WANING_CRESCENT(3, "waning_crescent"),
11
	NEW_MOON(4, "new_moon"),
12
	WAXING_CRESCENT(5, "waxing_crescent"),
13
	FIRST_QUARTER(6, "first_quarter"),
14
	WAXING_GIBBOUS(7, "waxing_gibbous");
15
16
	public static final Codec<MoonPhase> CODEC = StringRepresentable.fromEnum(MoonPhase::values);
17
	public static final int COUNT = values().length;
18
	public static final int PHASE_LENGTH = 24000;
19
	private final int index;
20
	private final String name;
21
22
	MoonPhase(final int index, final String name) {
23
		this.index = index;
24
		this.name = name;
25
	}
26
27
	public int index() {
28
		return this.index;
29
	}
30
31
	public int startTick() {
32
		return this.index * 24000;
33
	}
34
35
	@Override
36
	public String getSerializedName() {
37
		return this.name;
38
	}
39
}
40

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