Class ConfigRewardPool

java.lang.Object
co.crystaldev.alpinecore.framework.config.object.ConfigRewardPool

public class ConfigRewardPool extends Object
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:
  • 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

      public void drawForPlayer(org.bukkit.entity.Player player, Consumer<String> callback)
      Draw rewards for a given player with a callback for each granted reward.
      Parameters:
      player - The player
      callback - The callback
    • drawForPlayer

      public void drawForPlayer(org.bukkit.entity.Player player, Map<String,Object> placeholders)
      Draw rewards for a given player with placeholders to format the commands with.
      Parameters:
      player - The player
      placeholders - 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 player
      placeholders - The placeholders
      callback - The callback