mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-06 06:41:44 +00:00
@@ -25,7 +25,6 @@ import lol.hyper.toolstats.events.*;
|
|||||||
import lol.hyper.toolstats.tools.*;
|
import lol.hyper.toolstats.tools.*;
|
||||||
import lol.hyper.toolstats.tools.config.ConfigTools;
|
import lol.hyper.toolstats.tools.config.ConfigTools;
|
||||||
import lol.hyper.toolstats.tools.config.ConfigUpdater;
|
import lol.hyper.toolstats.tools.config.ConfigUpdater;
|
||||||
import lol.hyper.toolstats.tools.config.TokenItems;
|
|
||||||
import org.bstats.bukkit.Metrics;
|
import org.bstats.bukkit.Metrics;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
@@ -150,8 +149,7 @@ public final class ToolStats extends JavaPlugin {
|
|||||||
public ItemChecker itemChecker;
|
public ItemChecker itemChecker;
|
||||||
public ShootBow shootBow;
|
public ShootBow shootBow;
|
||||||
public ConfigTools configTools;
|
public ConfigTools configTools;
|
||||||
public TokenItems tokenItems;
|
public TokenData tokenData;
|
||||||
public TokenCrafting tokenCrafting;
|
|
||||||
public AnvilEvent anvilEvent;
|
public AnvilEvent anvilEvent;
|
||||||
public PrepareCraft prepareCraft;
|
public PrepareCraft prepareCraft;
|
||||||
|
|
||||||
@@ -164,10 +162,9 @@ public final class ToolStats extends JavaPlugin {
|
|||||||
|
|
||||||
loadConfig();
|
loadConfig();
|
||||||
configTools = new ConfigTools(this);
|
configTools = new ConfigTools(this);
|
||||||
tokenItems = new TokenItems(this);
|
tokenData = new TokenData(this);
|
||||||
tokenCrafting = new TokenCrafting(this);
|
tokenData.setup();
|
||||||
tokenCrafting.setup();
|
for (ShapedRecipe recipe : tokenData.getRecipes()) {
|
||||||
for (ShapedRecipe recipe : tokenCrafting.getRecipes()) {
|
|
||||||
if (tokens && config.getBoolean("tokens.craft-tokens")) {
|
if (tokens && config.getBoolean("tokens.craft-tokens")) {
|
||||||
Bukkit.addRecipe(recipe);
|
Bukkit.addRecipe(recipe);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@ import org.bukkit.command.ConsoleCommandSender;
|
|||||||
import org.bukkit.command.TabExecutor;
|
import org.bukkit.command.TabExecutor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
|
||||||
import org.bukkit.inventory.ShapedRecipe;
|
import org.bukkit.inventory.ShapedRecipe;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.persistence.PersistentDataContainer;
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
@@ -64,8 +63,8 @@ public class CommandToolStats implements TabExecutor {
|
|||||||
if (sender.hasPermission("toolstats.reload")) {
|
if (sender.hasPermission("toolstats.reload")) {
|
||||||
boolean oldTokensStatus = toolStats.tokens;
|
boolean oldTokensStatus = toolStats.tokens;
|
||||||
toolStats.loadConfig();
|
toolStats.loadConfig();
|
||||||
toolStats.tokenCrafting.getRecipes().clear();
|
toolStats.tokenData.getRecipes().clear();
|
||||||
toolStats.tokenCrafting.setup();
|
toolStats.tokenData.setup();
|
||||||
// if the server went from tokens off -> on, add the recipes
|
// if the server went from tokens off -> on, add the recipes
|
||||||
// if the server went from tokens on -> off, remove the recipes
|
// if the server went from tokens on -> off, remove the recipes
|
||||||
if (toolStats.tokens != oldTokensStatus) {
|
if (toolStats.tokens != oldTokensStatus) {
|
||||||
@@ -73,14 +72,14 @@ public class CommandToolStats implements TabExecutor {
|
|||||||
if (toolStats.tokens) {
|
if (toolStats.tokens) {
|
||||||
sender.sendMessage(Component.text("It looks like you ENABLED the token system. While this is fine, it can break. Please restart your server instead.", NamedTextColor.YELLOW));
|
sender.sendMessage(Component.text("It looks like you ENABLED the token system. While this is fine, it can break. Please restart your server instead.", NamedTextColor.YELLOW));
|
||||||
if (toolStats.config.getBoolean("tokens.craft-token")) {
|
if (toolStats.config.getBoolean("tokens.craft-token")) {
|
||||||
for (ShapedRecipe recipe : toolStats.tokenCrafting.getRecipes()) {
|
for (ShapedRecipe recipe : toolStats.tokenData.getRecipes()) {
|
||||||
Bukkit.addRecipe(recipe);
|
Bukkit.addRecipe(recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// tokens are now disabled
|
// tokens are now disabled
|
||||||
sender.sendMessage(Component.text("It looks like you DISABLED the token system. While this is fine, it can break. Please restart your server instead.", NamedTextColor.YELLOW));
|
sender.sendMessage(Component.text("It looks like you DISABLED the token system. While this is fine, it can break. Please restart your server instead.", NamedTextColor.YELLOW));
|
||||||
for (ShapedRecipe recipe : toolStats.tokenCrafting.getRecipes()) {
|
for (ShapedRecipe recipe : toolStats.tokenData.getRecipes()) {
|
||||||
Bukkit.removeRecipe(recipe.getKey());
|
Bukkit.removeRecipe(recipe.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,7 +171,7 @@ public class CommandToolStats implements TabExecutor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
String tokenType = args[2];
|
String tokenType = args[2];
|
||||||
if (!toolStats.tokenCrafting.getTokenTypes().contains(tokenType)) {
|
if (!toolStats.tokenData.getTokenTypes().contains(tokenType)) {
|
||||||
sender.sendMessage(Component.text("Invalid token type.", NamedTextColor.RED));
|
sender.sendMessage(Component.text("Invalid token type.", NamedTextColor.RED));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -458,80 +457,9 @@ public class CommandToolStats implements TabExecutor {
|
|||||||
* @param tokenType The token type.
|
* @param tokenType The token type.
|
||||||
*/
|
*/
|
||||||
private void giveToken(Player target, String tokenType, int amount) {
|
private void giveToken(Player target, String tokenType, int amount) {
|
||||||
switch (tokenType) {
|
ItemStack token = toolStats.tokenData.createToken(tokenType);
|
||||||
case "crops-mined": {
|
token.setAmount(amount);
|
||||||
ItemStack itemStack = toolStats.tokenItems.cropsMined();
|
target.getInventory().addItem(token);
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "blocks-mined": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.blocksMined();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "damage-taken": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.damageTaken();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "damage-done": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.damageDone();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "mob-kills": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.mobKills();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "player-kills": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.playerKills();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "arrows-shot": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.arrowsShot();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "sheep-sheared": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.sheepSheared();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "flight-time": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.flightTime();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "fish-caught": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.fishCaught();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "reset": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.resetToken();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "remove": {
|
|
||||||
ItemStack itemStack = toolStats.tokenItems.removeToken();
|
|
||||||
itemStack.setAmount(amount);
|
|
||||||
target.getInventory().addItem(itemStack);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1154,20 +1082,20 @@ public class CommandToolStats implements TabExecutor {
|
|||||||
}
|
}
|
||||||
if (args.length == 2 && args[0].equalsIgnoreCase("edit") && sender.hasPermission("toolstats.edit")) {
|
if (args.length == 2 && args[0].equalsIgnoreCase("edit") && sender.hasPermission("toolstats.edit")) {
|
||||||
// yes I am lazy
|
// yes I am lazy
|
||||||
return toolStats.tokenCrafting.getTokenTypes().stream()
|
return toolStats.tokenData.getTokenTypes().stream()
|
||||||
.filter(s -> !s.equals("remove") && !s.equals("reset"))
|
.filter(s -> !s.equals("remove") && !s.equals("reset"))
|
||||||
.map(s -> s.equals("crops-mined") ? "crops-harvested" : s)
|
.map(s -> s.equals("crops-mined") ? "crops-harvested" : s)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
if (args.length == 2 && args[0].equalsIgnoreCase("remove") && sender.hasPermission("toolstats.remove")) {
|
if (args.length == 2 && args[0].equalsIgnoreCase("remove") && sender.hasPermission("toolstats.remove")) {
|
||||||
// yes I am lazy
|
// yes I am lazy
|
||||||
return toolStats.tokenCrafting.getTokenTypes().stream()
|
return toolStats.tokenData.getTokenTypes().stream()
|
||||||
.filter(s -> !s.equals("remove") && !s.equals("reset"))
|
.filter(s -> !s.equals("remove") && !s.equals("reset"))
|
||||||
.map(s -> s.equals("crops-mined") ? "crops-harvested" : s)
|
.map(s -> s.equals("crops-mined") ? "crops-harvested" : s)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
if (args.length == 3 && args[0].equalsIgnoreCase("givetokens") && sender.hasPermission("toolstats.givetokens")) {
|
if (args.length == 3 && args[0].equalsIgnoreCase("givetokens") && sender.hasPermission("toolstats.givetokens")) {
|
||||||
return toolStats.tokenCrafting.getTokenTypes();
|
return toolStats.tokenData.getTokenTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -17,104 +17,111 @@
|
|||||||
|
|
||||||
package lol.hyper.toolstats.tools;
|
package lol.hyper.toolstats.tools;
|
||||||
|
|
||||||
|
import io.papermc.paper.datacomponent.DataComponentTypes;
|
||||||
|
import io.papermc.paper.datacomponent.item.CustomModelData;
|
||||||
import lol.hyper.toolstats.ToolStats;
|
import lol.hyper.toolstats.ToolStats;
|
||||||
|
import net.kyori.adventure.text.Component;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.ShapedRecipe;
|
import org.bukkit.inventory.ShapedRecipe;
|
||||||
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
import org.bukkit.inventory.meta.components.CustomModelDataComponent;
|
||||||
|
import org.bukkit.persistence.PersistentDataContainer;
|
||||||
|
import org.bukkit.persistence.PersistentDataType;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
public class TokenCrafting {
|
public class TokenData {
|
||||||
|
|
||||||
private final ToolStats toolStats;
|
private final ToolStats toolStats;
|
||||||
private final Set<ShapedRecipe> recipes = new HashSet<>();
|
private final Set<ShapedRecipe> recipes = new HashSet<>();
|
||||||
private final ArrayList<String> tokenTypes = new ArrayList<>();
|
private final ArrayList<String> tokenTypes = new ArrayList<>();
|
||||||
|
|
||||||
public TokenCrafting(ToolStats toolStats) {
|
public TokenData(ToolStats toolStats) {
|
||||||
this.toolStats = toolStats;
|
this.toolStats = toolStats;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setup() {
|
public void setup() {
|
||||||
NamespacedKey playerKillsKey = new NamespacedKey(toolStats, "player-kills-token");
|
NamespacedKey playerKillsKey = new NamespacedKey(toolStats, "player-kills-token");
|
||||||
ShapedRecipe playerKillRecipe = new ShapedRecipe(playerKillsKey, toolStats.tokenItems.playerKills());
|
ShapedRecipe playerKillRecipe = new ShapedRecipe(playerKillsKey, createToken("player-kills"));
|
||||||
playerKillRecipe.shape(" P ", "PSP", " P ");
|
playerKillRecipe.shape(" P ", "PSP", " P ");
|
||||||
playerKillRecipe.setIngredient('P', Material.PAPER);
|
playerKillRecipe.setIngredient('P', Material.PAPER);
|
||||||
playerKillRecipe.setIngredient('S', Material.WOODEN_SWORD);
|
playerKillRecipe.setIngredient('S', Material.WOODEN_SWORD);
|
||||||
recipes.add(playerKillRecipe);
|
recipes.add(playerKillRecipe);
|
||||||
|
|
||||||
NamespacedKey mobKillsKey = new NamespacedKey(toolStats, "mob-kills-token");
|
NamespacedKey mobKillsKey = new NamespacedKey(toolStats, "mob-kills-token");
|
||||||
ShapedRecipe mobKillsRecipe = new ShapedRecipe(mobKillsKey, toolStats.tokenItems.mobKills());
|
ShapedRecipe mobKillsRecipe = new ShapedRecipe(mobKillsKey, createToken("mob-kills"));
|
||||||
mobKillsRecipe.shape(" P ", "PRP", " P ");
|
mobKillsRecipe.shape(" P ", "PRP", " P ");
|
||||||
mobKillsRecipe.setIngredient('P', Material.PAPER);
|
mobKillsRecipe.setIngredient('P', Material.PAPER);
|
||||||
mobKillsRecipe.setIngredient('R', Material.ROTTEN_FLESH);
|
mobKillsRecipe.setIngredient('R', Material.ROTTEN_FLESH);
|
||||||
recipes.add(mobKillsRecipe);
|
recipes.add(mobKillsRecipe);
|
||||||
|
|
||||||
NamespacedKey blocksMinedKey = new NamespacedKey(toolStats, "blocks-mined-token");
|
NamespacedKey blocksMinedKey = new NamespacedKey(toolStats, "blocks-mined-token");
|
||||||
ShapedRecipe blocksMinedRecipe = new ShapedRecipe(blocksMinedKey, toolStats.tokenItems.blocksMined());
|
ShapedRecipe blocksMinedRecipe = new ShapedRecipe(blocksMinedKey, createToken("blocks-mined"));
|
||||||
blocksMinedRecipe.shape(" P ", "PSP", " P ");
|
blocksMinedRecipe.shape(" P ", "PSP", " P ");
|
||||||
blocksMinedRecipe.setIngredient('P', Material.PAPER);
|
blocksMinedRecipe.setIngredient('P', Material.PAPER);
|
||||||
blocksMinedRecipe.setIngredient('S', Material.WOODEN_PICKAXE);
|
blocksMinedRecipe.setIngredient('S', Material.WOODEN_PICKAXE);
|
||||||
recipes.add(blocksMinedRecipe);
|
recipes.add(blocksMinedRecipe);
|
||||||
|
|
||||||
NamespacedKey cropsMinedKey = new NamespacedKey(toolStats, "crops-mined-token");
|
NamespacedKey cropsMinedKey = new NamespacedKey(toolStats, "crops-mined-token");
|
||||||
ShapedRecipe cropsMinedRecipe = new ShapedRecipe(cropsMinedKey, toolStats.tokenItems.cropsMined());
|
ShapedRecipe cropsMinedRecipe = new ShapedRecipe(cropsMinedKey, createToken("crops-mined"));
|
||||||
cropsMinedRecipe.shape(" P ", "PHP", " P ");
|
cropsMinedRecipe.shape(" P ", "PHP", " P ");
|
||||||
cropsMinedRecipe.setIngredient('P', Material.PAPER);
|
cropsMinedRecipe.setIngredient('P', Material.PAPER);
|
||||||
cropsMinedRecipe.setIngredient('H', Material.WOODEN_HOE);
|
cropsMinedRecipe.setIngredient('H', Material.WOODEN_HOE);
|
||||||
recipes.add(cropsMinedRecipe);
|
recipes.add(cropsMinedRecipe);
|
||||||
|
|
||||||
NamespacedKey fishCaughtKey = new NamespacedKey(toolStats, "fish-caught-token");
|
NamespacedKey fishCaughtKey = new NamespacedKey(toolStats, "fish-caught-token");
|
||||||
ShapedRecipe fishCaughtRecipe = new ShapedRecipe(fishCaughtKey, toolStats.tokenItems.fishCaught());
|
ShapedRecipe fishCaughtRecipe = new ShapedRecipe(fishCaughtKey, createToken("fish-caught"));
|
||||||
fishCaughtRecipe.shape(" P ", "PCP", " P ");
|
fishCaughtRecipe.shape(" P ", "PCP", " P ");
|
||||||
fishCaughtRecipe.setIngredient('P', Material.PAPER);
|
fishCaughtRecipe.setIngredient('P', Material.PAPER);
|
||||||
fishCaughtRecipe.setIngredient('C', Material.COD);
|
fishCaughtRecipe.setIngredient('C', Material.COD);
|
||||||
recipes.add(fishCaughtRecipe);
|
recipes.add(fishCaughtRecipe);
|
||||||
|
|
||||||
NamespacedKey sheepShearedKey = new NamespacedKey(toolStats, "sheep-sheared-token");
|
NamespacedKey sheepShearedKey = new NamespacedKey(toolStats, "sheep-sheared-token");
|
||||||
ShapedRecipe sheepShearedRecipe = new ShapedRecipe(sheepShearedKey, toolStats.tokenItems.sheepSheared());
|
ShapedRecipe sheepShearedRecipe = new ShapedRecipe(sheepShearedKey, createToken("sheep-sheared"));
|
||||||
sheepShearedRecipe.shape(" P ", "PWP", " P ");
|
sheepShearedRecipe.shape(" P ", "PWP", " P ");
|
||||||
sheepShearedRecipe.setIngredient('P', Material.PAPER);
|
sheepShearedRecipe.setIngredient('P', Material.PAPER);
|
||||||
sheepShearedRecipe.setIngredient('W', Material.WHITE_WOOL);
|
sheepShearedRecipe.setIngredient('W', Material.WHITE_WOOL);
|
||||||
recipes.add(sheepShearedRecipe);
|
recipes.add(sheepShearedRecipe);
|
||||||
|
|
||||||
NamespacedKey armorDamageKey = new NamespacedKey(toolStats, "damage-taken-token");
|
NamespacedKey armorDamageKey = new NamespacedKey(toolStats, "damage-taken-token");
|
||||||
ShapedRecipe armorDamageRecipe = new ShapedRecipe(armorDamageKey, toolStats.tokenItems.damageTaken());
|
ShapedRecipe armorDamageRecipe = new ShapedRecipe(armorDamageKey, createToken("damage-taken"));
|
||||||
armorDamageRecipe.shape(" P ", "PCP", " P ");
|
armorDamageRecipe.shape(" P ", "PCP", " P ");
|
||||||
armorDamageRecipe.setIngredient('P', Material.PAPER);
|
armorDamageRecipe.setIngredient('P', Material.PAPER);
|
||||||
armorDamageRecipe.setIngredient('C', Material.LEATHER_CHESTPLATE);
|
armorDamageRecipe.setIngredient('C', Material.LEATHER_CHESTPLATE);
|
||||||
recipes.add(armorDamageRecipe);
|
recipes.add(armorDamageRecipe);
|
||||||
|
|
||||||
NamespacedKey damageDoneKey = new NamespacedKey(toolStats, "damage-done-token");
|
NamespacedKey damageDoneKey = new NamespacedKey(toolStats, "damage-done-token");
|
||||||
ShapedRecipe damageDoneRecipe = new ShapedRecipe(damageDoneKey, toolStats.tokenItems.damageDone());
|
ShapedRecipe damageDoneRecipe = new ShapedRecipe(damageDoneKey, createToken("damage-done"));
|
||||||
damageDoneRecipe.shape(" P ", "PSP", " P ");
|
damageDoneRecipe.shape(" P ", "PSP", " P ");
|
||||||
damageDoneRecipe.setIngredient('P', Material.PAPER);
|
damageDoneRecipe.setIngredient('P', Material.PAPER);
|
||||||
damageDoneRecipe.setIngredient('S', Material.SHIELD);
|
damageDoneRecipe.setIngredient('S', Material.SHIELD);
|
||||||
recipes.add(damageDoneRecipe);
|
recipes.add(damageDoneRecipe);
|
||||||
|
|
||||||
NamespacedKey arrowsShotKey = new NamespacedKey(toolStats, "arrows-shot-token");
|
NamespacedKey arrowsShotKey = new NamespacedKey(toolStats, "arrows-shot-token");
|
||||||
ShapedRecipe arrowsShotRecipe = new ShapedRecipe(arrowsShotKey, toolStats.tokenItems.arrowsShot());
|
ShapedRecipe arrowsShotRecipe = new ShapedRecipe(arrowsShotKey, createToken("arrows-shot"));
|
||||||
arrowsShotRecipe.shape(" P ", "PAP", " P ");
|
arrowsShotRecipe.shape(" P ", "PAP", " P ");
|
||||||
arrowsShotRecipe.setIngredient('P', Material.PAPER);
|
arrowsShotRecipe.setIngredient('P', Material.PAPER);
|
||||||
arrowsShotRecipe.setIngredient('A', Material.ARROW);
|
arrowsShotRecipe.setIngredient('A', Material.ARROW);
|
||||||
recipes.add(arrowsShotRecipe);
|
recipes.add(arrowsShotRecipe);
|
||||||
|
|
||||||
NamespacedKey flightTimeKey = new NamespacedKey(toolStats, "flight-time-token");
|
NamespacedKey flightTimeKey = new NamespacedKey(toolStats, "flight-time-token");
|
||||||
ShapedRecipe flightTimeRecipe = new ShapedRecipe(flightTimeKey, toolStats.tokenItems.flightTime());
|
ShapedRecipe flightTimeRecipe = new ShapedRecipe(flightTimeKey, createToken("flight-time"));
|
||||||
flightTimeRecipe.shape(" P ", "PFP", " P ");
|
flightTimeRecipe.shape(" P ", "PFP", " P ");
|
||||||
flightTimeRecipe.setIngredient('P', Material.PAPER);
|
flightTimeRecipe.setIngredient('P', Material.PAPER);
|
||||||
flightTimeRecipe.setIngredient('F', Material.FEATHER);
|
flightTimeRecipe.setIngredient('F', Material.FEATHER);
|
||||||
recipes.add(flightTimeRecipe);
|
recipes.add(flightTimeRecipe);
|
||||||
|
|
||||||
NamespacedKey resetKey = new NamespacedKey(toolStats, "reset-token");
|
NamespacedKey resetKey = new NamespacedKey(toolStats, "reset-token");
|
||||||
ShapedRecipe resetRecipe = new ShapedRecipe(resetKey, toolStats.tokenItems.resetToken());
|
ShapedRecipe resetRecipe = new ShapedRecipe(resetKey, createToken("reset"));
|
||||||
resetRecipe.shape(" P ", "PPP", " P ");
|
resetRecipe.shape(" P ", "PPP", " P ");
|
||||||
resetRecipe.setIngredient('P', Material.PAPER);
|
resetRecipe.setIngredient('P', Material.PAPER);
|
||||||
recipes.add(resetRecipe);
|
recipes.add(resetRecipe);
|
||||||
|
|
||||||
NamespacedKey removeKey = new NamespacedKey(toolStats, "remove-token");
|
NamespacedKey removeKey = new NamespacedKey(toolStats, "remove-token");
|
||||||
ShapedRecipe removeRecipe = new ShapedRecipe(removeKey, toolStats.tokenItems.removeToken());
|
ShapedRecipe removeRecipe = new ShapedRecipe(removeKey, createToken("remove"));
|
||||||
removeRecipe.shape(" P ", "P P", " P ");
|
removeRecipe.shape(" P ", "P P", " P ");
|
||||||
removeRecipe.setIngredient('P', Material.PAPER);
|
removeRecipe.setIngredient('P', Material.PAPER);
|
||||||
recipes.add(removeRecipe);
|
recipes.add(removeRecipe);
|
||||||
@@ -140,4 +147,83 @@ public class TokenCrafting {
|
|||||||
public ArrayList<String> getTokenTypes() {
|
public ArrayList<String> getTokenTypes() {
|
||||||
return tokenTypes;
|
return tokenTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ItemStack createToken(String tokenType) {
|
||||||
|
// we don't have to check if the token exists
|
||||||
|
// we do that prior
|
||||||
|
ConfigurationSection tokenConfig = toolStats.config.getConfigurationSection("tokens.data." + tokenType);
|
||||||
|
|
||||||
|
String materialFromConfig = tokenConfig.getString("material");
|
||||||
|
if (materialFromConfig == null) {
|
||||||
|
toolStats.logger.warning("Could not find material config for token " + tokenType);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
Material material = Material.getMaterial(materialFromConfig);
|
||||||
|
if (material == null) {
|
||||||
|
toolStats.logger.warning("Material " + materialFromConfig + " is not a valid Minecraft material.");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack token = new ItemStack(material);
|
||||||
|
ItemMeta tokenMeta = token.getItemMeta();
|
||||||
|
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
||||||
|
|
||||||
|
// set the title and lore
|
||||||
|
Component title = toolStats.configTools.format("tokens.data." + tokenType + ".title");
|
||||||
|
List<Component> lore = toolStats.configTools.getTokenLore(tokenType);
|
||||||
|
tokenMeta.displayName(title);
|
||||||
|
tokenMeta.lore(lore);
|
||||||
|
|
||||||
|
// set the custom model data
|
||||||
|
if (tokenConfig.getBoolean("custom-model-data.enabled")) {
|
||||||
|
String type = tokenConfig.getString("custom-model-data.type");
|
||||||
|
Object value = tokenConfig.get("custom-model-data.value");
|
||||||
|
if (type == null || value == null) {
|
||||||
|
toolStats.logger.info("Could not find custom model data for token " + tokenType);
|
||||||
|
toolStats.logger.info("Type: " + type);
|
||||||
|
toolStats.logger.info("Value: " + value);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
CustomModelData data = setData(type, value);
|
||||||
|
if (data != null) {
|
||||||
|
token.setData(DataComponentTypes.CUSTOM_MODEL_DATA, data);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set the PDC
|
||||||
|
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, tokenType);
|
||||||
|
token.setItemMeta(tokenMeta);
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
private CustomModelData setData(String type, Object data) {
|
||||||
|
switch (type.toLowerCase(Locale.ROOT)) {
|
||||||
|
case "float": {
|
||||||
|
Float f;
|
||||||
|
if (data instanceof Float) {
|
||||||
|
f = (Float) data;
|
||||||
|
} else {
|
||||||
|
toolStats.logger.info(type + " is not a valid float!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return CustomModelData.customModelData().addFloat(f).build();
|
||||||
|
}
|
||||||
|
case "string": {
|
||||||
|
String s;
|
||||||
|
if (data instanceof String) {
|
||||||
|
s = (String) data;
|
||||||
|
} else {
|
||||||
|
toolStats.logger.info(type + " is not a valid string!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return CustomModelData.customModelData().addString(s).build();
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
toolStats.logger.info(type + " is not a valid data type!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,253 +0,0 @@
|
|||||||
/*
|
|
||||||
* This file is part of ToolStats.
|
|
||||||
*
|
|
||||||
* ToolStats is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* ToolStats is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with ToolStats. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package lol.hyper.toolstats.tools.config;
|
|
||||||
|
|
||||||
import lol.hyper.toolstats.ToolStats;
|
|
||||||
import net.kyori.adventure.text.Component;
|
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
|
||||||
import org.bukkit.persistence.PersistentDataContainer;
|
|
||||||
import org.bukkit.persistence.PersistentDataType;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class TokenItems {
|
|
||||||
|
|
||||||
private final ToolStats toolStats;
|
|
||||||
|
|
||||||
public TokenItems(ToolStats toolStats) {
|
|
||||||
this.toolStats = toolStats;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack playerKills() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.player-kills.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("player-kills");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "player-kills");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack mobKills() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.mob-kills.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("mob-kills");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "mob-kills");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack blocksMined() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.blocks-mined.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("blocks-mined");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "blocks-mined");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack cropsMined() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.crops-mined.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("crops-mined");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "crops-mined");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack fishCaught() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.fish-caught.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("fight-caught");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "fish-caught");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack sheepSheared() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.sheep-sheared.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("sheep-sheared");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "sheep-sheared");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack damageTaken() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.damage-taken.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("damage-taken");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "damage-taken");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack damageDone() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.damage-done.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("damage-done");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "damage-done");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack arrowsShot() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.arrows-shot.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("arrows-shot");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "arrows-shot");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack flightTime() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.flight-time.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("flight-time");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "flight-time");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack resetToken() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.reset.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("reset");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "reset");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ItemStack removeToken() {
|
|
||||||
// set up the item
|
|
||||||
ItemStack token = new ItemStack(Material.PAPER);
|
|
||||||
ItemMeta tokenMeta = token.getItemMeta();
|
|
||||||
PersistentDataContainer tokenData = tokenMeta.getPersistentDataContainer();
|
|
||||||
|
|
||||||
// set the title and lore
|
|
||||||
Component title = toolStats.configTools.format("tokens.data.remove.title");
|
|
||||||
List<Component> lore = toolStats.configTools.getTokenLore("remove");
|
|
||||||
tokenMeta.displayName(title);
|
|
||||||
tokenMeta.lore(lore);
|
|
||||||
|
|
||||||
// set the PDC
|
|
||||||
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "remove");
|
|
||||||
token.setItemMeta(tokenMeta);
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -9,61 +9,109 @@ tokens:
|
|||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
mob-kills:
|
mob-kills:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
blocks-mined:
|
blocks-mined:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
crops-mined:
|
crops-mined:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
fish-caught:
|
fish-caught:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
sheep-sheared:
|
sheep-sheared:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
damage-taken:
|
damage-taken:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
damage-done:
|
damage-done:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
arrows-shot:
|
arrows-shot:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
flight-time:
|
flight-time:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
reset:
|
reset:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
remove:
|
remove:
|
||||||
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."
|
||||||
levels: 1
|
levels: 1
|
||||||
|
custom-model-data:
|
||||||
|
enabled: false
|
||||||
|
type: float
|
||||||
|
value: 1001
|
||||||
|
|
||||||
enabled:
|
enabled:
|
||||||
# Will show "Crafted by <player>"
|
# Will show "Crafted by <player>"
|
||||||
|
|||||||
Reference in New Issue
Block a user