diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 486d939e8a..3053937d31 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -424,7 +424,7 @@ public class CraftWorld implements World { // Forces the client to update to the new time immediately for (Player p: getPlayers()) { CraftPlayer cp = (CraftPlayer) p; - cp.getHandle().netServerHandler.sendPacket(new Packet4UpdateTime(time)); + cp.getHandle().netServerHandler.sendPacket(new Packet4UpdateTime(cp.getHandle().getPlayerTime())); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 20b539bd39..56f9f6ce27 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -297,4 +297,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getHandle().netServerHandler.sendPacket(new Packet200Statistic(id, amount)); } + + public void setPlayerTime(long time, boolean relative) { + getHandle().timeOffset = time; + getHandle().relativeTime = relative; + } + + public long getPlayerTimeOffset() { + return getHandle().timeOffset; + } + + public long getPlayerTime() { + return getHandle().getPlayerTime(); + } + + public boolean isPlayerTimeRelative() { + return getHandle().relativeTime; + } + + public void resetPlayerTime() { + setPlayerTime(0, true); + } }