Added %weight% and %actual_weight% as reward placeholders
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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%%"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user