forked from SteamWar/SteamWar
Format code
This commit is contained in:
@@ -24,7 +24,8 @@ import org.bukkit.Bukkit;
|
||||
import java.io.File;
|
||||
|
||||
class Config {
|
||||
private Config() {}
|
||||
private Config() {
|
||||
}
|
||||
|
||||
static final boolean RealTime;
|
||||
|
||||
|
||||
@@ -38,12 +38,12 @@ public class Realtime extends JavaPlugin implements Listener {
|
||||
pluginManager.registerEvents(this, this);
|
||||
|
||||
//Time updater
|
||||
if(Config.RealTime) {
|
||||
if (Config.RealTime) {
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> {
|
||||
Date date = new Date();
|
||||
long time = date.getHours() * 1000 + (long)(date.getMinutes() * 16.66666666666667) + (long)(date.getSeconds() * 0.1666666666666667) - 6000;
|
||||
long time = date.getHours() * 1000 + (long) (date.getMinutes() * 16.66666666666667) + (long) (date.getSeconds() * 0.1666666666666667) - 6000;
|
||||
|
||||
for(World world : Bukkit.getWorlds())
|
||||
for (World world : Bukkit.getWorlds())
|
||||
world.setTime(time);
|
||||
}, 0, 600);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user