Package net.minecraft.component
Record Class Component<T>
java.lang.Object
java.lang.Record
net.minecraft.component.Component<T>
- Record Components:
type
-value
-
- Mappings:
Namespace Name official kc
intermediary net/minecraft/class_9336
named net/minecraft/component/Component
official b
intermediary comp_2443
named type
official c
intermediary comp_2444
named value
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PacketCodec
<RegistryByteBuf, Component<?>> private final DataComponentType
<T> The field for thetype
record component.private final T
The field for thevalue
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(ComponentMapImpl components) <D> com.mojang.serialization.DataResult
<D> encode
(com.mojang.serialization.DynamicOps<D> ops) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.(package private) static Component
<?> of
(Map.Entry<DataComponentType<?>, Object> entry) (package private) static <T> Component
<T> of
(DataComponentType<T> type, Object value) toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.value()
Returns the value of thevalue
record component.
-
Field Details
-
type
The field for thetype
record component. -
value
The field for thevalue
record component. -
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector official a
Lkc;a:Lys;
intermediary field_49657
Lnet/minecraft/class_9336;field_49657:Lnet/minecraft/class_9139;
named PACKET_CODEC
Lnet/minecraft/component/Component;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
-
-
Constructor Details
-
Component
-
-
Method Details
-
of
- Mappings:
Namespace Name Mixin selector official a
Lkc;a(Ljava/util/Map$Entry;)Lkc;
intermediary method_57944
Lnet/minecraft/class_9336;method_57944(Ljava/util/Map$Entry;)Lnet/minecraft/class_9336;
named of
Lnet/minecraft/component/Component;of(Ljava/util/Map$Entry;)Lnet/minecraft/component/Component;
-
of
- Mappings:
Namespace Name Mixin selector official a
Lkc;a(Ljz;Ljava/lang/Object;)Lkc;
intermediary method_57945
Lnet/minecraft/class_9336;method_57945(Lnet/minecraft/class_9331;Ljava/lang/Object;)Lnet/minecraft/class_9336;
named of
Lnet/minecraft/component/Component;of(Lnet/minecraft/component/DataComponentType;Ljava/lang/Object;)Lnet/minecraft/component/Component;
-
apply
- Mappings:
Namespace Name Mixin selector official a
Lkc;a(Lkb;)V
intermediary method_57946
Lnet/minecraft/class_9336;method_57946(Lnet/minecraft/class_9335;)V
named apply
Lnet/minecraft/component/Component;apply(Lnet/minecraft/component/ComponentMapImpl;)V
-
encode
public <D> com.mojang.serialization.DataResult<D> encode(com.mojang.serialization.DynamicOps<D> ops) - Mappings:
Namespace Name Mixin selector official a
Lkc;a(Lcom/mojang/serialization/DynamicOps;)Lcom/mojang/serialization/DataResult;
intermediary method_57943
Lnet/minecraft/class_9336;method_57943(Lcom/mojang/serialization/DynamicOps;)Lcom/mojang/serialization/DataResult;
named encode
Lnet/minecraft/component/Component;encode(Lcom/mojang/serialization/DynamicOps;)Lcom/mojang/serialization/DataResult;
-
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)
. -
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
value
Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-