Record Class TeamResearches
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.team.TeamResearches
public record TeamResearches(SimpleResearchQueue researchQueue, HashMap<net.minecraft.resources.ResourceKey<Research>,ResearchInstance> researches, HashMap<net.minecraft.resources.ResourceKey<Research>,ResearchProgress> progress)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<TeamResearches> static final TeamResearchesstatic final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, TeamResearches> -
Constructor Summary
ConstructorsConstructorDescriptionTeamResearches(SimpleResearchQueue researchQueue, HashMap<net.minecraft.resources.ResourceKey<Research>, ResearchInstance> researches, HashMap<net.minecraft.resources.ResourceKey<Research>, ResearchProgress> progress) Creates an instance of aTeamResearchesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidcompleteResearch(net.minecraft.resources.ResourceKey<Research> research, long completionTime, net.minecraft.world.level.Level level) @Nullable net.minecraft.resources.ResourceKey<Research> final booleanIndicates whether some other object is "equal to" this one.<T extends ResearchMethod>
ResearchProgressgetProgress(net.minecraft.resources.ResourceKey<Research> research) Gets the root progress of a researchbooleanhasCompleted(net.minecraft.resources.ResourceKey<Research> research) final inthashCode()Returns a hash code value for this object.HashMap<net.minecraft.resources.ResourceKey<Research>, ResearchProgress> progress()Returns the value of theprogressrecord component.voidHashMap<net.minecraft.resources.ResourceKey<Research>, ResearchInstance> Returns the value of theresearchesrecord component.Returns the value of theresearchQueuerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
EMPTY
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf,TeamResearches> STREAM_CODEC
-
-
Constructor Details
-
TeamResearches
public TeamResearches(SimpleResearchQueue researchQueue, HashMap<net.minecraft.resources.ResourceKey<Research>, ResearchInstance> researches, HashMap<net.minecraft.resources.ResourceKey<Research>, ResearchProgress> progress) Creates an instance of aTeamResearchesrecord class.- Parameters:
researchQueue- the value for theresearchQueuerecord componentresearches- the value for theresearchesrecord componentprogress- the value for theprogressrecord component
-
-
Method Details
-
hasCompleted
-
getProgress
public <T extends ResearchMethod> ResearchProgress getProgress(net.minecraft.resources.ResourceKey<Research> research) Gets the root progress of a research -
currentResearch
-
refreshResearchStatus
public void refreshResearchStatus() -
completeResearch
public void completeResearch(net.minecraft.resources.ResourceKey<Research> research, long completionTime, net.minecraft.world.level.Level level) -
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). -
researchQueue
Returns the value of theresearchQueuerecord component.- Returns:
- the value of the
researchQueuerecord component
-
researches
Returns the value of theresearchesrecord component.- Returns:
- the value of the
researchesrecord component
-
progress
Returns the value of theprogressrecord component.- Returns:
- the value of the
progressrecord component
-