Record Class ConsumePackResearchMethod
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.method.ConsumePackResearchMethod
- Record Components:
packs- All the packs that get used in the researchcount- The amount of packs that will be usedduration- The duration in ticks for a *base speed* machine to use 1 packs o' packs.
- All Implemented Interfaces:
ResearchMethod
public record ConsumePackResearchMethod(List<net.minecraft.resources.ResourceKey<ResearchPack>> packs, int count, int duration)
extends Record
implements ResearchMethod
A 1:1 to the Factorio research. All the listed packs start getting consumed at once.
For researching to start, all the required packs must be present in the machine's inventory.'
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.portingdeadmods.researchd.api.research.methods.ResearchMethod
ResearchMethod.MethodContext, ResearchMethod.SimpleMethodContext -
Field Summary
FieldsFields inherited from interface com.portingdeadmods.researchd.api.research.methods.ResearchMethod
CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionConsumePackResearchMethod(List<net.minecraft.resources.ResourceKey<ResearchPack>> packs, int count, int duration) Creates an instance of aConsumePackResearchMethodrecord class. -
Method Summary
Modifier and TypeMethodDescriptionList<net.minecraft.world.item.ItemStack> asStacks()voidcheckProgress(net.minecraft.world.level.Level level, net.minecraft.resources.ResourceKey<Research> research, ResearchProgress.Task task, ResearchMethod.MethodContext context) intcount()Returns the value of thecountrecord component.intduration()Returns the value of thedurationrecord component.final booleanIndicates whether some other object is "equal to" this one.floatfinal inthashCode()Returns a hash code value for this object.net.minecraft.resources.ResourceLocationid()List<net.minecraft.resources.ResourceKey<ResearchPack>> packs()Returns the value of thepacksrecord component.booleanfinal StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.portingdeadmods.researchd.api.research.methods.ResearchMethod
getTranslation
-
Field Details
-
ID
public static final net.minecraft.resources.ResourceLocation ID
-
-
Constructor Details
-
ConsumePackResearchMethod
public ConsumePackResearchMethod(List<net.minecraft.resources.ResourceKey<ResearchPack>> packs, int count, int duration) Creates an instance of aConsumePackResearchMethodrecord class.
-
-
Method Details
-
id
public net.minecraft.resources.ResourceLocation id()- Specified by:
idin interfaceResearchMethod
-
checkProgress
public void checkProgress(net.minecraft.world.level.Level level, net.minecraft.resources.ResourceKey<Research> research, ResearchProgress.Task task, ResearchMethod.MethodContext context) - Specified by:
checkProgressin interfaceResearchMethod
-
shouldCheckProgress
public boolean shouldCheckProgress()- Specified by:
shouldCheckProgressin interfaceResearchMethod
-
getMaxProgress
public float getMaxProgress()- Specified by:
getMaxProgressin interfaceResearchMethod
-
createProgress
- Specified by:
createProgressin interfaceResearchMethod
-
asStacks
-
getSerializer
- Specified by:
getSerializerin interfaceResearchMethod
-
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 '=='. -
packs
Returns the value of thepacksrecord component.- Returns:
- the value of the
packsrecord component
-
count
public int count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
duration
public int duration()Returns the value of thedurationrecord component.- Returns:
- the value of the
durationrecord component
-