Record Class ItemResearchIcon
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.ItemResearchIcon
- All Implemented Interfaces:
ResearchIcon
public record ItemResearchIcon(List<net.minecraft.world.item.ItemStack> items)
extends Record
implements ResearchIcon
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ItemResearchIcon> static final ItemResearchIconstatic final net.minecraft.resources.ResourceLocationstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, ItemResearchIcon> -
Constructor Summary
ConstructorsConstructorDescriptionItemResearchIcon(List<net.minecraft.world.item.ItemStack> items) Creates an instance of aItemResearchIconrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()List<net.minecraft.world.item.ItemStack> items()Returns the value of theitemsrecord component.static ItemResearchIconsingle(net.minecraft.world.item.ItemStack stack) static ItemResearchIconsingle(net.minecraft.world.level.ItemLike item) final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,ItemResearchIcon> STREAM_CODEC -
ID
public static final net.minecraft.resources.ResourceLocation ID -
EMPTY
-
-
Constructor Details
-
ItemResearchIcon
Creates an instance of aItemResearchIconrecord class.- Parameters:
items- the value for theitemsrecord component
-
-
Method Details
-
id
public net.minecraft.resources.ResourceLocation id()- Specified by:
idin interfaceResearchIcon- Returns:
- The id of this type of Research Icon. Usually this is just a constant in the Research Icon class
-
single
-
single
-
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). -
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-