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 ) Cheers! ~ 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.
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?)
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).
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
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.
Ahh moon phase you be looking for. I have this and once I get it up to perfect I shall push a MoonPhaseChangeEvent to bukkit but for now you can look in http://forums.bukkit.org/threads/co...tions-did-make-a-github-acc-in-the-end.98525/ (second suggestion to add)
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.