Minestom/src/autogenerated/java/net/minestom/server/item/Enchantment.java

129 lines
3.3 KiB
Java

package net.minestom.server.item;
import net.kyori.adventure.key.Key;
import net.kyori.adventure.key.Keyed;
import net.minestom.server.registry.Registries;
import net.minestom.server.utils.NamespaceID;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* AUTOGENERATED by EnchantmentGenerator
*/
public enum Enchantment implements Keyed {
PROTECTION(NamespaceID.from("minecraft:protection")),
FIRE_PROTECTION(NamespaceID.from("minecraft:fire_protection")),
FEATHER_FALLING(NamespaceID.from("minecraft:feather_falling")),
BLAST_PROTECTION(NamespaceID.from("minecraft:blast_protection")),
PROJECTILE_PROTECTION(NamespaceID.from("minecraft:projectile_protection")),
RESPIRATION(NamespaceID.from("minecraft:respiration")),
AQUA_AFFINITY(NamespaceID.from("minecraft:aqua_affinity")),
THORNS(NamespaceID.from("minecraft:thorns")),
DEPTH_STRIDER(NamespaceID.from("minecraft:depth_strider")),
FROST_WALKER(NamespaceID.from("minecraft:frost_walker")),
BINDING_CURSE(NamespaceID.from("minecraft:binding_curse")),
SOUL_SPEED(NamespaceID.from("minecraft:soul_speed")),
SHARPNESS(NamespaceID.from("minecraft:sharpness")),
SMITE(NamespaceID.from("minecraft:smite")),
BANE_OF_ARTHROPODS(NamespaceID.from("minecraft:bane_of_arthropods")),
KNOCKBACK(NamespaceID.from("minecraft:knockback")),
FIRE_ASPECT(NamespaceID.from("minecraft:fire_aspect")),
LOOTING(NamespaceID.from("minecraft:looting")),
SWEEPING(NamespaceID.from("minecraft:sweeping")),
EFFICIENCY(NamespaceID.from("minecraft:efficiency")),
SILK_TOUCH(NamespaceID.from("minecraft:silk_touch")),
UNBREAKING(NamespaceID.from("minecraft:unbreaking")),
FORTUNE(NamespaceID.from("minecraft:fortune")),
POWER(NamespaceID.from("minecraft:power")),
PUNCH(NamespaceID.from("minecraft:punch")),
FLAME(NamespaceID.from("minecraft:flame")),
INFINITY(NamespaceID.from("minecraft:infinity")),
LUCK_OF_THE_SEA(NamespaceID.from("minecraft:luck_of_the_sea")),
LURE(NamespaceID.from("minecraft:lure")),
LOYALTY(NamespaceID.from("minecraft:loyalty")),
IMPALING(NamespaceID.from("minecraft:impaling")),
RIPTIDE(NamespaceID.from("minecraft:riptide")),
CHANNELING(NamespaceID.from("minecraft:channeling")),
MULTISHOT(NamespaceID.from("minecraft:multishot")),
QUICK_CHARGE(NamespaceID.from("minecraft:quick_charge")),
PIERCING(NamespaceID.from("minecraft:piercing")),
MENDING(NamespaceID.from("minecraft:mending")),
VANISHING_CURSE(NamespaceID.from("minecraft:vanishing_curse"));
private static final Enchantment[] VALUES = values();
@NotNull
private final NamespaceID id;
Enchantment(@NotNull NamespaceID id) {
this.id = id;
Registries.enchantments.put(id, this);
}
@Override
@NotNull
public Key key() {
return this.id;
}
public short getId() {
return (short) ordinal();
}
@NotNull
public NamespaceID getNamespaceID() {
return this.id;
}
@Nullable
public static Enchantment fromId(short id) {
if(id >= 0 && id < VALUES.length) {
return VALUES[id];
}
return null;
}
@NotNull
@Override
public String toString() {
return "[" + this.id + "]";
}
}