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 named net/minecraft/village/TradedItem
intermediary net/minecraft/class_9306
official dgc
named item
intermediary comp_2424
official d
named count
intermediary comp_2425
official e
named components
intermediary comp_2426
official f
named itemStack
intermediary comp_2427
official g
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<TradedItem> private final ComponentPredicate
The field for thecomponents
record component.private final int
The field for thecount
record component.private final RegistryEntry
<Item> The field for theitem
record component.private final ItemStack
The field for theitemStack
record component.static final PacketCodec
<RegistryByteBuf, Optional<TradedItem>> static final PacketCodec
<RegistryByteBuf, TradedItem> -
Constructor Summary
ConstructorDescriptionTradedItem
(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 thecomponents
record component.int
count()
Returns the value of thecount
record component.private static ItemStack
createDisplayStack
(RegistryEntry<Item> item, int count, ComponentPredicate components) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.item()
Returns the value of theitem
record component.Returns the value of theitemStack
record component.boolean
final String
toString()
Returns a string representation of this record class.withComponents
(UnaryOperator<ComponentPredicate.Builder> builderCallback)
-
Field Details
-
item
The field for theitem
record component. -
count
private final int countThe field for thecount
record component. -
components
The field for thecomponents
record component. -
itemStack
The field for theitemStack
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODEC
Lnet/minecraft/village/TradedItem;CODEC:Lcom/mojang/serialization/Codec;
intermediary field_49393
Lnet/minecraft/class_9306;field_49393:Lcom/mojang/serialization/Codec;
official a
Ldgc;a:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODEC
Lnet/minecraft/village/TradedItem;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
intermediary field_49394
Lnet/minecraft/class_9306;field_49394:Lnet/minecraft/class_9139;
official b
Ldgc;b:Lzt;
-
OPTIONAL_PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named OPTIONAL_PACKET_CODEC
Lnet/minecraft/village/TradedItem;OPTIONAL_PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
intermediary field_49395
Lnet/minecraft/class_9306;field_49395:Lnet/minecraft/class_9139;
official c
Ldgc;c:Lzt;
-
-
Constructor Details
-
TradedItem
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/village/TradedItem;<init>(Lnet/minecraft/item/ItemConvertible;)V
intermediary <init>
Lnet/minecraft/class_9306;<init>(Lnet/minecraft/class_1935;)V
official <init>
Ldgc;<init>(Ldhg;)V
-
TradedItem
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/village/TradedItem;<init>(Lnet/minecraft/item/ItemConvertible;I)V
intermediary <init>
Lnet/minecraft/class_9306;<init>(Lnet/minecraft/class_1935;I)V
official <init>
Ldgc;<init>(Ldhg;I)V
-
TradedItem
- Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/village/TradedItem;<init>(Lnet/minecraft/registry/entry/RegistryEntry;ILnet/minecraft/predicate/ComponentPredicate;)V
intermediary <init>
Lnet/minecraft/class_9306;<init>(Lnet/minecraft/class_6880;ILnet/minecraft/class_9329;)V
official <init>
Ldgc;<init>(Ljq;ILks;)V
-
TradedItem
public TradedItem(RegistryEntry<Item> registryEntry, int int2, ComponentPredicate componentPredicate, ItemStack itemStack)
-
-
Method Details
-
withComponents
- Mappings:
Namespace Name Mixin selector named withComponents
Lnet/minecraft/village/TradedItem;withComponents(Ljava/util/function/UnaryOperator;)Lnet/minecraft/village/TradedItem;
intermediary method_57554
Lnet/minecraft/class_9306;method_57554(Ljava/util/function/UnaryOperator;)Lnet/minecraft/class_9306;
official a
Ldgc;a(Ljava/util/function/UnaryOperator;)Ldgc;
-
createDisplayStack
private static ItemStack createDisplayStack(RegistryEntry<Item> item, int count, ComponentPredicate components) - Mappings:
Namespace Name Mixin selector named createDisplayStack
Lnet/minecraft/village/TradedItem;createDisplayStack(Lnet/minecraft/registry/entry/RegistryEntry;ILnet/minecraft/predicate/ComponentPredicate;)Lnet/minecraft/item/ItemStack;
intermediary method_57553
Lnet/minecraft/class_9306;method_57553(Lnet/minecraft/class_6880;ILnet/minecraft/class_9329;)Lnet/minecraft/class_1799;
official a
Ldgc;a(Ljq;ILks;)Lcxo;
-
matches
- Mappings:
Namespace Name Mixin selector named matches
Lnet/minecraft/village/TradedItem;matches(Lnet/minecraft/item/ItemStack;)Z
intermediary method_57552
Lnet/minecraft/class_9306;method_57552(Lnet/minecraft/class_1799;)Z
official a
Ldgc;a(Lcxo;)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 theitem
record component.- Returns:
- the value of the
item
record component
-
count
public int count()Returns the value of thecount
record component.- Returns:
- the value of the
count
record component
-
components
Returns the value of thecomponents
record component.- Returns:
- the value of the
components
record component
-
itemStack
Returns the value of theitemStack
record component.- Returns:
- the value of the
itemStack
record component
-