Hi, i just start to dev a new plugin and I don't know how Synchronize the time of my server with the plugin and create several schedules that do something at such time. Could you more or less indicate how I would have to do? Thank you. Enviado desde mi XT1032 mediante Tapatalk
@Black_Lottus Calendar.getInstance() returns a Calendar instance ( duhh ) which has time, date, everything. How accurate do you need everything to be?
@Black_Lottus @timtower Also, remember that time-zones are a thing, and that you only have access to the server's time-zone and that it may not be the same as yours if you're using a hosting company.
@timtower For example ... That at 6:00 execute a one command. Let the 7 be restarted. At 10 o'clock another command is executed. Things like that. I need a quite accurate. Enviado desde mi XT1032 mediante Tapatalk
@Black_Lottus Well, if you account for time zones, it can be as accurate as you need: Create a repeating task. Every couple of ticks (or every tick if your processor can handle it) check if the time is equal to 6, 7, 10, ect. If so, execute the command/reload the server/ do what you need. (In case you don't know, use Bukkit.dispatchCommand to execute commands from the console.)