Unicopia/src/main/java/com/minelittlepony/unicopia/Availability.java

30 lines
640 B
Java
Raw Normal View History

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;
@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;
}
}