3
0
Mirror von https://github.com/IntellectualSites/FastAsyncWorldEdit.git synchronisiert 2024-12-26 02:50:06 +01:00

Added ServerInterface.getWorlds.

Dieser Commit ist enthalten in:
TomyLobo 2011-12-15 11:49:44 +01:00
Ursprung 32bb810ce7
Commit 6d4b4718db
2 geänderte Dateien mit 23 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -19,6 +19,9 @@
package com.sk89q.worldedit; package com.sk89q.worldedit;
import java.util.Collections;
import java.util.List;
/** /**
* *
* @author sk89q * @author sk89q
@ -57,4 +60,8 @@ public abstract class ServerInterface {
public int schedule(long delay, long period, Runnable task) { public int schedule(long delay, long period, Runnable task) {
return -1; return -1;
} }
public List<LocalWorld> getWorlds() {
return Collections.emptyList();
}
} }

Datei anzeigen

@ -19,8 +19,12 @@
package com.sk89q.worldedit.bukkit; package com.sk89q.worldedit.bukkit;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.*; import org.bukkit.*;
import org.bukkit.entity.CreatureType; import org.bukkit.entity.CreatureType;
import com.sk89q.worldedit.LocalWorld;
import com.sk89q.worldedit.ServerInterface; import com.sk89q.worldedit.ServerInterface;
public class BukkitServerInterface extends ServerInterface { public class BukkitServerInterface extends ServerInterface {
@ -52,4 +56,16 @@ public class BukkitServerInterface extends ServerInterface {
public int schedule(long delay, long period, Runnable task) { public int schedule(long delay, long period, Runnable task) {
return Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, task, delay, period); return Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, task, delay, period);
} }
@Override
public List<LocalWorld> getWorlds() {
List<World> worlds = server.getWorlds();
List<LocalWorld> ret = new ArrayList<LocalWorld>(worlds.size());
for (World world : worlds) {
ret.add(BukkitUtil.getLocalWorld(world));
}
return ret;
}
} }