Class ProgressResearchObjectiveEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.research.event.ProgressResearchObjectiveEvent
- Direct Known Subclasses:
ProgressResearchObjectiveEvent.Post
,ProgressResearchObjectiveEvent.Pre
public abstract class ProgressResearchObjectiveEvent
extends net.minecraftforge.eventbus.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
Modifier and TypeClassDescriptionstatic class
This event is fired after the objective is progressed.static class
This event is fired before the objective is progressed.Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprotected final InteractionContext
protected final InteractionEvent
protected final PlayerResearchObjective
protected final net.minecraft.server.level.ServerPlayer
protected final PlayerResearch
protected final PlayerResearchStage
-
Constructor Summary
ModifierConstructorDescriptionprotected
ProgressResearchObjectiveEvent
(net.minecraft.server.level.ServerPlayer player, PlayerResearch research, PlayerResearchStage stage, PlayerResearchObjective objective, InteractionEvent event, InteractionContext context) -
Method Summary
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
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, InteractionEvent event, InteractionContext 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.Post
event.- Returns:
true
if the objective will be completed after the event is fired,false
otherwise
-