FountainMC / FountainAPI

A 'simple but beautiful' Minecraft Server Plugin API
https://fountainmc.org/
MIT License
5 stars 5 forks source link

Scheduler #17

Open minecrafter opened 8 years ago

phase commented 8 years ago

Please do detail the wonderful plan for the Scheduler API.

minecrafter commented 8 years ago

Essentially, you'll be able to do:

Fountain.getServer().getAsyncScheduler().schedule(() -> getLogger().info("Hello, world!"), TaskSpecification.nextTick(plugin));

I actually like the way that the Sponge API implements schedulers, so this will be loosely based off that (with some changes).

Techcable commented 8 years ago

Why not just a TimeUnit or something?

minecrafter commented 8 years ago

@Techcable TaskSpecification is a more fluent API. It also supports TimeUnit.