2023-11-08 13:58:31 +01:00
|
|
|
package com.minelittlepony.unicopia;
|
|
|
|
|
2024-04-08 21:45:46 +02:00
|
|
|
import java.util.Locale;
|
|
|
|
|
|
|
|
import net.minecraft.util.StringIdentifiable;
|
|
|
|
|
|
|
|
public enum Availability implements StringIdentifiable {
|
2023-11-08 13:58:31 +01:00
|
|
|
DEFAULT,
|
|
|
|
COMMANDS,
|
|
|
|
NONE;
|
|
|
|
|
2024-04-11 14:21:08 +02:00
|
|
|
@SuppressWarnings("deprecation")
|
|
|
|
public static final EnumCodec<Availability> CODEC = StringIdentifiable.createCodec(Availability::values);
|
2024-04-08 21:45:46 +02:00
|
|
|
|
|
|
|
private final String name = name().toLowerCase(Locale.ROOT);
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String asString() {
|
|
|
|
return name;
|
|
|
|
}
|
|
|
|
|
2023-11-08 13:58:31 +01:00
|
|
|
public boolean isSelectable() {
|
|
|
|
return this == DEFAULT;
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isGrantable() {
|
|
|
|
return this != NONE;
|
|
|
|
}
|
|
|
|
}
|