Created
May 25, 2011 18:13
-
-
Save SpaceManiac/991528 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public long getTime(){ | |
long time = getServer().getWorld("world").getTime(); | |
return time; | |
} | |
// somewhere | |
bool justMidnight = false; | |
... | |
getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() { | |
@Override | |
public void run() { | |
if (getTime() >= 0 && getTime() <= 0100) { | |
if (!justMidnight) { | |
justMidnight = true; | |
// do something | |
} | |
} else { | |
justMidnight = false; | |
} | |
} | |
}, 0, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment