Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- } else if(mapType.equals(MapType.STATIC)) {
- if (time != null && IntegerUtils.convertTime(time) != 0) {
- Bukkit.getServer().getScheduler().scheduleAsyncRepeatingTask(Main.plugin, new Runnable() {
- public void run() {
- FileConfiguration config = ConfigUtils.getConfig("config");
- if (config.contains("data.startDate")) {
- Calendar cal = Calendar.getInstance();
- cal.setTime(new Date(config.getLong("data.startDate")));
- cal.add(Calendar.SECOND, IntegerUtils.convertTime(time));
- if (new Date().after(cal.getTime())) {
- gamePlugin.reset();
- }
- } else {
- config.set("data.startDate", Calendar.getInstance().getTime().getTime());
- ConfigUtils.saveConfig(config, "config");
- }
- }
- } , 20, 20);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement