Solved How to set the moon phase?

Discussion in 'Bukkit Help' started by Muizers, May 12, 2012.

Thread Status:
Not open for further replies.
  1. Hey folks,

    Any way to set the moon phase will do.

    ( also, getting the moon phase would be a nice thing if you know how to )

    ~ Martijn

    The moon phase is calculated based upon the 'full time'. World.getFullTime()

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 25, 2016
  2. Offline


    Is there any way to use World.getFullTime()/ World.setFullTime() without breaking redstone clocks? I'm attempting to create a plugin that allows for adjustment of time without gimping the moon phases :) Editing World.setTime() shifts the moon phase by 1 day each time no matter what. (is this a bukkit bug?)
  3. Eh, first of all, when you set the time it will just set the 'full time' to the beginning of the next day, which basically means the moon phase goes up one, indeed. This is not a Bukkit bug, it is not a bug at all, it is just programmed in Minecraft vanilla server that way too.

    If you would want to change this you could use Reflection to change the command to set the full the time to beginning of the current day, OR you could make your own setTime thing that sets the full time to the beginning of the current day.

    No, there is no way to set the time without breaking redstone clocks. Redstone is based on the server thread, and the server thread is based on the in-game time. I personally find this strange, I would've made it so redstone and the in-game time both independently rely on the server thread, but ah well, probably it's because redstone was implemented later then the time, and before that it didn't matter.

    Changing the time breaks more things btw, like mobs' targets, or plugins that have delayed or repeating tasks (like broadcasting plugins).
  4. Offline


    Yea my testing with time changing has been so far "frustrating" with regards to red stone :( Like you said i would imagine resdstone / game time to be managed independently. It looks like adjusting (slowing) may not be feasible without quickly changing moons or broken redstone timers :(
  5. Ah, I just found something interesting. You could send a fake time to every player evey like tick (20 times per second) using the Player.setTime() and you could set your own time by that.

    Note that things like whether zombies spawn/burn etc. is dependent on the SERVER time, so it is probably a good idea to, when the 'real server time' hits morning, but the 'visual time' is still night, you set the real server time back to beginning of the evening. Do that once for night and day and you got 2x slower time.
  6. Offline


    This is great info, i'm going to give this a try tonight (pun intended) on my plugin test server...
  7. Offline


  8. The original thread was for moon phase checking. Your topic is a very useful one!

    But right now this thread seems to be about slowing/speeding up visual time in a server without breaking (too) much.
Thread Status:
Not open for further replies.

Share This Page