add remove stat token

This commit is contained in:
hyperdefined
2025-03-30 20:54:25 -04:00
parent 90a8ec1fab
commit f13f17be58
4 changed files with 188 additions and 0 deletions

View File

@@ -113,6 +113,12 @@ public class TokenCrafting {
resetRecipe.setIngredient('P', Material.PAPER);
recipes.add(resetRecipe);
NamespacedKey removeKey = new NamespacedKey(toolStats, "remove-token");
ShapedRecipe removeRecipe = new ShapedRecipe(removeKey, toolStats.tokenItems.removeToken());
resetRecipe.shape(" P ", "P P", " P ");
resetRecipe.setIngredient('P', Material.PAPER);
recipes.add(removeRecipe);
tokenTypes.add("crops-mined");
tokenTypes.add("blocks-mined");
tokenTypes.add("damage-taken");
@@ -123,6 +129,7 @@ public class TokenCrafting {
tokenTypes.add("flight-time");
tokenTypes.add("fish-caught");
tokenTypes.add("reset");
tokenTypes.add("remove");
}
public Set<ShapedRecipe> getRecipes() {

View File

@@ -233,4 +233,22 @@ public class TokenItems {
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;
}
}