Record Class ModuleContentKind
java.lang.Object
java.lang.Record
com.ultikits.ultitools.utils.ModuleContentKind
- Record Components:
kind- the kind, matchingPATTERN, for exampleENCHANTMENTcount- how many entries of this kind, ornullwhen unknown; at mostMAX_COUNT
One kind of custom game content a module added, with how many entries of it when known.
Kinds are open lower-case identifiers so that later releases can add kinds without breaking readers: code that meets a kind it does not know shows it with generic wording.
- Since:
- 7.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @Nullable IntegerThe field for thecountrecord component.static final StringBundled data packs; removing them removes their recipes and advancements.static final StringCustom enchantments; removing them strips them from items for good.private final StringThe field for thekindrecord component.static final intThe largest count a kind carries; larger counts are capped to it.static final PatternThe shape every kind must have.static final StringTag additions or new tags; removing them only makes those item categories stop applying.static final StringThe record could not be read, so the module may have added custom content. -
Constructor Summary
ConstructorsConstructorDescriptionModuleContentKind(String kind, @Nullable Integer count) Validates the kind and count, capping large counts and clearing the count forUNKNOWN. -
Method Summary
Modifier and TypeMethodDescription@Nullable Integercount()Returns the value of thecountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
kind
-
count
-
ENCHANTMENT
Custom enchantments; removing them strips them from items for good.- See Also:
-
DATAPACK
Bundled data packs; removing them removes their recipes and advancements.- See Also:
-
TAG
Tag additions or new tags; removing them only makes those item categories stop applying.- See Also:
-
UNKNOWN
The record could not be read, so the module may have added custom content.- See Also:
-
PATTERN
The shape every kind must have. -
MAX_COUNT
public static final int MAX_COUNTThe largest count a kind carries; larger counts are capped to it.- See Also:
-
-
Constructor Details
-
ModuleContentKind
Validates the kind and count, capping large counts and clearing the count forUNKNOWN.- Parameters:
kind- the open lower-case kind identifiercount- the entry count, ornullwhen unknown- Throws:
NullPointerException- ifkindisnullIllegalArgumentException- if the kind is invalid or the count is less than one
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
kind
-
count
-