Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SunnyDays extends JavaPlugin {
- @Override
- public void onEnable(){
- Bukkit.getServer().getPluginManager().registerEvents(new Eventz(), this); //adds event to main class
- //This next Runnable crap is how you make a schedualed task, aka the check to see the time
- Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){
- @Override
- public void run() {
- keepDay();
- }
- }, 0L, 20L);
- }
- public void onDisable(){
- }
- public void keepDay(){
- World world = getServer().getWorld("world");
- long time = world.getTime();
- if (time != 5000L){
- world.setTime(5000L);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement