Class ProgressResearchObjectiveEvent
java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.research.event.ProgressResearchObjectiveEvent
- Direct Known Subclasses:
ProgressResearchObjectiveEvent.Post,ProgressResearchObjectiveEvent.Pre
public abstract class ProgressResearchObjectiveEvent
extends net.neoforged.bus.api.Event
An event that is fired when a player progresses an objective in a
This event is fired on the
This event does not relate to when the player gets the rewards for completing the objective as they have to manually claim the rewards through the user interface.
For events relating to the rewards, see
PlayerResearchStage.
This event is fired on the
Pixelmon.EVENT_BUS.
This event does not relate to when the player gets the rewards for completing the objective as they have to manually claim the rewards through the user interface.
For events relating to the rewards, see
ClaimResearchObjectiveEvent and ClaimResearchStageEvent.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis event is fired after the objective is progressed.static classThis event is fired before the objective is progressed. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StoredContextprotected final net.minecraft.core.Holder<InteractionEvent> protected final PlayerResearchObjectiveprotected final net.minecraft.server.level.ServerPlayerprotected final PlayerResearchprotected final PlayerResearchStage -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProgressResearchObjectiveEvent(net.minecraft.server.level.ServerPlayer player, PlayerResearch research, PlayerResearchStage stage, PlayerResearchObjective objective, net.minecraft.core.Holder<InteractionEvent> event, StoredContext context) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.core.Holder<InteractionEvent> getEvent()net.minecraft.server.level.ServerPlayergetStage()booleanThis method is used to determine if the objective will be completed after the event is fired.
-
Field Details
-
player
protected final net.minecraft.server.level.ServerPlayer player -
research
-
stage
-
objective
-
event
-
context
-
-
Constructor Details
-
ProgressResearchObjectiveEvent
protected ProgressResearchObjectiveEvent(net.minecraft.server.level.ServerPlayer player, PlayerResearch research, PlayerResearchStage stage, PlayerResearchObjective objective, net.minecraft.core.Holder<InteractionEvent> event, StoredContext context)
-
-
Method Details
-
getPlayer
public net.minecraft.server.level.ServerPlayer getPlayer() -
getResearch
-
getStage
-
getObjective
-
getEvent
-
getContext
-
willComplete
public boolean willComplete()This method is used to determine if the objective will be completed after the event is fired.
This is useful for determining if the player will be able to claim the rewards for the objective.
Note this may not give accurate results if called from theProgressResearchObjectiveEvent.Postevent.- Returns:
trueif the objective will be completed after the event is fired,falseotherwise
-