Class RewardManager

java.lang.Object
com.ordwen.odailyquests.rewards.RewardManager

public class RewardManager extends Object
The RewardManager class is responsible for handling and delivering quest rewards to players.

Rewards can be of multiple types (commands, experience, money, points, custom plugins like CoinsEngine). This class centralizes the logic for giving those rewards and ensures that error handling and placeholder replacements are consistently applied.

Responsibilities:

  • Send quest completion notifications (titles, action bars, toasts, messages).
  • Dispatch rewards depending on their RewardType.
  • Integrate with third-party APIs (Vault, TokenManager, PlayerPoints, CoinsEngine).
  • Provide error handling when required plugins are missing or misconfigured.

This class cannot be instantiated and exposes only static methods.

  • Method Details

    • sendQuestRewardItems

      public static void sendQuestRewardItems(String questName, org.bukkit.entity.Player player, Reward reward, Progression progression)
      Sends all the visual feedback and actual reward items to a player when they achieve a quest.
      Parameters:
      questName - the name of the quest
      player - the player receiving the reward
      reward - the reward configuration
      progression - the progression object used to populate placeholders
    • sendReward

      public static void sendReward(org.bukkit.entity.Player player, Reward reward, Map<String,String> placeholders)
      Sends the configured reward to the player.
      Parameters:
      player - the player receiving the reward
      reward - the reward configuration
      placeholders - optional placeholders to expand in command or message rewards