TickPriority .java

net.minecraft.world.ticks.TickPriority (enum): members: EXTREMELY_HIGH, VERY_HIGH, HIGH, NORMAL, LOW, VERY_LOW, EXTREMELY_LOW, byValue, getValue, value.

net.minecraft.world.ticksenum35 linescommon694 B

API Surface (2)

TickPriority byValue(final int value)
int getValue()

Fields & Constants (2)

CODEC
value

Full Source

TickPriority.java35 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.ticks;
2
3
import com.mojang.serialization.Codec;
4
5
public enum TickPriority {
6
	EXTREMELY_HIGH(-3),
7
	VERY_HIGH(-2),
8
	HIGH(-1),
9
	NORMAL(0),
10
	LOW(1),
11
	VERY_LOW(2),
12
	EXTREMELY_LOW(3);
13
14
	public static final Codec<TickPriority> CODEC = Codec.INT.xmap(TickPriority::byValue, TickPriority::getValue);
15
	private final int value;
16
17
	TickPriority(final int value) {
18
		this.value = value;
19
	}
20
21
	public static TickPriority byValue(final int value) {
22
		for (TickPriority priority : values()) {
23
			if (priority.value == value) {
24
				return priority;
25
			}
26
		}
27
28
		return value < EXTREMELY_HIGH.value ? EXTREMELY_HIGH : EXTREMELY_LOW;
29
	}
30
31
	public int getValue() {
32
		return this.value;
33
	}
34
}
35

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