Record Class ConsumeItemResearchMethod
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.method.ConsumeItemResearchMethod
- All Implemented Interfaces:
ItemResearchMethod,ResearchMethod
public record ConsumeItemResearchMethod(net.minecraft.world.item.crafting.Ingredient item, int count)
extends Record
implements ItemResearchMethod
-
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 item, 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.Ingredientitem()Returns the value of theitemrecord component.final StringtoString()Returns a string representation of this record class.type()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 item, int count) Creates an instance of aConsumeItemResearchMethodrecord class.- Parameters:
item- the value for theitemrecord 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
-
type
- Specified by:
typein 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 '=='. -
item
public net.minecraft.world.item.crafting.Ingredient item()Returns the value of theitemrecord component.- Specified by:
itemin interfaceItemResearchMethod- Returns:
- the value of the
itemrecord component
-
count
public int count()Returns the value of thecountrecord component.- Specified by:
countin interfaceItemResearchMethod- Returns:
- the value of the
countrecord component
-