Advertisement
spigotdev

Untitled

Dec 19th, 2018
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public static void counter(String shopname) {
  2. File shopfile = new File("plugins/AsylumCloudMain/Shops/", shopname + ".yml");
  3. FileConfiguration config = YamlConfiguration.loadConfiguration(shopfile);
  4. config.set("shop.reset-timer", config.getInt("shop.reset-timer") - 1);
  5. try {
  6. config.save(shopfile);
  7. } catch (IOException e) {
  8. e.printStackTrace();
  9. }
  10.  
  11. if (config.getInt("shop.timer") == config.getInt("shop.reset-timer")) {
  12. if (shopname == "Rare") {
  13. // update items
  14. config.set("shop.reset-timer", 259200);
  15. try {
  16. config.save(minefile);
  17. } catch (IOException e) {
  18. e.printStackTrace();
  19. }
  20. } else if (shopname == "Common") {
  21. // update items
  22. config.set("shop.reset-timer", 86400);
  23. try {
  24. config.save(minefile);
  25. } catch (IOException e) {
  26. e.printStackTrace();
  27. }
  28. }
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement