Class ConfigRewardPool
java.lang.Object
co.crystaldev.alpinecore.framework.config.object.ConfigRewardPool
A simple implementation of a random loot pool compatible with
AlpineConfig
.
Each draw will produce random a number between 0 and 100 for
each ConfigRewardPool.Entry
. If that number is less than or equal to
it's chance, the reward is given.
- Since:
- 0.1.0
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents a possible reward. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
drawForPlayer
(org.bukkit.entity.Player player) Draw rewards for a given player.void
drawForPlayer
(org.bukkit.entity.Player player, Consumer<String> callback) Draw rewards for a given player with a callback for each granted reward.void
drawForPlayer
(org.bukkit.entity.Player player, Map<String, Object> placeholders) Draw rewards for a given player with placeholders to format the commands with.void
drawForPlayer
(org.bukkit.entity.Player player, Map<String, Object> placeholders, Consumer<String> callback) Draw rewards for a given player with placeholders to format the commands with and a callback for each granted reward.
-
Constructor Details
-
ConfigRewardPool
public ConfigRewardPool()
-
-
Method Details
-
drawForPlayer
public void drawForPlayer(org.bukkit.entity.Player player) Draw rewards for a given player.- Parameters:
player
- The player
-
drawForPlayer
Draw rewards for a given player with a callback for each granted reward.- Parameters:
player
- The playercallback
- The callback
-
drawForPlayer
Draw rewards for a given player with placeholders to format the commands with.- Parameters:
player
- The playerplaceholders
- The placeholders
-
drawForPlayer
public void drawForPlayer(org.bukkit.entity.Player player, Map<String, Object> placeholders, Consumer<String> callback) Draw rewards for a given player with placeholders to format the commands with and a callback for each granted reward.- Parameters:
player
- The playerplaceholders
- The placeholderscallback
- The callback
-