Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package us.legioncraft.tokens;
- import java.util.UUID;
- import org.bukkit.Bukkit;
- /**
- *
- * @author TheMindWreck
- * @version 1.0
- *
- */
- public class TokenPlayer {
- private UUID player;
- private TokensAPI plugin;
- /**
- * Constructor that allows you to access their token info. Create the object to use the methods.
- * @param player the UUID of the player
- *
- */
- public TokenPlayer(UUID player){
- this.player = player;
- }
- /**
- * Gives class ability to use the getConfig() method and like methods
- * @param plugin - Class variable
- */
- public TokenPlayer(TokensAPI plugin){
- this.plugin = plugin;
- }
- /**
- * Gets the tokens that the player has.
- *
- * @return the number of tokens the player has
- */
- public int getTokens(){
- Bukkit.getServer().broadcastMessage(player.toString());
- return plugin.getCustomConfig(player).getInt("tokens");
- }
- /**
- * Sets the player's tokens to a certain amount
- *
- * @param tokens the number of tokens to set the players tokens to.
- */
- public void setTokens(int tokens){
- plugin.getCustomConfig(player).set("tokens", tokens);
- plugin.saveCustomConfig(player);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement