70 lines
1.9 KiB
Java
70 lines
1.9 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.serialization.Codec
|
|
* io.netty.buffer.ByteBuf
|
|
*/
|
|
package net.minecraft.world.item;
|
|
|
|
import com.mojang.serialization.Codec;
|
|
import io.netty.buffer.ByteBuf;
|
|
import java.util.function.IntFunction;
|
|
import net.minecraft.network.codec.ByteBufCodecs;
|
|
import net.minecraft.network.codec.StreamCodec;
|
|
import net.minecraft.util.ByIdMap;
|
|
import net.minecraft.util.StringRepresentable;
|
|
|
|
public enum ItemUseAnimation implements StringRepresentable
|
|
{
|
|
NONE(0, "none"),
|
|
EAT(1, "eat", true),
|
|
DRINK(2, "drink", true),
|
|
BLOCK(3, "block"),
|
|
BOW(4, "bow"),
|
|
TRIDENT(5, "trident"),
|
|
CROSSBOW(6, "crossbow"),
|
|
SPYGLASS(7, "spyglass"),
|
|
TOOT_HORN(8, "toot_horn"),
|
|
BRUSH(9, "brush"),
|
|
BUNDLE(10, "bundle"),
|
|
SPEAR(11, "spear", true);
|
|
|
|
private static final IntFunction<ItemUseAnimation> BY_ID;
|
|
public static final Codec<ItemUseAnimation> CODEC;
|
|
public static final StreamCodec<ByteBuf, ItemUseAnimation> STREAM_CODEC;
|
|
private final int id;
|
|
private final String name;
|
|
private final boolean customArmTransform;
|
|
|
|
private ItemUseAnimation(int id, String name) {
|
|
this(id, name, false);
|
|
}
|
|
|
|
private ItemUseAnimation(int id, String name, boolean customArmTransform) {
|
|
this.id = id;
|
|
this.name = name;
|
|
this.customArmTransform = customArmTransform;
|
|
}
|
|
|
|
public int getId() {
|
|
return this.id;
|
|
}
|
|
|
|
@Override
|
|
public String getSerializedName() {
|
|
return this.name;
|
|
}
|
|
|
|
public boolean hasCustomArmTransform() {
|
|
return this.customArmTransform;
|
|
}
|
|
|
|
static {
|
|
BY_ID = ByIdMap.continuous(ItemUseAnimation::getId, ItemUseAnimation.values(), ByIdMap.OutOfBoundsStrategy.ZERO);
|
|
CODEC = StringRepresentable.fromEnum(ItemUseAnimation::values);
|
|
STREAM_CODEC = ByteBufCodecs.idMapper(BY_ID, ItemUseAnimation::getId);
|
|
}
|
|
}
|
|
|