Record Class Research
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.research.Research
- Record Components:
- name-
- tier-
- stages-
- abandonable-
- repeatable-
public record Research(net.minecraft.network.chat.Component name, ResearchTier tier, List<ResearchStage> stages, boolean abandonable, boolean repeatable, boolean unique)
extends Record
- 
Nested Class SummaryNested Classes
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionResearch(net.minecraft.network.chat.Component name, ResearchTier tier, List<ResearchStage> stages, boolean abandonable, boolean repeatable, boolean unique) Creates an instance of aResearchrecord class.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanReturns the value of theabandonablerecord component.static Research.Builderbuilder()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()A utility method for getting theResourceLocationof thisResearchfrom thePixelmonRegistry.RESEARCH_REGISTRYbooleanA utility method for determining if theResearchis an assignment.booleanA utility method for determining if theResearchis a collection.net.minecraft.network.chat.Componentname()Returns the value of thenamerecord component.static Researchread(net.minecraft.network.FriendlyByteBuf buffer) Reads aResearchfrom the givenFriendlyByteBuf.booleanReturns the value of therepeatablerecord component.voidsaveToFile(File file) stages()Returns the value of thestagesrecord component.tier()Returns the value of thetierrecord component.com.google.gson.JsonElementtoJson()final StringtoString()Returns a string representation of this record class.booleanunique()Returns the value of theuniquerecord component.voidwrite(net.minecraft.network.FriendlyByteBuf buffer) Writes theResearchto a given buffer.
- 
Field Details- 
REGISTRY_CODEC
- 
CODEC
 
- 
- 
Constructor Details- 
Researchpublic Research(net.minecraft.network.chat.Component name, ResearchTier tier, List<ResearchStage> stages, boolean abandonable, boolean repeatable, boolean unique) Creates an instance of aResearchrecord class.- Parameters:
- name- the value for the- namerecord component
- tier- the value for the- tierrecord component
- stages- the value for the- stagesrecord component
- abandonable- the value for the- abandonablerecord component
- repeatable- the value for the- repeatablerecord component
- unique- the value for the- uniquerecord component
 
 
- 
- 
Method Details- 
readReads aResearchfrom the givenFriendlyByteBuf. This will be a client representation of the research, and as such will be missing details not required for client usage.- Parameters:
- buffer- The- FriendlyByteBufto read from.
- Returns:
- The read Researchinstance.
 
- 
idpublic net.minecraft.resources.ResourceLocation id()A utility method for getting theResourceLocationof thisResearchfrom thePixelmonRegistry.RESEARCH_REGISTRY- Returns:
- The ResourceLocationof thisResearch
 
- 
namepublic net.minecraft.network.chat.Component name()Returns the value of thenamerecord component.- Returns:
- the value of the namerecord component
 
- 
isAssignmentpublic boolean isAssignment()A utility method for determining if theResearchis an assignment.- Returns:
- trueif the- Researchis an assignment,- falseotherwise
 
- 
isCollectionpublic boolean isCollection()A utility method for determining if theResearchis a collection.- Returns:
- trueif the- Researchis a collection,- falseotherwise
 
- 
toJsonpublic com.google.gson.JsonElement toJson()- Returns:
- The Researchas aJsonElement
 
- 
saveToFile- Parameters:
- file- The file to save the- Researchto
- Throws:
- IOException- If an error occurs while saving the file
 
- 
writepublic void write(net.minecraft.network.FriendlyByteBuf buffer) Writes theResearchto a given buffer.- Parameters:
- buffer- The buffer to write to.
 
- 
builder
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
tierReturns the value of thetierrecord component.- Returns:
- the value of the tierrecord component
 
- 
stagesReturns the value of thestagesrecord component.- Returns:
- the value of the stagesrecord component
 
- 
abandonablepublic boolean abandonable()Returns the value of theabandonablerecord component.- Returns:
- the value of the abandonablerecord component
 
- 
repeatablepublic boolean repeatable()Returns the value of therepeatablerecord component.- Returns:
- the value of the repeatablerecord component
 
- 
uniquepublic boolean unique()Returns the value of theuniquerecord component.- Returns:
- the value of the uniquerecord component
 
 
-