CopperGolemState .java

net.minecraft.world.entity.animal.golem.CopperGolemState (enum): members: IDLE, GETTING_ITEM, GETTING_NO_ITEM, DROPPING_ITEM, DROPPING_NO_ITEM, BY_ID.

net.minecraft.world.entity.animal.golemenum38 linescommon1.2 KB

Implements

API Surface (1)

String getSerializedName()

Fields & Constants (5)

CODEC
BY_ID
STREAM_CODEC
name
id

String literals (5)

"idle"
"getting_item"
"getting_no_item"
"dropping_item"
"dropping_no_item"

Code Graph: Dependencies (4)

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

Full Source

CopperGolemState.java38 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.world.entity.animal.golem;
2
3
import com.mojang.serialization.Codec;
4
import io.netty.buffer.ByteBuf;
5
import java.util.function.IntFunction;
6
import net.minecraft.network.codec.ByteBufCodecs;
7
import net.minecraft.network.codec.StreamCodec;
8
import net.minecraft.util.ByIdMap;
9
import net.minecraft.util.StringRepresentable;
10
11
public enum CopperGolemState implements StringRepresentable {
12
	IDLE("idle", 0),
13
	GETTING_ITEM("getting_item", 1),
14
	GETTING_NO_ITEM("getting_no_item", 2),
15
	DROPPING_ITEM("dropping_item", 3),
16
	DROPPING_NO_ITEM("dropping_no_item", 4);
17
18
	public static final Codec<CopperGolemState> CODEC = StringRepresentable.fromEnum(CopperGolemState::values);
19
	private static final IntFunction<CopperGolemState> BY_ID = ByIdMap.continuous(CopperGolemState::id, values(), ByIdMap.OutOfBoundsStrategy.ZERO);
20
	public static final StreamCodec<ByteBuf, CopperGolemState> STREAM_CODEC = ByteBufCodecs.idMapper(BY_ID, CopperGolemState::id);
21
	private final String name;
22
	private final int id;
23
24
	CopperGolemState(final String name, final int id) {
25
		this.name = name;
26
		this.id = id;
27
	}
28
29
	@Override
30
	public String getSerializedName() {
31
		return this.name;
32
	}
33
34
	private int id() {
35
		return this.id;
36
	}
37
}
38

Decompiled Minecraft 26.3 source of CopperGolemState (net/minecraft/world/entity/animal/golem/CopperGolemState.java) with Mojang official mappings, stored verbatim on the site.