2021-07-28 14:29:28 +02:00
|
|
|
package net.minestom.server.statistic;
|
|
|
|
|
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 StatisticType extends StaticProtocolObject, StatisticTypes permits StatisticTypeImpl {
|
2021-07-28 14:29:28 +02:00
|
|
|
|
|
|
|
static @NotNull Collection<@NotNull StatisticType> values() {
|
2021-07-30 15:08:06 +02:00
|
|
|
return StatisticTypeImpl.values();
|
2021-07-28 14:29:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static @Nullable StatisticType fromNamespaceId(@NotNull String namespaceID) {
|
2021-07-30 15:08:06 +02:00
|
|
|
return StatisticTypeImpl.getSafe(namespaceID);
|
2021-07-28 14:29:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static @Nullable StatisticType fromNamespaceId(@NotNull NamespaceID namespaceID) {
|
|
|
|
return fromNamespaceId(namespaceID.asString());
|
|
|
|
}
|
|
|
|
|
|
|
|
static @Nullable StatisticType fromId(int id) {
|
2021-07-30 15:08:06 +02:00
|
|
|
return StatisticTypeImpl.getId(id);
|
2021-07-28 14:29:28 +02:00
|
|
|
}
|
|
|
|
}
|