Fixes time update
This commit is contained in:
@@ -30,8 +30,9 @@ public class AkarinSlackScheduler extends Thread {
|
|||||||
public void run() {
|
public void run() {
|
||||||
MinecraftServer server = MinecraftServer.getServer();
|
MinecraftServer server = MinecraftServer.getServer();
|
||||||
|
|
||||||
|
while (server.isRunning()) {
|
||||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
// Send time updates to everyone, it will get the right time from the world the player is in.
|
||||||
if (++updateTime == AkarinGlobalConfig.timeUpdateInterval * 10) {
|
if (++updateTime >= AkarinGlobalConfig.timeUpdateInterval * 10) {
|
||||||
for (EntityPlayer player : server.getPlayerList().players) {
|
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
|
player.playerConnection.sendPacket(new PacketPlayOutUpdateTime(player.world.getTime(), player.getPlayerTime(), player.world.getGameRules().getBoolean("doDaylightCycle"))); // Add support for per player time
|
||||||
}
|
}
|
||||||
@@ -69,5 +70,6 @@ public class AkarinSlackScheduler extends Thread {
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user