Package com.ordwen.odailyquests.rewards
Class RewardManager
java.lang.Object
com.ordwen.odailyquests.rewards.RewardManager
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 Summary
Modifier and TypeMethodDescriptionstatic 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.static void
sendReward
(org.bukkit.entity.Player player, Reward reward, Map<String, String> placeholders) Sends the configured reward to the player.
-
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 questplayer
- the player receiving the rewardreward
- the reward configurationprogression
- 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 rewardreward
- the reward configurationplaceholders
- optional placeholders to expand in command or message rewards
-