Record Class TagKeyComponent<T>
java.lang.Object
java.lang.Record
dev.latvian.mods.kubejs.recipe.component.TagKeyComponent<T>
- All Implemented Interfaces:
RecipeComponent<net.minecraft.tags.TagKey<T>>
public record TagKeyComponent<T>(@Nullable RecipeComponentType<?> typeOverride, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registry, dev.latvian.mods.rhino.type.TypeInfo registryType, com.mojang.serialization.Codec<net.minecraft.tags.TagKey<T>> codec, dev.latvian.mods.rhino.type.TypeInfo typeInfo, boolean hashed)
extends Record
implements RecipeComponent<net.minecraft.tags.TagKey<T>>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>>> static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid>> static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>>> static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid>> static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.item.Item>> static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.item.Item>> static final dev.latvian.mods.rhino.type.TypeInfostatic final RecipeComponentType<?> -
Constructor Summary
ConstructorsConstructorDescriptionTagKeyComponent(@Nullable RecipeComponentType<?> typeOverride, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registry, dev.latvian.mods.rhino.type.TypeInfo registryType, boolean hashed) TagKeyComponent(@Nullable RecipeComponentType<?> typeOverride, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registry, dev.latvian.mods.rhino.type.TypeInfo registryType, com.mojang.serialization.Codec<net.minecraft.tags.TagKey<T>> codec, dev.latvian.mods.rhino.type.TypeInfo typeInfo, boolean hashed) Creates an instance of aTagKeyComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidbuildUniqueId(UniqueIdBuilder builder, net.minecraft.tags.TagKey<T> value) com.mojang.serialization.Codec<net.minecraft.tags.TagKey<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.booleanhashed()Returns the value of thehashedrecord component.booleanhasPriority(RecipeMatchContext cx, Object from) Declares whether this component should take priority when being considered by e.g.net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registry()Returns the value of theregistryrecord component.dev.latvian.mods.rhino.type.TypeInfoReturns the value of theregistryTyperecord component.toString()Returns a string representation of this record class.type()dev.latvian.mods.rhino.type.TypeInfotypeInfo()Returns the value of thetypeInforecord component.@Nullable RecipeComponentType<?> Returns the value of thetypeOverriderecord component.net.minecraft.tags.TagKey<T> wrap(RecipeScriptContext cx, Object from) Method to read the value contained within this component from an input object; this may be some arbitrary value passed into aschema'sconstructor(s) or automatically generated builder methods.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, inputKey, isEmpty, isIgnored, key, matches, or, orSelf, otherKey, outputKey, readFromJson, replace, spread, toString, validate, withCodec, writeToJson
-
Field Details
-
TAG_KEY_TYPE
public static final dev.latvian.mods.rhino.type.TypeInfo TAG_KEY_TYPE -
BLOCK
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> BLOCK -
ITEM
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.item.Item>> ITEM -
ENTITY_TYPE
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>>> ENTITY_TYPE -
BIOME
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> BIOME -
FLUID
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid>> FLUID -
HASHED_BLOCK
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block>> HASHED_BLOCK -
HASHED_ITEM
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.item.Item>> HASHED_ITEM -
HASHED_ENTITY_TYPE
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.entity.EntityType<?>>> HASHED_ENTITY_TYPE -
HASHED_BIOME
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.biome.Biome>> HASHED_BIOME -
HASHED_FLUID
public static final RecipeComponentType<net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid>> HASHED_FLUID -
TYPE
-
-
Constructor Details
-
TagKeyComponent
public TagKeyComponent(@Nullable @Nullable RecipeComponentType<?> typeOverride, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registry, dev.latvian.mods.rhino.type.TypeInfo registryType, boolean hashed) -
TagKeyComponent
public TagKeyComponent(@Nullable @Nullable RecipeComponentType<?> typeOverride, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registry, dev.latvian.mods.rhino.type.TypeInfo registryType, com.mojang.serialization.Codec<net.minecraft.tags.TagKey<T>> codec, dev.latvian.mods.rhino.type.TypeInfo typeInfo, boolean hashed) Creates an instance of aTagKeyComponentrecord class.- Parameters:
typeOverride- the value for thetypeOverriderecord componentregistry- the value for theregistryrecord componentregistryType- the value for theregistryTyperecord componentcodec- the value for thecodecrecord componenttypeInfo- the value for thetypeInforecord componenthashed- the value for thehashedrecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceRecipeComponent<T>
-
hasPriority
Description copied from interface:RecipeComponentDeclares whether this component should take priority when being considered by e.g. anEitherRecipeComponentduring deserialization.- Specified by:
hasPriorityin interfaceRecipeComponent<T>- Parameters:
cx- Script contextfrom- The object to be deserialized from- Returns:
- Whether this component should take priority
-
wrap
Description copied from interface:RecipeComponentMethod to read the value contained within this component from an input object; this may be some arbitrary value passed into aschema'sconstructor(s) or automatically generated builder methods. By default, it will attempt to type wrap based onRecipeComponent.typeInfo()- Specified by:
wrapin interfaceRecipeComponent<T>- Parameters:
cx- Script contextfrom- An object to be converted to a value for this component- Returns:
- The value read from the input
-
buildUniqueId
- Specified by:
buildUniqueIdin interfaceRecipeComponent<T>
-
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. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
typeOverride
Returns the value of thetypeOverriderecord component.- Returns:
- the value of the
typeOverriderecord component
-
registry
Returns the value of theregistryrecord component.- Returns:
- the value of the
registryrecord component
-
registryType
public dev.latvian.mods.rhino.type.TypeInfo registryType()Returns the value of theregistryTyperecord component.- Returns:
- the value of the
registryTyperecord component
-
codec
Returns the value of thecodecrecord component.- Specified by:
codecin interfaceRecipeComponent<T>- Returns:
- the value of the
codecrecord component
-
typeInfo
public dev.latvian.mods.rhino.type.TypeInfo typeInfo()Returns the value of thetypeInforecord component.- Specified by:
typeInfoin interfaceRecipeComponent<T>- Returns:
- the value of the
typeInforecord component
-
hashed
public boolean hashed()Returns the value of thehashedrecord component.- Returns:
- the value of the
hashedrecord component
-