Record Class DescribableResource
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.research.DescribableResource
public record DescribableResource(List<RenderableSprite> resource, net.minecraft.network.chat.Component description)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DescribableResource>static final com.mojang.serialization.Codec<DescribableResource> -
Constructor Summary
ConstructorsConstructorDescriptionDescribableResource(RenderableSprite resource) DescribableResource(RenderableSprite renderableSprite, net.minecraft.network.chat.Component description) DescribableResource(ResourceWithFallback resource) DescribableResource(String resource) DescribableResource(String resource, net.minecraft.network.chat.Component description) DescribableResource(List<RenderableSprite> resource, net.minecraft.network.chat.Component description) Creates an instance of aDescribableResourcerecord class.DescribableResource(net.minecraft.resources.ResourceLocation resource) DescribableResource(net.minecraft.resources.ResourceLocation resource, net.minecraft.network.chat.Component description) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.ComponentReturns the value of thedescriptionrecord component.static DescribableResourceempty()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static DescribableResourceread(net.minecraft.network.FriendlyByteBuf buffer) voidrenderResources(net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float width, float height, float z) resource()Returns the value of theresourcerecord component.final StringtoString()Returns a string representation of this record class.voidwrite(net.minecraft.network.FriendlyByteBuf buffer)
-
Field Details
-
DIRECT_CODEC
-
CODEC
-
-
Constructor Details
-
DescribableResource
-
DescribableResource
-
DescribableResource
public DescribableResource(net.minecraft.resources.ResourceLocation resource) -
DescribableResource
-
DescribableResource
public DescribableResource(net.minecraft.resources.ResourceLocation resource, net.minecraft.network.chat.Component description) -
DescribableResource
-
DescribableResource
public DescribableResource(RenderableSprite renderableSprite, net.minecraft.network.chat.Component description) -
DescribableResource
public DescribableResource(List<RenderableSprite> resource, net.minecraft.network.chat.Component description) Creates an instance of aDescribableResourcerecord class.- Parameters:
resource- the value for theresourcerecord componentdescription- the value for thedescriptionrecord component
-
-
Method Details
-
read
-
empty
-
write
public void write(net.minecraft.network.FriendlyByteBuf buffer) -
renderResources
public void renderResources(net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float width, float height, float 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. All components in this record class are compared withObjects::equals(Object,Object). -
resource
Returns the value of theresourcerecord component.- Returns:
- the value of the
resourcerecord component
-
description
public net.minecraft.network.chat.Component description()Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-