Enum CustomCrafterAPI.NameStrictLevel
-
- All Implemented Interfaces:
-
java.io.Serializable,kotlin.Comparable
public enum CustomCrafterAPI.NameStrictLevel extends Enum<CustomCrafterAPI.NameStrictLevel>
Restriction level for recipe name duplication, applied during recipe registration.
Introduced to prevent confusion when multiple recipes are displayed simultaneously.
- Since:
5.2.0
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringnameprivate final Integerordinalprivate final EnumEntries<CustomCrafterAPI.NameStrictLevel>entries
-
Method Summary
Modifier and Type Method Description final Booleancontains(Set<String> targets, Set<String> sources)Returns whether targets contains any element from sources, evaluated at the level on which this method is called. final CustomCrafterAPI.NameStrictLeveltryChange(CustomCrafterAPI.NameStrictLevel tryValue)Used by CustomCrafterAPI.setRecipeNameStrictLevel to determine whether the level can be changed from the current level to tryValue. final Booleanmatches(String target, String pattern)Returns whether pattern matches target, evaluated at the level on which this method is called. final BooleanhasDuplicate(List<String> target)Returns whether target contains duplicate names according to this level. final Array<CustomCrafterAPI.NameStrictLevel>values()final CustomCrafterAPI.NameStrictLevelvalueOf(String value)final EnumEntries<CustomCrafterAPI.NameStrictLevel>getEntries()-
-
Method Detail
-
tryChange
final CustomCrafterAPI.NameStrictLevel tryChange(CustomCrafterAPI.NameStrictLevel tryValue)
Used by CustomCrafterAPI.setRecipeNameStrictLevel to determine whether the level can be changed from the current level to tryValue. The level can only move in the stricter direction; loosening is not allowed.
- Parameters:
tryValue- The target level to attempt to change to- Returns:
NameStrictLevel if the change is permitted, or the current level if not
- Since:
5.2.0
-
hasDuplicate
final Boolean hasDuplicate(List<String> target)
Returns whether target contains duplicate names according to this level.
- Parameters:
target- List of strings to check for duplicates- Returns:
Boolean
trueif any duplicates are detected under this level- Since:
5.2.0
-
values
final Array<CustomCrafterAPI.NameStrictLevel> values()
-
valueOf
final CustomCrafterAPI.NameStrictLevel valueOf(String value)
-
getEntries
final EnumEntries<CustomCrafterAPI.NameStrictLevel> getEntries()
-
-
-
-