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
ConstructorDescriptionItemResource
(net.minecraft.world.item.Item item) ItemResource
(net.minecraft.world.item.Item item, net.minecraft.core.component.DataComponentPatch components) Creates an instance of aItemResource
record class. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.component.DataComponentPatch
Returns the value of thecomponents
record component.final boolean
Indicates whether some other object is "equal to" this one.long
long
getTags()
final int
hashCode()
Returns a hash code value for this object.net.minecraft.world.item.Item
item()
Returns the value of theitem
record component.static ItemResource
ofItemStack
(net.minecraft.world.item.ItemStack itemStack) net.minecraft.world.item.ItemStack
net.minecraft.world.item.ItemStack
toItemStack
(long amount) final String
toString()
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 aItemResource
record class.- Parameters:
item
- the value for theitem
record componentcomponents
- the value for thecomponents
record component
-
-
Method Details
-
toItemStack
public net.minecraft.world.item.ItemStack toItemStack() -
toItemStack
public net.minecraft.world.item.ItemStack toItemStack(long amount) -
normalize
- Specified by:
normalize
in interfaceFuzzyModeNormalizer
-
getInterfaceExportLimit
public long getInterfaceExportLimit()- Specified by:
getInterfaceExportLimit
in interfacePlatformResourceKey
-
getProcessingPatternLimit
public long getProcessingPatternLimit()- Specified by:
getProcessingPatternLimit
in interfacePlatformResourceKey
-
getTags
- Specified by:
getTags
in interfacePlatformResourceKey
-
getResourceType
- Specified by:
getResourceType
in 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 theitem
record component.- Returns:
- the value of the
item
record component
-
components
public net.minecraft.core.component.DataComponentPatch components()Returns the value of thecomponents
record component.- Returns:
- the value of the
components
record component
-