Package org.bukkit.event.server

Examples of org.bukkit.event.server.ServerCommandEvent


            return;

        case AS_SERVER:
            dcs.clearOutput();
            dcs.silent = silent.asBoolean();
            ServerCommandEvent sce = new ServerCommandEvent(dcs, command);
            Bukkit.getPluginManager().callEvent(sce);
            DenizenAPI.getCurrentInstance().getServer().dispatchCommand(dcs, sce.getCommand());
            scriptEntry.addObject("output", new dList(dcs.getOutput()));
        }
    }
View Full Code Here


public class ServerUtils {

    public static void dispatchCommandWithEvent(String command) {
        Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command);
        Bukkit.getPluginManager().callEvent(new ServerCommandEvent(Bukkit.getConsoleSender(), command));
    }
View Full Code Here

            this.command = command;
        }

        @Override
        public void run() {
            ServerCommandEvent event = EventFactory.callEvent(new ServerCommandEvent(sender, command));
            server.dispatchCommand(sender, event.getCommand());
        }
View Full Code Here

        Bukkit.getPluginManager().callEvent(e);
        if (e.isCancelled() || e.getMessage() == null || !e.getMessage().startsWith("/"))
          return false;
        return Bukkit.dispatchCommand(e.getPlayer(), e.getMessage().substring(1));
      } else {
        final ServerCommandEvent e = new ServerCommandEvent(sender, command);
        Bukkit.getPluginManager().callEvent(e);
        if (e.getCommand() == null || e.getCommand().isEmpty())
          return false;
        return Bukkit.dispatchCommand(e.getSender(), e.getCommand());
      }
    } catch (final Exception ex) {
      ex.printStackTrace(); // just like Bukkit
      return false;
    }
View Full Code Here

TOP

Related Classes of org.bukkit.event.server.ServerCommandEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.