2021-07-28 14:29:28 +02:00
|
|
|
package net.minestom.server.potion;
|
|
|
|
|
2024-02-12 21:25:46 +01:00
|
|
|
import net.minestom.server.registry.StaticProtocolObject;
|
2021-07-28 14:29:28 +02:00
|
|
|
import net.minestom.server.utils.NamespaceID;
|
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
2024-02-12 21:25:46 +01:00
|
|
|
public sealed interface PotionType extends StaticProtocolObject, PotionTypes permits PotionTypeImpl {
|
2021-07-28 14:29:28 +02:00
|
|
|
|
|
|
|
static @NotNull Collection<@NotNull PotionType> values() {
|
2021-07-30 15:08:06 +02:00
|
|
|
return PotionTypeImpl.values();
|
2021-07-28 14:29:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static @Nullable PotionType fromNamespaceId(@NotNull String namespaceID) {
|
2021-07-30 15:09:18 +02:00
|
|
|
return PotionTypeImpl.getSafe(namespaceID);
|
2021-07-28 14:29:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static @Nullable PotionType fromNamespaceId(@NotNull NamespaceID namespaceID) {
|
|
|
|
return fromNamespaceId(namespaceID.asString());
|
|
|
|
}
|
|
|
|
|
|
|
|
static @Nullable PotionType fromId(int id) {
|
2021-07-30 15:08:06 +02:00
|
|
|
return PotionTypeImpl.getId(id);
|
2021-07-28 14:29:28 +02:00
|
|
|
}
|
|
|
|
}
|