Record Class CheckItemPresenceResearchMethod
java.lang.Object
java.lang.Record
com.portingdeadmods.researchd.impl.research.method.CheckItemPresenceResearchMethod
- All Implemented Interfaces:
ResearchMethod
public record CheckItemPresenceResearchMethod(net.minecraft.world.item.crafting.Ingredient target, int count)
extends Record
implements ResearchMethod
Research method that completes once the team collectively holds the required amount of the target ingredient.
-
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 CheckItemPresenceResearchMethodstatic final net.minecraft.resources.ResourceLocationFields inherited from interface com.portingdeadmods.researchd.api.research.methods.ResearchMethod
CODEC, STREAM_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionCheckItemPresenceResearchMethod(net.minecraft.world.item.crafting.Ingredient target, int count) Creates an instance of aCheckItemPresenceResearchMethodrecord 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.Ingredienttarget()Returns the value of thetargetrecord 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
-
CheckItemPresenceResearchMethod
public CheckItemPresenceResearchMethod(net.minecraft.world.item.crafting.Ingredient target, int count) Creates an instance of aCheckItemPresenceResearchMethodrecord class.- Parameters:
target- the value for thetargetrecord 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 '=='. -
target
public net.minecraft.world.item.crafting.Ingredient target()Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
count
public int count()Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-