Package com.minecolonies.core.event
Class QuestObjectiveEventHandler
java.lang.Object
com.minecolonies.core.event.QuestObjectiveEventHandler
This class handles all permission checks on events and cancels them if needed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddKillQuestObjectiveListener(net.minecraft.world.entity.EntityType<?> entityToKill, UUID assignedPlayer, IQuestInstance colonyQuest) Add an objective listener to this event handler.static voidaddQuestMineObjectiveListener(net.minecraft.world.level.block.Block blockToMine, UUID assignedPlayer, IQuestInstance colonyQuest) Add an objective listener for block mining to this event handler.static voidaddQuestPlaceObjectiveListener(net.minecraft.world.level.block.Block blockToPlace, UUID assignedPlayer, IQuestInstance colonyQuest) Add an objective listener for block placement to this event handler.static voidon(net.neoforged.neoforge.event.entity.living.LivingDeathEvent event) static voidon(net.neoforged.neoforge.event.level.BlockEvent.BreakEvent event) BlockEvent.BreakEvent handler.static voidon(net.neoforged.neoforge.event.level.BlockEvent.EntityPlaceEvent event) BlockEvent.Place handler.static voidonBuildingUpgradeComplete(IBuilding building, int level) Building upgrade handling.static voidonResearchComplete(IColony colony, net.minecraft.resources.ResourceLocation id) Research complete event.static voidremoveKillQuestObjectiveListener(net.minecraft.world.entity.EntityType<?> entityToKill, UUID assignedPlayer, IQuestInstance colonyQuest) Remove an objective listener to this event handler.static voidremoveQuestMineObjectiveListener(net.minecraft.world.level.block.Block blockToMine, UUID assignedPlayer, IQuestInstance colonyQuest) Remove an objective listener to this event handler.static voidremoveQuestPlaceBlockObjectiveListener(net.minecraft.world.level.block.Block blockToPlace, UUID assignedPlayer, IQuestInstance colonyQuest) Remove an objective listener for block placement to this event handler.static voidstopTrackingBuildingLevelUp(@NotNull BuildingEntry buildingEntry, @NotNull IQuestInstance colonyQuest) Stop tracking building leveling.static voidstopTrackingResearch(@NotNull net.minecraft.resources.ResourceLocation researchId, @NotNull IQuestInstance colonyQuest) Stop tracking research.static voidtrackBuildingLevelUp(@NotNull BuildingEntry buildingEntry, @NotNull IQuestInstance colonyQuest) Track building leveling.static voidtrackResearch(net.minecraft.resources.ResourceLocation researchId, IQuestInstance colonyQuest) Track research.
-
Constructor Details
-
QuestObjectiveEventHandler
public QuestObjectiveEventHandler()
-
-
Method Details
-
on
public static void on(net.neoforged.neoforge.event.level.BlockEvent.BreakEvent event) BlockEvent.BreakEvent handler.- Parameters:
event- BlockEvent.BreakEvent
-
on
public static void on(net.neoforged.neoforge.event.entity.living.LivingDeathEvent event) -
on
public static void on(net.neoforged.neoforge.event.level.BlockEvent.EntityPlaceEvent event) BlockEvent.Place handler.- Parameters:
event- BlockEvent.BreakEvent
-
addQuestMineObjectiveListener
public static void addQuestMineObjectiveListener(net.minecraft.world.level.block.Block blockToMine, UUID assignedPlayer, IQuestInstance colonyQuest) Add an objective listener for block mining to this event handler.- Parameters:
blockToMine- the block that we listen for.assignedPlayer- the player we check for.colonyQuest- the colony quest it is related to.
-
removeQuestMineObjectiveListener
public static void removeQuestMineObjectiveListener(net.minecraft.world.level.block.Block blockToMine, UUID assignedPlayer, IQuestInstance colonyQuest) Remove an objective listener to this event handler.- Parameters:
blockToMine- the block that we listen for.assignedPlayer- the player we check for.colonyQuest- the colony quest it is related to.
-
addQuestPlaceObjectiveListener
public static void addQuestPlaceObjectiveListener(net.minecraft.world.level.block.Block blockToPlace, UUID assignedPlayer, IQuestInstance colonyQuest) Add an objective listener for block placement to this event handler.- Parameters:
blockToPlace- the block that we listen for.assignedPlayer- the player we check for.colonyQuest- the colony quest it is related to.
-
removeQuestPlaceBlockObjectiveListener
public static void removeQuestPlaceBlockObjectiveListener(net.minecraft.world.level.block.Block blockToPlace, UUID assignedPlayer, IQuestInstance colonyQuest) Remove an objective listener for block placement to this event handler.- Parameters:
blockToPlace- the block that we listen for.assignedPlayer- the player we check for.colonyQuest- the colony quest it is related to.
-
addKillQuestObjectiveListener
public static void addKillQuestObjectiveListener(net.minecraft.world.entity.EntityType<?> entityToKill, UUID assignedPlayer, IQuestInstance colonyQuest) Add an objective listener to this event handler.- Parameters:
entityToKill- the entity type that we listen for.assignedPlayer- the player we check for.colonyQuest- the colony quest it is related to.
-
removeKillQuestObjectiveListener
public static void removeKillQuestObjectiveListener(net.minecraft.world.entity.EntityType<?> entityToKill, UUID assignedPlayer, IQuestInstance colonyQuest) Remove an objective listener to this event handler.- Parameters:
entityToKill- the entity type that we listen for.assignedPlayer- the player we check for.colonyQuest- the colony quest it is related to.
-
onResearchComplete
Research complete event.- Parameters:
colony- the colony the research happened in.id- the research id.
-
onBuildingUpgradeComplete
Building upgrade handling.- Parameters:
building- the building being upgraded.level- its level.
-
trackBuildingLevelUp
public static void trackBuildingLevelUp(@NotNull @NotNull BuildingEntry buildingEntry, @NotNull @NotNull IQuestInstance colonyQuest) Track building leveling.- Parameters:
buildingEntry- the building to track.colonyQuest- the quest tracking it.
-
stopTrackingBuildingLevelUp
public static void stopTrackingBuildingLevelUp(@NotNull @NotNull BuildingEntry buildingEntry, @NotNull @NotNull IQuestInstance colonyQuest) Stop tracking building leveling.- Parameters:
buildingEntry- the building to stop tracking.colonyQuest- the quest tracking it.
-
trackResearch
public static void trackResearch(net.minecraft.resources.ResourceLocation researchId, IQuestInstance colonyQuest) Track research.- Parameters:
researchId- the research to track.colonyQuest- the quest tracking it.
-
stopTrackingResearch
public static void stopTrackingResearch(@NotNull @NotNull net.minecraft.resources.ResourceLocation researchId, @NotNull @NotNull IQuestInstance colonyQuest) Stop tracking research.- Parameters:
researchId- the research to stop tracking.colonyQuest- the quest tracking it.
-