Fix build

This commit is contained in:
fullwall 2014-05-09 19:24:39 +08:00
parent 3f22729ca9
commit 7a12d26a8e
2 changed files with 9 additions and 7 deletions

View File

@ -10,8 +10,8 @@ import net.citizensnpcs.editor.EquipmentEditor;
import net.citizensnpcs.trait.text.Text;
import net.citizensnpcs.trait.waypoint.Waypoints;
import org.bukkit.entity.Player;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@Requirements(selected = true, ownership = true)
public class EditorCommands {
@ -50,7 +50,10 @@ public class EditorCommands {
permission = "citizens.npc.edit.path")
@Requirements(selected = true, ownership = true)
public void path(CommandContext args, CommandSender player, NPC npc) {
Editor.enterOrLeave(player, npc.getTrait(Waypoints.class).getEditor(player, args));
Editor editor = npc.getTrait(Waypoints.class).getEditor(player, args);
if (editor == null)
return;
Editor.enterOrLeave((Player) player, editor);
}
@Command(

View File

@ -14,7 +14,6 @@ import net.citizensnpcs.util.Messages;
import net.citizensnpcs.util.StringHelper;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.google.common.collect.Maps;
@ -45,7 +44,7 @@ public class Waypoints extends Trait {
/**
* Returns the current {@link WaypointProvider}. May be null during
* initialisation.
*
*
* @return The current provider
*/
public WaypointProvider getCurrentProvider() {
@ -59,7 +58,7 @@ public class Waypoints extends Trait {
return providerName;
}
public Editor getEditor(Player player, CommandContext args) {
public Editor getEditor(CommandSender player, CommandContext args) {
return provider.createEditor(player, args);
}
@ -95,7 +94,7 @@ public class Waypoints extends Trait {
/**
* Sets the current {@link WaypointProvider} using the given name.
*
*
* @param name
* The name of the waypoint provider, registered using
* {@link #registerWaypointProvider(Class, String)}
@ -119,7 +118,7 @@ public class Waypoints extends Trait {
/**
* Registers a {@link WaypointProvider}, which can be subsequently used by
* NPCs.
*
*
* @param clazz
* The class of the waypoint provider
* @param name