From c818125fb86cd36af44cf8562843fc193a12ac0f Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Tue, 1 Feb 2011 14:53:26 +0000 Subject: [PATCH] What's the time, mr wolf? By: Dinnerbone --- .../src/main/java/org/bukkit/Server.java | 4 ++ paper-api/src/main/java/org/bukkit/World.java | 39 +++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index be8da67181..bfaff2f5cf 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -79,14 +79,18 @@ public interface Server { * Gets the in-game time on the server (in hours*1000) * * @return The current time in hours*1000 + * @deprecated Use World.getTime */ + @Deprecated public long getTime(); /** * Sets the in-game time on the server (in hours*1000) * * @param time The time to set the in-game time to (in hours*1000) + * @deprecated Use World.setTime */ + @Deprecated public void setTime(long time); /** diff --git a/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index 3fd21db230..93b1a7196a 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/src/main/java/org/bukkit/World.java @@ -197,4 +197,43 @@ public interface World { * Gets the default spawn location. */ public Location getSpawnLocation(); + + /** + * Gets the relative in-game time on this world (in hours*1000) + * + * @return The current relative time in hours*1000 + * @see getFullTime + */ + public long getTime(); + + /** + * Sets the relative in-game time on the server (in hours*1000)
+ *
+ * Note that setting the relative time below the current relative time will + * actually move the clock forward a day. If you require to rewind time, please + * see setFullTime + * + * @param time The new relative time to set the in-game time to (in hours*1000) + * @see setFullTime + */ + public void setTime(long time); + + /** + * Gets the full in-game time on this world (in hours*1000) + * + * @return The current time in hours*1000 + * @see setTime + */ + public long getFullTime(); + + /** + * Sets the in-game time on the server (in hours*1000)
+ *
+ * Note that this sets the full time of the world, which may cause adverse + * effects such as breaking redstone clocks and any scheduled events + * + * @param time The new time to set the in-game time to (in hours*1000) + * @see setTime + */ + public void setFullTime(long time); }