Minestom/src/autogenerated/java/net/minestom/server/potion/PotionEffect.java

117 lines
3.0 KiB
Java

package net.minestom.server.potion;
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 PotionEffectGenerator
*/
public enum PotionEffect implements Keyed {
MOVEMENT_SPEED(NamespaceID.from("minecraft:speed")),
MOVEMENT_SLOWDOWN(NamespaceID.from("minecraft:slowness")),
DIG_SPEED(NamespaceID.from("minecraft:haste")),
DIG_SLOWDOWN(NamespaceID.from("minecraft:mining_fatigue")),
DAMAGE_BOOST(NamespaceID.from("minecraft:strength")),
HEAL(NamespaceID.from("minecraft:instant_health")),
HARM(NamespaceID.from("minecraft:instant_damage")),
JUMP(NamespaceID.from("minecraft:jump_boost")),
CONFUSION(NamespaceID.from("minecraft:nausea")),
REGENERATION(NamespaceID.from("minecraft:regeneration")),
DAMAGE_RESISTANCE(NamespaceID.from("minecraft:resistance")),
FIRE_RESISTANCE(NamespaceID.from("minecraft:fire_resistance")),
WATER_BREATHING(NamespaceID.from("minecraft:water_breathing")),
INVISIBILITY(NamespaceID.from("minecraft:invisibility")),
BLINDNESS(NamespaceID.from("minecraft:blindness")),
NIGHT_VISION(NamespaceID.from("minecraft:night_vision")),
HUNGER(NamespaceID.from("minecraft:hunger")),
WEAKNESS(NamespaceID.from("minecraft:weakness")),
POISON(NamespaceID.from("minecraft:poison")),
WITHER(NamespaceID.from("minecraft:wither")),
HEALTH_BOOST(NamespaceID.from("minecraft:health_boost")),
ABSORPTION(NamespaceID.from("minecraft:absorption")),
SATURATION(NamespaceID.from("minecraft:saturation")),
GLOWING(NamespaceID.from("minecraft:glowing")),
LEVITATION(NamespaceID.from("minecraft:levitation")),
LUCK(NamespaceID.from("minecraft:luck")),
UNLUCK(NamespaceID.from("minecraft:unluck")),
SLOW_FALLING(NamespaceID.from("minecraft:slow_falling")),
CONDUIT_POWER(NamespaceID.from("minecraft:conduit_power")),
DOLPHINS_GRACE(NamespaceID.from("minecraft:dolphins_grace")),
BAD_OMEN(NamespaceID.from("minecraft:bad_omen")),
HERO_OF_THE_VILLAGE(NamespaceID.from("minecraft:hero_of_the_village"));
private static final PotionEffect[] VALUES = values();
@NotNull
private final NamespaceID id;
PotionEffect(@NotNull NamespaceID id) {
this.id = id;
Registries.potionEffects.put(id, this);
}
@Override
@NotNull
public Key key() {
return this.id;
}
public short getId() {
return (short) (ordinal() + 1);
}
@NotNull
public NamespaceID getNamespaceID() {
return this.id;
}
@Nullable
public static PotionEffect fromId(short id) {
if(id >= 1 && id < VALUES.length + 1) {
return VALUES[id - 1];
}
return null;
}
@NotNull
@Override
public String toString() {
return "[" + this.id + "]";
}
}