Added %weight% and %actual_weight% as reward placeholders

This commit is contained in:
Auxilor
2022-04-17 13:01:03 +01:00
parent 6e0dc31e60
commit 4e541807fc
2 changed files with 8 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ import org.bukkit.Material
import org.bukkit.OfflinePlayer
import org.bukkit.entity.Player
import org.bukkit.inventory.ItemStack
import java.util.*
import java.util.Objects
class Reward(
private val plugin: EcoPlugin,
@@ -64,6 +64,12 @@ class Reward(
).replace(
"%actual_chance%",
getPercentageChance(player, crate.rewards, displayWeight = false).toNiceString()
).replace(
"%weight%",
this.getDisplayWeight(player).toNiceString()
).replace(
"%actual_weight%",
this.getWeight(player).toNiceString()
).formatEco(player)
}
return item

View File

@@ -12,7 +12,7 @@ rewards:
display: # The display item shown in animations and GUIs
name: "&bDiamond Sword" # The item name
item: diamond_sword sharpness:5 unbreaking:3 # The shown item
lore: # Can use %chance% and %actual_chance% as placeholders
lore: # Can use %chance%, %actual_chance%, %weight%, and %actual_weight% as placeholders
- "&fDisplay Chance: &a%chance%%"
- "&fActual Chance: &a%actual_chance%%"