Configurable time update interval
This commit is contained in:
@@ -172,4 +172,9 @@ public class AkarinGlobalConfig {
|
||||
private static void legacyWorldTimings() {
|
||||
legacyWorldTimings = getBoolean("alternative.legacy-world-timings-required", false);
|
||||
}
|
||||
|
||||
public static int timeUpdateInterval;
|
||||
private static void timeUpdateInterval() {
|
||||
timeUpdateInterval = getSeconds(getString("core.world-time-update-interval", "1s"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class AkarinSlackScheduler extends Thread {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
|
||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
||||
if (++updateTime == 10) {
|
||||
if (++updateTime == AkarinGlobalConfig.timeUpdateInterval * 10) {
|
||||
for (EntityPlayer player : server.getPlayerList().players) {
|
||||
player.playerConnection.sendPacket(new PacketPlayOutUpdateTime(player.world.getTime(), player.getPlayerTime(), player.world.getGameRules().getBoolean("doDaylightCycle"))); // Add support for per player time
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user