private ICommandListener getListener(CommandSender sender) { if (sender instanceof Player) { return ((CraftPlayer) sender).getHandle(); } if (sender instanceof BlockCommandSender) { return ((CraftBlockCommandSender) sender).getTileEntity(); } if (sender instanceof CommandMinecart) { return ((EntityMinecartCommandBlock) ((CraftMinecartCommand) sender).getHandle()).getCommandBlock(); } if (sender instanceof RemoteConsoleCommandSender) { return RemoteControlCommandListener.instance; } if (sender instanceof ConsoleCommandSender) { return ((CraftServer) sender.getServer()).getServer(); } return null; }
public CraftMinecartCommand(CraftServer server, EntityMinecartCommandBlock entity) { super(server, entity); }
@Override public String getCommand() { return ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().getCommand(); }
@Override public void setCommand(String command) { ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().setCommand(command != null ? command : ""); }
@Override public void setName(String name) { ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().setName(name != null ? name : "@"); }
@Override public String getName() { return ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().getName(); }