Package net.minecraft.village
Record Class TradedItem
java.lang.Object
java.lang.Record
net.minecraft.village.TradedItem
- Record Components:
item-count-components-itemStack-
public record TradedItem(RegistryEntry<Item> item, int count, ComponentPredicate components, ItemStack itemStack)
extends Record
- Mappings:
Namespace Name official cycintermediary net/minecraft/class_9306named net/minecraft/village/TradedItemofficial dintermediary comp_2424named itemofficial eintermediary comp_2425named countofficial fintermediary comp_2426named componentsofficial gintermediary comp_2427named itemStack
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TradedItem> private final ComponentPredicateThe field for thecomponentsrecord component.private final intThe field for thecountrecord component.private final RegistryEntry<Item> The field for theitemrecord component.private final ItemStackThe field for theitemStackrecord component.static final PacketCodec<RegistryByteBuf, Optional<TradedItem>> static final PacketCodec<RegistryByteBuf, TradedItem> -
Constructor Summary
ConstructorsConstructorDescriptionTradedItem(ItemConvertible item) TradedItem(ItemConvertible item, int count) TradedItem(RegistryEntry<Item> item, int count, ComponentPredicate components) TradedItem(RegistryEntry<Item> registryEntry, int int2, ComponentPredicate componentPredicate, ItemStack itemStack) -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomponentsrecord component.intcount()Returns the value of thecountrecord component.private static ItemStackcreateDisplayStack(RegistryEntry<Item> item, int count, ComponentPredicate components) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.item()Returns the value of theitemrecord component.Returns the value of theitemStackrecord component.booleanfinal StringtoString()Returns a string representation of this record class.withComponents(UnaryOperator<ComponentPredicate.Builder> builderCallback)
-
Field Details
-
item
The field for theitemrecord component. -
count
private final int countThe field for thecountrecord component. -
components
The field for thecomponentsrecord component. -
itemStack
The field for theitemStackrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector official aLcyc;a:Lcom/mojang/serialization/Codec;intermediary field_49393Lnet/minecraft/class_9306;field_49393:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/village/TradedItem;CODEC:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector official bLcyc;b:Lyg;intermediary field_49394Lnet/minecraft/class_9306;field_49394:Lnet/minecraft/class_9139;named PACKET_CODECLnet/minecraft/village/TradedItem;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
-
OPTIONAL_PACKET_CODEC
- Mappings:
Namespace Name Mixin selector official cLcyc;c:Lyg;intermediary field_49395Lnet/minecraft/class_9306;field_49395:Lnet/minecraft/class_9139;named OPTIONAL_PACKET_CODECLnet/minecraft/village/TradedItem;OPTIONAL_PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
-
-
Constructor Details
-
TradedItem
- Mappings:
Namespace Name Mixin selector official <init>Lcyc;<init>(Lczf;)Vintermediary <init>Lnet/minecraft/class_9306;<init>(Lnet/minecraft/class_1935;)Vnamed <init>Lnet/minecraft/village/TradedItem;<init>(Lnet/minecraft/item/ItemConvertible;)V
-
TradedItem
- Mappings:
Namespace Name Mixin selector official <init>Lcyc;<init>(Lczf;I)Vintermediary <init>Lnet/minecraft/class_9306;<init>(Lnet/minecraft/class_1935;I)Vnamed <init>Lnet/minecraft/village/TradedItem;<init>(Lnet/minecraft/item/ItemConvertible;I)V
-
TradedItem
- Mappings:
Namespace Name Mixin selector official <init>Lcyc;<init>(Lin;ILjp;)Vintermediary <init>Lnet/minecraft/class_9306;<init>(Lnet/minecraft/class_6880;ILnet/minecraft/class_9329;)Vnamed <init>Lnet/minecraft/village/TradedItem;<init>(Lnet/minecraft/registry/entry/RegistryEntry;ILnet/minecraft/predicate/ComponentPredicate;)V
-
TradedItem
public TradedItem(RegistryEntry<Item> registryEntry, int int2, ComponentPredicate componentPredicate, ItemStack itemStack)
-
-
Method Details
-
withComponents
- Mappings:
Namespace Name Mixin selector official aLcyc;a(Ljava/util/function/UnaryOperator;)Lcyc;intermediary method_57554Lnet/minecraft/class_9306;method_57554(Ljava/util/function/UnaryOperator;)Lnet/minecraft/class_9306;named withComponentsLnet/minecraft/village/TradedItem;withComponents(Ljava/util/function/UnaryOperator;)Lnet/minecraft/village/TradedItem;
-
createDisplayStack
private static ItemStack createDisplayStack(RegistryEntry<Item> item, int count, ComponentPredicate components) - Mappings:
Namespace Name Mixin selector official aLcyc;a(Lin;ILjp;)Lcrs;intermediary method_57553Lnet/minecraft/class_9306;method_57553(Lnet/minecraft/class_6880;ILnet/minecraft/class_9329;)Lnet/minecraft/class_1799;named createDisplayStackLnet/minecraft/village/TradedItem;createDisplayStack(Lnet/minecraft/registry/entry/RegistryEntry;ILnet/minecraft/predicate/ComponentPredicate;)Lnet/minecraft/item/ItemStack;
-
matches
- Mappings:
Namespace Name Mixin selector official aLcyc;a(Lcrs;)Zintermediary method_57552Lnet/minecraft/class_9306;method_57552(Lnet/minecraft/class_1799;)Znamed matchesLnet/minecraft/village/TradedItem;matches(Lnet/minecraft/item/ItemStack;)Z
-
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 '=='. -
item
Returns the value of theitemrecord component.- Returns:
- the value of the
itemrecord component
-
count
public int count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
components
Returns the value of thecomponentsrecord component.- Returns:
- the value of the
componentsrecord component
-
itemStack
Returns the value of theitemStackrecord component.- Returns:
- the value of the
itemStackrecord component
-