Record Class ResearchProgress
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.ResearchProgress
public record ResearchProgress(List<ResearchProgress.Task> tasks, ResearchProgress.Type type)
extends Record
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ResearchProgress> static final net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf, ResearchProgress> -
Constructor Summary
ConstructorsConstructorDescriptionResearchProgress(List<ResearchProgress.Task> tasks, ResearchProgress.Type type) Creates an instance of aResearchProgressrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ResearchProgressand(List<ResearchMethod> methods) voidcheckProgress(net.minecraft.resources.ResourceKey<Research> research, net.minecraft.world.level.Level level, ResearchMethod.MethodContext context) final booleanIndicates whether some other object is "equal to" this one.static ResearchProgressforResearch(net.minecraft.resources.ResourceKey<Research> key, net.minecraft.world.level.Level level) floatfloatgetTask(ResearchMethod method) final inthashCode()Returns a hash code value for this object.booleanstatic ResearchProgressor(List<ResearchMethod> methods) static ResearchProgresssingle(ResearchMethod method) tasks()Returns the value of thetasksrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Field Details
-
CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,ResearchProgress> STREAM_CODEC
-
-
Constructor Details
-
ResearchProgress
Creates an instance of aResearchProgressrecord class.- Parameters:
tasks- the value for thetasksrecord componenttype- the value for thetyperecord component
-
-
Method Details
-
isComplete
public boolean isComplete() -
getProgress
public float getProgress() -
getMaxProgress
public float getMaxProgress() -
checkProgress
public void checkProgress(net.minecraft.resources.ResourceKey<Research> research, net.minecraft.world.level.Level level, ResearchMethod.MethodContext context) -
getTask
-
forResearch
public static ResearchProgress forResearch(net.minecraft.resources.ResourceKey<Research> key, net.minecraft.world.level.Level level) -
single
-
and
-
or
-
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). -
tasks
Returns the value of thetasksrecord component.- Returns:
- the value of the
tasksrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-