kamakarzy You do need to realize that the time minecraft is using is a bit odd This is my code : Code: Calendar cal = Calendar.getInstance(); cal.getTime(); int hour = cal.get(Calendar.HOUR_OF_DAY); int minute = cal.get(Calendar.MINUTE); int minutes = hour*60 + minute; int newtick = minutes*1000/72; world.setTime(newtick-6000); If you have any changes please let me know
im not a coding expert but (newtick-6000) wouldnt that do the sum of int newtick = miutes*1000/72; then -6000 if thats the case souldnt it be Code: Calendar cal = Calendar.getInstance(); cal.getTime(); int hour = cal.get(Calendar.HOUR_OF_DAY); int minute = cal.get(Calendar.MINUTE); int minutes = hour*60 + minute; int newtick = minutes*1000/72; world.setTime(newtick); ShadowDog007 nice find forgot to add a 0 lol EDIT by Moderator: merged posts, please use the edit button instead of double posting.
yea i do get it as if you type /time set 10000 its 4pm in game if you set 23000 its 5am timtower its working just for some reason time is off by 1 hour and 50 mins EDIT by Moderator: merged posts, please use the edit button instead of double posting.
sorry timtower the whole reason its not working is my fault i used all real time maths apart from minutes so your using minecraft ticks instead of real time the actual code would be Code: Calendar cal = Calendar.getInstance(); cal.getTime(); int hour = cal.get(Calendar.HOUR_OF_DAY); int minute = cal.get(Calendar.MINUTE); int minutes = hour*60 + minute; int newtick = minutes*1200/72; world.setTime(newtick);
kamakarzy No problem Please mark the thread as Filled YoshiGenius You just add a tick every 72 ticks, but when do you start it? It will follow the same time window though, but it won't be the same time EDIT by Moderator: merged posts, please use the edit button instead of double posting.
When the server starts up, set the time to whatever the real time is using the previously stated thingo. Convert the date to ticks then divide that by 72.
True... calculations can account for that. Remember, you need to reset the world tick back to zero at 6am, because minecraft doesnt keep going up.
YoshiGenius Minecraft has the ability to take numbers smaller than 0 and bigger than 24000, it is auto adapting. No need to keep that in mind.
I download your plugin which is cool, but i had to stop it because of the low latency it causes and the graphical default. infact everytime the sun goes up, i think because it is recalculating the position with minecraft and the plugin. the problem is that every 5 seconds (aproximatively) all the light goes brighter causes lags and really weird for the eyes it is dark and every 5 seconds it is sunny. I think it does that only when the sun goes down and maybe when the sun goes up haven't tested it. Do you think there is a possibility to fix that ?