Record Class EnumComponent<T extends Enum<T> & net.minecraft.util.StringRepresentable>
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.recipe.component.EnumComponent<T>
- All Implemented Interfaces:
RecipeComponent<T>
public record EnumComponent<T extends Enum<T> & net.minecraft.util.StringRepresentable>(@Nullable RecipeComponentType<?> typeOverride, dev.latvian.mods.rhino.type.EnumTypeInfo typeInfo, com.mojang.serialization.Codec<T extends Enum<T> & net.minecraft.util.StringRepresentable> codec)
extends Record
implements RecipeComponent<T>
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEnumComponent(@Nullable RecipeComponentType<?> typeOverride, dev.latvian.mods.rhino.type.EnumTypeInfo typeInfo, com.mojang.serialization.Codec<T> codec) Creates an instance of aEnumComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildUniqueId(UniqueIdBuilder builder, T value) com.mojang.serialization.Codec<T> codec()Returns the value of thecodecrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static <T extends Enum<T> & net.minecraft.util.StringRepresentable>
RecipeComponentType<T> static <T extends Enum<T> & net.minecraft.util.StringRepresentable>
RecipeComponentType<T> of(net.minecraft.resources.ResourceLocation id, Class<T> enumClass, com.mojang.serialization.Codec<T> codec) toString()Returns a string representation of this record class.toString(OpsContainer ops, T value) type()dev.latvian.mods.rhino.type.EnumTypeInfotypeInfo()Returns the value of thetypeInforecord component.@Nullable RecipeComponentType<?> Returns the value of thetypeOverriderecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.latvian.mods.kubejs.recipe.component.RecipeComponent
allowEmpty, asConditionalList, asConditionalListOrSelf, asList, asListOrSelf, asMap, asPatternKey, createBuilder, hasPriority, inputKey, isEmpty, isIgnored, key, matches, or, orSelf, otherKey, outputKey, readFromJson, replace, spread, validate, withCodec, wrap, writeToJson
-
Field Details
-
TYPE
-
-
Constructor Details
-
EnumComponent
public EnumComponent(@Nullable @Nullable RecipeComponentType<?> typeOverride, dev.latvian.mods.rhino.type.EnumTypeInfo typeInfo, com.mojang.serialization.Codec<T> codec) Creates an instance of aEnumComponentrecord class.- Parameters:
typeOverride- the value for thetypeOverriderecord componenttypeInfo- the value for thetypeInforecord componentcodec- the value for thecodecrecord component
-
-
Method Details
-
of
public static <T extends Enum<T> & net.minecraft.util.StringRepresentable> RecipeComponentType<T> of(net.minecraft.resources.ResourceLocation id, Class<T> enumClass, com.mojang.serialization.Codec<T> codec) -
of
public static <T extends Enum<T> & net.minecraft.util.StringRepresentable> RecipeComponentType<T> of(net.minecraft.resources.ResourceLocation id, Class<T> enumClass) -
type
- Specified by:
typein interfaceRecipeComponent<T extends Enum<T> & net.minecraft.util.StringRepresentable>
-
buildUniqueId
- Specified by:
buildUniqueIdin interfaceRecipeComponent<T extends Enum<T> & net.minecraft.util.StringRepresentable>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
toString
- Specified by:
toStringin interfaceRecipeComponent<T extends Enum<T> & net.minecraft.util.StringRepresentable>
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
typeOverride
Returns the value of thetypeOverriderecord component.- Returns:
- the value of the
typeOverriderecord component
-
typeInfo
public dev.latvian.mods.rhino.type.EnumTypeInfo typeInfo()Returns the value of thetypeInforecord component.- Specified by:
typeInfoin interfaceRecipeComponent<T extends Enum<T> & net.minecraft.util.StringRepresentable>- Returns:
- the value of the
typeInforecord component
-
codec
Returns the value of thecodecrecord component.- Specified by:
codecin interfaceRecipeComponent<T extends Enum<T> & net.minecraft.util.StringRepresentable>- Returns:
- the value of the
codecrecord component
-