Unicopia/src/main/java/com/minelittlepony/unicopia/Availability.java
2024-04-12 01:23:43 +01:00

29 lines
636 B
Java

package com.minelittlepony.unicopia;
import java.util.Locale;
import net.minecraft.util.StringIdentifiable;
public enum Availability implements StringIdentifiable {
DEFAULT,
COMMANDS,
NONE;
@SuppressWarnings("deprecation")
public static final Codec<Availability> CODEC = StringIdentifiable.createCodec(Availability::values);
private final String name = name().toLowerCase(Locale.ROOT);
@Override
public String asString() {
return name;
}
public boolean isSelectable() {
return this == DEFAULT;
}
public boolean isGrantable() {
return this != NONE;
}
}