From d81090c5d9df374c6ab6c7492174b0864021a0c7 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Sat, 7 Apr 2012 10:34:05 -0700 Subject: [PATCH] Updated for SpoutAPI changes --- .../java/com/sk89q/worldedit/spout/SessionTimer.java | 4 ++-- .../com/sk89q/worldedit/spout/SpoutServerInterface.java | 9 ++++----- src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java | 4 ++-- .../com/sk89q/worldedit/spout/WorldEditListener.java | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/spout/SessionTimer.java b/src/main/java/com/sk89q/worldedit/spout/SessionTimer.java index abc47f67a..c2b0dfdb3 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SessionTimer.java +++ b/src/main/java/com/sk89q/worldedit/spout/SessionTimer.java @@ -23,7 +23,7 @@ package com.sk89q.worldedit.spout; import com.sk89q.worldedit.SessionCheck; import com.sk89q.worldedit.WorldEdit; -import org.spout.api.Game; +import org.spout.api.Engine; import org.spout.api.player.Player; /** @@ -36,7 +36,7 @@ public class SessionTimer implements Runnable { private WorldEdit worldEdit; private SessionCheck checker; - public SessionTimer(WorldEdit worldEdit, final Game game) { + public SessionTimer(WorldEdit worldEdit, final Engine game) { this.worldEdit = worldEdit; this.checker = new SessionCheck() { public boolean isOnlinePlayer(String name) { diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutServerInterface.java b/src/main/java/com/sk89q/worldedit/spout/SpoutServerInterface.java index 55ed0c7e2..2ce5c6060 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutServerInterface.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutServerInterface.java @@ -27,8 +27,7 @@ import com.sk89q.minecraft.util.commands.CommandsManager; import com.sk89q.worldedit.LocalPlayer; import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.ServerInterface; -import org.spout.api.Game; -import org.spout.api.Spout; +import org.spout.api.Engine; import org.spout.api.geo.World; import org.spout.api.material.Material; import org.spout.api.material.MaterialRegistry; @@ -39,12 +38,12 @@ import java.util.Collection; import java.util.List; public class SpoutServerInterface extends ServerInterface { - public Game game; + public Engine game; public WorldEditPlugin plugin; private final SpoutRawCommandExecutor executor; private SpoutBiomeTypes biomes; - public SpoutServerInterface(WorldEditPlugin plugin, Game game) { + public SpoutServerInterface(WorldEditPlugin plugin, Engine game) { this.plugin = plugin; this.game = game; this.biomes = new SpoutBiomeTypes(); @@ -93,7 +92,7 @@ public class SpoutServerInterface extends ServerInterface { @Override public void onCommandRegistration(List commands, CommandsManager manager) { for (Command command : commands) { - org.spout.api.command.Command spoutCommand = Spout.getGame().getRootCommand().addSubCommand(plugin, command.aliases()[0]) + org.spout.api.command.Command spoutCommand = game.getRootCommand().addSubCommand(plugin, command.aliases()[0]) .addAlias(command.aliases()).setRawExecutor(executor). setUsage(command.usage()).setHelp(command.desc()); Method cmdMethod = manager.getMethods().get(null).get(command.aliases()[0]); diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java b/src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java index 4e964e6cc..db3b8495f 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutUtil.java @@ -27,7 +27,7 @@ import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.Location; import com.sk89q.worldedit.Vector; import com.sk89q.worldedit.WorldVector; -import org.spout.api.Game; +import org.spout.api.Engine; import org.spout.api.entity.Entity; import org.spout.api.geo.World; import org.spout.api.geo.cuboid.Block; @@ -96,7 +96,7 @@ public class SpoutUtil { ); } - public static Player matchSinglePlayer(Game game, String name) { + public static Player matchSinglePlayer(Engine game, String name) { return game.getPlayer(name, false); } diff --git a/src/main/java/com/sk89q/worldedit/spout/WorldEditListener.java b/src/main/java/com/sk89q/worldedit/spout/WorldEditListener.java index c87530e5b..8b0134392 100644 --- a/src/main/java/com/sk89q/worldedit/spout/WorldEditListener.java +++ b/src/main/java/com/sk89q/worldedit/spout/WorldEditListener.java @@ -136,7 +136,7 @@ public class WorldEditListener implements Listener { } if (!event.isAir() && !ignoreLeftClickAir) { - final int taskId = Spout.getGame().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { + final int taskId = Spout.getEngine().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() { public void run() { ignoreLeftClickAir = false; }