add reset token

This commit is contained in:
hyperdefined
2025-01-26 14:37:24 -05:00
parent 4dda215805
commit 73e472af3a
5 changed files with 214 additions and 3 deletions

View File

@@ -215,4 +215,23 @@ public class TokenItems {
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");
Component lore = toolStats.configTools.format("tokens.data.reset.lore");
tokenMeta.displayName(title);
List<Component> newLore = new ArrayList<>();
newLore.add(lore);
tokenMeta.lore(newLore);
// set the PDC
tokenData.set(toolStats.tokenType, PersistentDataType.STRING, "reset");
token.setItemMeta(tokenMeta);
return token;
}
}