From 4dd5046a0d7c3ae5ccfb980b7f6f072d4e3c52c7 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 29 Jan 2011 21:04:02 +0000 Subject: [PATCH] Updated commands to use CommandSender instead of Player By: stevenh --- .../main/java/org/bukkit/craftbukkit/CraftServer.java | 11 ++++------- .../org/bukkit/craftbukkit/entity/CraftPlayer.java | 4 ++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 68c9eb593a..496cc6e7bd 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1,9 +1,6 @@ package org.bukkit.craftbukkit; -import org.bukkit.command.Command; -import org.bukkit.command.CommandMap; -import org.bukkit.command.SimpleCommandMap; -import org.bukkit.command.PluginCommandYamlParser; +import org.bukkit.command.*; import org.bukkit.entity.Player; import java.io.File; import java.util.ArrayList; @@ -153,15 +150,15 @@ public final class CraftServer implements Server { return server; } - public boolean dispatchCommand(Player player, String commandLine) { - return commandMap.dispatch(player, commandLine); + public boolean dispatchCommand(CommandSender sender, String commandLine) { + return commandMap.dispatch(sender, commandLine); } public void reload() { PropertyManager config = new PropertyManager(console.options); console.d = config; - + boolean animals = config.a("spawn-monsters", console.m); boolean monsters = config.a("spawn-monsters", console.e.k > 0); diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index a1ed1165ed..95982b6546 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -25,6 +25,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return server.getHandle().g(getName()); } + public boolean isPlayer() { + return true; + } + public boolean isOnline() { for (Object obj: server.getHandle().b) { EntityPlayerMP player = (EntityPlayerMP) obj;