{levels} placeholder

This commit is contained in:
hyperdefined
2025-05-15 18:13:47 -04:00
parent c7cd25e866
commit 68318e3af2
2 changed files with 19 additions and 0 deletions

View File

@@ -244,6 +244,13 @@ public class ConfigTools {
List<Component> finalLore = new ArrayList<>(); List<Component> finalLore = new ArrayList<>();
for (String line : raw) { for (String line : raw) {
if (line.contains("{levels}")) {
Integer levels = toolStats.config.getInt("tokes.data." + tokenType + ".levels");
// will return 0 if it doesn't exist
if (levels != 0) {
line = line.replace("{levels}", String.valueOf(levels));
}
}
Component component; Component component;
// if we match the old color codes, then format them as so // if we match the old color codes, then format them as so
Matcher hexMatcher = CONFIG_HEX_PATTERN.matcher(line); Matcher hexMatcher = CONFIG_HEX_PATTERN.matcher(line);

View File

@@ -8,6 +8,7 @@ tokens:
title: "&7ToolStats: &8Player Kills Token" title: "&7ToolStats: &8Player Kills Token"
lore: lore:
- "&8Combine with a melee or ranged weapon in an anvil to track player kills." - "&8Combine with a melee or ranged weapon in an anvil to track player kills."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -17,6 +18,7 @@ tokens:
title: "&7ToolStats: &8Mob Kills Token" title: "&7ToolStats: &8Mob Kills Token"
lore: lore:
- "&8Combine with a melee or ranged weapon in an anvil to track mob kills." - "&8Combine with a melee or ranged weapon in an anvil to track mob kills."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -26,6 +28,7 @@ tokens:
title: "&7ToolStats: &8Blocks Mined Token" title: "&7ToolStats: &8Blocks Mined Token"
lore: lore:
- "&8Combine with a pickaxe, axe, shovel, or shears in an anvil to track blocks mined." - "&8Combine with a pickaxe, axe, shovel, or shears in an anvil to track blocks mined."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -35,6 +38,7 @@ tokens:
title: "&7ToolStats: &8Crops Mined Token" title: "&7ToolStats: &8Crops Mined Token"
lore: lore:
- "&8Combine with a hoe in an anvil to track crops broken." - "&8Combine with a hoe in an anvil to track crops broken."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -44,6 +48,7 @@ tokens:
title: "&7ToolStats: &8Fish Caught Token" title: "&7ToolStats: &8Fish Caught Token"
lore: lore:
- "&8Combine with a fishing rod in an anvil to track fish caught." - "&8Combine with a fishing rod in an anvil to track fish caught."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -53,6 +58,7 @@ tokens:
title: "&7ToolStats: &8Sheep Sheared Token" title: "&7ToolStats: &8Sheep Sheared Token"
lore: lore:
- "&8Combine with shears in an anvil to track sheep sheared." - "&8Combine with shears in an anvil to track sheep sheared."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -62,6 +68,7 @@ tokens:
title: "&7ToolStats: &8Damage Taken Token" title: "&7ToolStats: &8Damage Taken Token"
lore: lore:
- "&8Combine with an armor piece in an anvil to track damage taken." - "&8Combine with an armor piece in an anvil to track damage taken."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -71,6 +78,7 @@ tokens:
title: "&7ToolStats: &8Damage Done Token" title: "&7ToolStats: &8Damage Done Token"
lore: lore:
- "&8Combine with a melee or ranged weapon in an anvil to track damage done." - "&8Combine with a melee or ranged weapon in an anvil to track damage done."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -80,6 +88,7 @@ tokens:
title: "&7ToolStats: &8Arrows Shot Token" title: "&7ToolStats: &8Arrows Shot Token"
lore: lore:
- "&8Combine with a bow or crossbow in an anvil to track arrows shot." - "&8Combine with a bow or crossbow in an anvil to track arrows shot."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -89,6 +98,7 @@ tokens:
title: "&7ToolStats: &8Flight Time Token" title: "&7ToolStats: &8Flight Time Token"
lore: lore:
- "&8Combine with an elytra in an anvil to track flight time." - "&8Combine with an elytra in an anvil to track flight time."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -98,6 +108,7 @@ tokens:
title: "&7ToolStats: &8Reset Token" title: "&7ToolStats: &8Reset Token"
lore: lore:
- "&8Combine in an anvil with to reset ALL stats for this item. Tokens on this item stay." - "&8Combine in an anvil with to reset ALL stats for this item. Tokens on this item stay."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false
@@ -107,6 +118,7 @@ tokens:
title: "&7ToolStats: &8Remove Token" title: "&7ToolStats: &8Remove Token"
lore: lore:
- "&8Combine in an anvil with to REMOVE ALL stats and tokens for this item." - "&8Combine in an anvil with to REMOVE ALL stats and tokens for this item."
- "&8Uses &7{levels} &8level."
levels: 1 levels: 1
custom-model-data: custom-model-data:
enabled: false enabled: false