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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<DescribableResource>
static final com.mojang.serialization.Codec<DescribableResource>
-
Constructor Summary
ConstructorDescriptionDescribableResource
(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 aDescribableResource
record 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.Component
Returns the value of thedescription
record component.static DescribableResource
empty()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static DescribableResource
read
(net.minecraft.network.FriendlyByteBuf buffer) void
renderResources
(net.minecraft.client.gui.GuiGraphics graphics, float x, float y, float width, float height, float z) resource()
Returns the value of theresource
record component.final String
toString()
Returns a string representation of this record class.void
write
(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 aDescribableResource
record class.- Parameters:
resource
- the value for theresource
record componentdescription
- the value for thedescription
record 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 theresource
record component.- Returns:
- the value of the
resource
record component
-
description
public net.minecraft.network.chat.Component description()Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-