--- miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/EternalDayCommand.java 2011/05/23 16:02:15 1477 +++ miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/EternalDayCommand.java 2011/05/26 18:32:20 1478 @@ -1,5 +1,7 @@ package dk.thoerup.bukkit.hoeruputils; +import java.util.List; + import org.bukkit.ChatColor; import org.bukkit.Server; import org.bukkit.World; @@ -15,7 +17,7 @@ int taskId = -1; - World world; + List worlds; Server server; Plugin plugin; @@ -23,7 +25,7 @@ this.plugin = plugin; server = plugin.getServer(); - world = server.getWorlds().get(0); + worlds = server.getWorlds(); } @Override @@ -48,9 +50,11 @@ // 1000=1 hour, 0 is 06:00 so 12000 is 18:00 @Override public void run() { - if (world.getTime() > 12000) { - world.setTime(0); - server.getScheduler().scheduleSyncDelayedTask(plugin, new MessageBroadcaster(server, ChatColor.YELLOW + "Eternalday has extended the period of light once again!")); + for(World world : worlds) { + if (world.getTime() > 12000) { + world.setTime(0); + server.getScheduler().scheduleSyncDelayedTask(plugin, new MessageBroadcaster(server, ChatColor.YELLOW + "Eternalday has extended the period of light once again!")); + } } }