Record Class SpriteResearchIcon
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.icons.SpriteResearchIcon
- All Implemented Interfaces:
ResearchIcon
public record SpriteResearchIcon(net.minecraft.resources.ResourceLocation sprite, int width, int height)
extends Record
implements ResearchIcon
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpriteResearchIconstatic final net.minecraft.resources.ResourceLocationstatic final ResearchIconSerializer<SpriteResearchIcon> Fields inherited from interface com.portingdeadmods.researchd.api.research.ResearchIcon
CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSpriteResearchIcon(net.minecraft.resources.ResourceLocation sprite, int width, int height) Creates an instance of aSpriteResearchIconrecord 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.intheight()Returns the value of theheightrecord component.net.minecraft.resources.ResourceLocationid()net.minecraft.resources.ResourceLocationsprite()Returns the value of thespriterecord component.static SpriteResearchIconspriteIcon(String namespace, String path, int width, int height) final StringtoString()Returns a string representation of this record class.intwidth()Returns the value of thewidthrecord component.
-
Field Details
-
SERIALIZER
-
ID
public static final net.minecraft.resources.ResourceLocation ID -
EMPTY
-
-
Constructor Details
-
SpriteResearchIcon
public SpriteResearchIcon(net.minecraft.resources.ResourceLocation sprite, int width, int height) Creates an instance of aSpriteResearchIconrecord class.- Parameters:
sprite- the value for thespriterecord componentwidth- the value for thewidthrecord componentheight- the value for theheightrecord 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
-
getSerializer
- Specified by:
getSerializerin interfaceResearchIcon
-
spriteIcon
-
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 '=='. -
sprite
public net.minecraft.resources.ResourceLocation sprite()Returns the value of thespriterecord component.- Returns:
- the value of the
spriterecord component
-
width
public int width()Returns the value of thewidthrecord component.- Returns:
- the value of the
widthrecord component
-
height
public int height()Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-