Guest User

Untitled

a guest
Nov 10th, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. package com.gmail.nituspl.guilds.data;
  2.  
  3. import java.io.File;
  4. import java.util.List;
  5.  
  6. import org.bukkit.configuration.file.FileConfiguration;
  7. import org.bukkit.configuration.file.YamlConfiguration;
  8.  
  9. import com.gmail.nituspl.guilds.Main;
  10.  
  11. public class Guild {
  12.  
  13. Main plugin;
  14. String name;
  15.  
  16. FileConfiguration guilds;
  17.  
  18. public Guild(Main plugin){
  19. this.plugin = plugin;
  20. this.guilds = YamlConfiguration.loadConfiguration(new File(this.plugin.getDataFolder(), "guilds.yml"));
  21. }
  22.  
  23. public Guild(String name){
  24. this.name = name;
  25. }
  26.  
  27. private void save(){
  28. try{
  29. this.guilds.save(new File(this.plugin.getDataFolder(), "guilds.yml"));
  30. } catch (Exception e){
  31. e.printStackTrace();
  32. }
  33. }
  34.  
  35. public void setTag(String v){
  36. this.guilds.set("guilds." + name + ".tag", v);
  37. save();
  38. }
  39.  
  40. public String getTag(){
  41. String string = this.guilds.getString("guilds." + name + ".tag");
  42. return string;
  43. }
  44.  
  45. public void setName(String v){
  46. this.guilds.set("guilds." + name + ".name", v);
  47. save();
  48. }
  49.  
  50. public String getName(){
  51. String string = this.guilds.getString("guilds." + name + ".name");
  52. return string;
  53. }
  54.  
  55. public void setX(int v){
  56. this.guilds.set("guilds." + name + ".locationX", v);
  57. save();
  58. }
  59.  
  60. public int getX(){
  61. int integer = this.guilds.getInt("guilds." + name + ".locationX");
  62. return integer;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment