-
Notifications
You must be signed in to change notification settings - Fork 34
Bukkit utilities
CmdrDats edited this page Dec 30, 2012
·
1 revision
(:require [cljminecraft.bukkit :as bk])Source: bukkit.clj
Bukkit Docs: http://wiki.bukkit.org/Scheduler_Programming
Contains a lot of the core static entry points into the Bukkit API - Most could be reached by traversing the object tree through your plugin instance, but being able to use (bk/server) instead of (.getServer plugin) leads to cleaner code and less stuff to pass around.
The other half of this is the Scheduler programming convenience functions that lets you setup a ui-sync task, delayed-task, repeated-task and lets you cancel-task, check if it's a running-task? or a queued-task?.
A typical usage of example is that of delaying some kind of action, maybe for 10 seconds:
(bk/delayed-task plugin #(plr/send-msg "Bob" "Hello") (bk/seconds-to-ticks 10))Most of the other functions you can just eyeball at the source. They're fairly straightforward.