From adb13029bcabc3cefab4539aa633e5e2000cdd04 Mon Sep 17 00:00:00 2001 From: afforess Date: Sat, 2 Apr 2011 04:04:57 -0400 Subject: [PATCH] Forces clients to update to the new time immediately when setTime or setFullTime is called. --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 898ef3e0b0..b487b6d531 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -418,6 +418,12 @@ public class CraftWorld implements World { public void setFullTime(long time) { world.a(time); + + //Forces the client to update to the new time immediately + for (Player p: getPlayers()) { + CraftPlayer cp = (CraftPlayer) p; + cp.getHandle().a.b(new Packet4UpdateTime(time)); + } } public Environment getEnvironment() {