Class PlayerProgressor

java.lang.Object
com.ordwen.odailyquests.quests.player.progression.PlayerProgressor
Direct Known Subclasses:
AbstractQuest, BlockBreakListener, BlockDropItemListener, BlockPlaceListener, BucketFillListener, ClickableChecker, CraftItemListener, CrateOpenListener, CropBreakListener, CustomBlockBreakListener, CustomFurnaceExtractListener, EliteMobDeathListener, EnchantItemListener, EntityBreedListener, EntityDeathListener, EntityTameListener, FishingLootSpawnListener, FurnaceExtractListener, MythicMobDeathListener, PickupItemListener, PlayerExpChangeListener, PlayerFishListener, PlayerHarvestBlockListener, PlayerInteractListener, PlayerItemConsumeListener, PlayerLevelChangeListener, PlayerRespawnListener, ProjectileHitListener, ProjectileLaunchListener, RoseStackerListener, ShearEntityListener, SmithItemListener, VotifierListener, WildStackerListener

public class PlayerProgressor extends Object
Manages the progression of a player's quests.

This class provides methods to track and update the progression of quests for players, including checking progress, executing actions when a quest is completed, and handling various conditions like world, region, and permissions for progression.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    actionQuest(org.bukkit.entity.Player player, Progression progression, AbstractQuest quest, int amount)
    Raises the QuestProgressEvent event and determines whether to perform progress based on the event result.
    int
    fits(org.bukkit.inventory.ItemStack stack, org.bukkit.inventory.ItemStack[] contents)
     
    boolean
    isAllowedToProgress(org.bukkit.entity.Player player, AbstractQuest quest)
    Execute all the checks to determine if the player is allowed to progress in the quest.
    boolean
    movingItem(org.bukkit.inventory.ItemStack result, int recipeAmount, org.bukkit.entity.Player player, org.bukkit.event.inventory.ClickType click)
    Checks if the player is moving an item.
    void
    setPlayerQuestProgression(org.bukkit.event.Event event, org.bukkit.entity.Player player, int amount, String questType)
    Set the player's progression for a specific quest type

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PlayerProgressor

      public PlayerProgressor()
  • Method Details

    • setPlayerQuestProgression

      public void setPlayerQuestProgression(org.bukkit.event.Event event, org.bukkit.entity.Player player, int amount, String questType)
      Set the player's progression for a specific quest type
      Parameters:
      player - the player to set the progression for
      amount - the amount to set the progression to
      questType - the quest type to set the progression for
    • actionQuest

      public void actionQuest(org.bukkit.entity.Player player, Progression progression, AbstractQuest quest, int amount)
      Raises the QuestProgressEvent event and determines whether to perform progress based on the event result.
      Parameters:
      player - involved player
      progression - player's progression
      quest - quest to be progressed
      amount - amount of progression
    • isAllowedToProgress

      public boolean isAllowedToProgress(org.bukkit.entity.Player player, AbstractQuest quest)
      Execute all the checks to determine if the player is allowed to progress in the quest. This includes checking if the player is in the required world and region.
      Parameters:
      player - the player to check.
      quest - the quest to check.
      Returns:
      true if the player is allowed to progress.
    • fits

      public int fits(org.bukkit.inventory.ItemStack stack, org.bukkit.inventory.ItemStack[] contents)
      Parameters:
      stack - the item to check.
      contents - the inventory contents to compare.
      Returns:
      the amount of items that can be added to the inventory.
    • movingItem

      public boolean movingItem(org.bukkit.inventory.ItemStack result, int recipeAmount, org.bukkit.entity.Player player, org.bukkit.event.inventory.ClickType click)
      Checks if the player is moving an item.
      Parameters:
      result - the result item.
      recipeAmount - the amount of items in the recipe.
      player - the player to check.
      click - the click type.
      Returns:
      true if the player is moving an item.