Record Class ConsumeItemResearchMethod
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.method.ConsumeItemResearchMethod
- All Implemented Interfaces:
ResearchMethod
public record ConsumeItemResearchMethod(net.minecraft.world.item.crafting.Ingredient toConsume, int count)
extends Record
implements ResearchMethod
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.portingdeadmods.researchd.api.research.methods.ResearchMethod
ResearchMethod.MethodContext, ResearchMethod.SimpleMethodContext -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConsumeItemResearchMethodstatic final net.minecraft.resources.ResourceLocationFields inherited from interface com.portingdeadmods.researchd.api.research.methods.ResearchMethod
CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionConsumeItemResearchMethod(net.minecraft.world.item.crafting.Ingredient toConsume, int count) Creates an instance of aConsumeItemResearchMethodrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckProgress(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.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()net.minecraft.world.item.crafting.IngredientReturns the value of thetoConsumerecord component.final 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, shouldCheckProgress
-
Field Details
-
EMPTY
-
ID
public static final net.minecraft.resources.ResourceLocation ID
-
-
Constructor Details
-
ConsumeItemResearchMethod
public ConsumeItemResearchMethod(net.minecraft.world.item.crafting.Ingredient toConsume, int count) Creates an instance of aConsumeItemResearchMethodrecord class.- Parameters:
toConsume- the value for thetoConsumerecord componentcount- the value for thecountrecord component
-
-
Method Details
-
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
-
getMaxProgress
public float getMaxProgress()- Specified by:
getMaxProgressin interfaceResearchMethod
-
createProgress
- Specified by:
createProgressin interfaceResearchMethod
-
id
public net.minecraft.resources.ResourceLocation id()- Specified by:
idin interfaceResearchMethod
-
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 '=='. -
toConsume
public net.minecraft.world.item.crafting.Ingredient toConsume()Returns the value of thetoConsumerecord component.- Returns:
- the value of the
toConsumerecord component
-
count
public int count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-