Record Class ItemResource
java.lang.Object
java.lang.Record
com.refinedmods.refinedstorage.common.support.resource.ItemResource
- All Implemented Interfaces:
ResourceKey,FuzzyModeNormalizer,PlatformResourceKey
@API(status=INTERNAL)
public record ItemResource(net.minecraft.world.item.Item item, net.minecraft.core.component.DataComponentPatch components)
extends Record
implements PlatformResourceKey, FuzzyModeNormalizer
-
Constructor Summary
ConstructorsConstructorDescriptionItemResource(net.minecraft.world.item.Item item) ItemResource(net.minecraft.world.item.Item item, net.minecraft.core.component.DataComponentPatch components) Creates an instance of aItemResourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.component.DataComponentPatchReturns the value of thecomponentsrecord component.final booleanIndicates whether some other object is "equal to" this one.longlonggetTags()final inthashCode()Returns a hash code value for this object.net.minecraft.world.item.Itemitem()Returns the value of theitemrecord component.static ItemResourceofItemStack(net.minecraft.world.item.ItemStack itemStack) net.minecraft.world.item.ItemStacknet.minecraft.world.item.ItemStacktoItemStack(long amount) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ItemResource
public ItemResource(net.minecraft.world.item.Item item) -
ItemResource
public ItemResource(net.minecraft.world.item.Item item, net.minecraft.core.component.DataComponentPatch components) Creates an instance of aItemResourcerecord class.- Parameters:
item- the value for theitemrecord componentcomponents- the value for thecomponentsrecord component
-
-
Method Details
-
toItemStack
public net.minecraft.world.item.ItemStack toItemStack() -
toItemStack
public net.minecraft.world.item.ItemStack toItemStack(long amount) -
normalize
- Specified by:
normalizein interfaceFuzzyModeNormalizer
-
getInterfaceExportLimit
public long getInterfaceExportLimit()- Specified by:
getInterfaceExportLimitin interfacePlatformResourceKey
-
getProcessingPatternLimit
public long getProcessingPatternLimit()- Specified by:
getProcessingPatternLimitin interfacePlatformResourceKey
-
getTags
- Specified by:
getTagsin interfacePlatformResourceKey
-
getResourceType
- Specified by:
getResourceTypein interfacePlatformResourceKey
-
ofItemStack
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
item
public net.minecraft.world.item.Item item()Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
components
public net.minecraft.core.component.DataComponentPatch components()Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-