Class QuestObjectiveEventHandler

java.lang.Object
com.minecolonies.core.event.QuestObjectiveEventHandler

public class QuestObjectiveEventHandler extends Object
This class handles all permission checks on events and cancels them if needed.
  • 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

      public static void onResearchComplete(IColony colony, net.minecraft.resources.ResourceLocation id)
      Research complete event.
      Parameters:
      colony - the colony the research happened in.
      id - the research id.
    • onBuildingUpgradeComplete

      public static void onBuildingUpgradeComplete(IBuilding building, int level)
      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.