Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. } else if(mapType.equals(MapType.STATIC)) {
  2. if (time != null && IntegerUtils.convertTime(time) != 0) {
  3. Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(Main.plugin, new Runnable() {
  4. public void run() {
  5. FileConfiguration config = ConfigUtils.getConfig("config");
  6. if (config.contains("data.startDate")) {
  7. Calendar cal = Calendar.getInstance();
  8. cal.setTime(new Date(config.getLong("data.startDate")));
  9. cal.add(Calendar.SECOND, IntegerUtils.convertTime(time));
  10. if (new Date().after(cal.getTime())) {
  11. gamePlugin.reset();
  12. }
  13. } else {
  14. config.set("data.startDate", Calendar.getInstance().getTime().getTime());
  15. ConfigUtils.saveConfig(config, "config");
  16. }
  17. }
  18. } , 20, 20);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement