@Override public void onEnable() { getProxy().getPluginManager().registerCommand( this, new CommandSend() ); } }
public boolean dispatchCommand(CommandSender sender, String commandLine) { return dispatchCommand( sender, commandLine, null ); }
@Override public boolean hasPermission(String permission) { return bungee.getPluginManager().callEvent( new PermissionCheckEvent( this, permission, permissions.contains( permission ) ) ).hasPermission(); }
System.setOut( new PrintStream( new LoggingOutputStream( logger, Level.INFO ), true ) ); pluginManager = new PluginManager( this ); getPluginManager().registerCommand( null, new CommandReload() ); getPluginManager().registerCommand( null, new CommandEnd() ); getPluginManager().registerCommand( null, new CommandIP() ); getPluginManager().registerCommand( null, new CommandBungee() ); getPluginManager().registerCommand( null, new CommandPerms() );
@Override public void handle(Chat chat) throws Exception { int maxLength = ( con.getPendingConnection().getVersion() >= ProtocolConstants.MINECRAFT_1_11 ) ? 256 : 100; Preconditions.checkArgument( chat.getMessage().length() <= maxLength, "Chat message too long" ); // Mojang limit, check on updates ChatEvent chatEvent = new ChatEvent( con, con.getServer(), chat.getMessage() ); if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { chat.setMessage( chatEvent.getMessage() ); if ( !chatEvent.isCommand() || !bungee.getPluginManager().dispatchCommand( con, chat.getMessage().substring( 1 ) ) ) { con.getServer().unsafe().sendPacket( chat ); } } throw CancelSendSignal.INSTANCE; }
@Override public void onEnable() { logger = CommonUtil.createLoggerFromJDK(getLogger()); core = new ChangeSkinCore(this); try { core.load(true); } catch (Exception ioExc) { logger.error("Error initializing plugin. Disabling...", ioExc); return; } PluginManager pluginManager = getProxy().getPluginManager(); pluginManager.registerListener(this, new ConnectListener(this)); pluginManager.registerListener(this, new ServerSwitchListener(this)); //this is required to listen to incoming messages from the server getProxy().registerChannel(new NamespaceKey(getName(), PERMISSION_RESULT_CHANNEL).getCombinedName()); getProxy().registerChannel(new NamespaceKey(getName(), FORWARD_COMMAND_CHANNEL).getCombinedName()); pluginManager.registerListener(this, new PluginMessageListener(this)); //register commands pluginManager.registerCommand(this, new SetCommand(this)); pluginManager.registerCommand(this, new InvalidateCommand(this)); pluginManager.registerCommand(this, new UploadCommand(this)); pluginManager.registerCommand(this, new SelectCommand(this)); pluginManager.registerCommand(this, new InfoCommand(this)); }
if (plugin.getProxy().getPluginManager().getPlugin("RedisBungee") != null) { redisPlayerManager = new RedisPlayerManager(connectedPlayerManager, this, getLogger()); playerProviders.add(redisPlayerManager); if (plugin.getProxy().getPluginManager().getPlugin("ProtocolSupportBungee") != null) { protocolVersionProvider = new ProtocolSupportVersionProvider(); } else { ProxyServer.getInstance().getPluginManager().registerCommand( plugin, new CommandBungeeTabListPlus()); ProxyServer.getInstance().getPluginManager().registerListener(plugin, listener); plugin.getProxy().getScheduler().runAsync(plugin, resendThread); restartRefreshThread();
private void registerListener(Listener listener) { listeners.add(listener); ProxyServer.getInstance().getPluginManager().registerListener(plugin, listener); }
@Override public void onEnable() { instance = this; Universal.get().setup(new BungeeMethods()); ProxyServer.getInstance().getPluginManager().registerListener(this, new ConnectionListenerBungee()); ProxyServer.getInstance().getPluginManager().registerListener(this, new ChatListenerBungee()); ProxyServer.getInstance().getPluginManager().registerListener(this, new InternalListener()); ProxyServer.getInstance().registerChannel("AdvancedBan"); if (ProxyServer.getInstance().getPluginManager().getPlugin("RedisBungee") != null) { Universal.get().useRedis(true); ProxyServer.getInstance().getPluginManager().registerListener(this, new PubSubMessageListener()); RedisBungee.getApi().registerPubSubChannels("AdvancedBan", "AdvancedBanConnection"); Universal.get().log("RedisBungee detected, hooking into it!"); } }
for ( Plugin plugin : Lists.reverse( new ArrayList<>( pluginManager.getPlugins() ) ) )
dataManager = new DataManager(this); if (configuration.isRegisterBungeeCommands()) { getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.GlistCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.FindCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.LastSeenCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.IpCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.SendToAll(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.ServerId(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.ServerIds()); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlayerProxyCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlistCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.DebugCommand(this)); api = new RedisBungeeAPI(this); getProxy().getPluginManager().registerListener(this, new RedisBungeeListener(this, configuration.getExemptAddresses())); getProxy().getPluginManager().registerListener(this, dataManager); psl = new PubSubListener(); getProxy().getScheduler().runAsync(this, psl);
bungee.getPluginManager().dispatchCommand( con, tabComplete.getCursor().substring( 1 ), suggestions ); bungee.getPluginManager().callEvent( tabCompleteEvent );
public OnlineForwardPluginMessagingForwardingSource(String channel, NuVotifier nuVotifier, ServerFilter serverFilter, VoteCache cache, String fallbackServer, int dumpRate) { super(channel, serverFilter, nuVotifier, cache, dumpRate); this.fallbackServer = fallbackServer; ProxyServer.getInstance().getPluginManager().registerListener(nuVotifier, this); }
@Override public JsonObject getDump() { JsonObject platformSpecific = new JsonObject(); List<PluginInfo> plugins = new ArrayList<>(); for (Plugin p : ProxyServer.getInstance().getPluginManager().getPlugins()) plugins.add(new PluginInfo(true, p.getDescription().getName(), p.getDescription().getVersion(), p.getDescription().getMain(), Arrays.asList(p.getDescription().getAuthor()))); platformSpecific.add("plugins", GsonUtil.getGson().toJsonTree(plugins)); platformSpecific.add("servers", GsonUtil.getGson().toJsonTree(ProtocolDetectorService.getDetectedIds())); return platformSpecific; }
@Override public void onEnable() { getProxy().getPluginManager().registerCommand( this, new CommandList() ); } }
getProxy().getPluginManager().registerListener(this, new ProxiedListener()); getProxy().getPluginManager().registerCommand(this, new CommandHub()); getProxy().getPluginManager().registerCommand(this, new CommandCloud()); getProxy().getPluginManager().registerCommand(this, new CommandIp());
@Override public void handle(ClientSettings settings) throws Exception { con.setSettings( settings ); SettingsChangedEvent settingsEvent = new SettingsChangedEvent( con ); bungee.getPluginManager().callEvent( settingsEvent ); }
@Override public int complete(String buffer, int cursor, List<CharSequence> candidates) { List<String> suggestions = new ArrayList<>(); proxy.getPluginManager().dispatchCommand( proxy.getConsole(), buffer, suggestions ); candidates.addAll( suggestions ); int lastSpace = buffer.lastIndexOf( ' ' ); return ( lastSpace == -1 ) ? cursor - buffer.length() : cursor - ( buffer.length() - lastSpace - 1 ); } }
@Override public void handle(Chat chat) throws Exception { Preconditions.checkArgument( chat.getMessage().length() <= 100, "Chat message too long" ); // Mojang limit, check on updates Preconditions.checkArgument(!StringUtil.isBlank(chat.getMessage()), "Chat message is empty"); ServerConnection server = con.getServer(); // if we're still connecting just ignore this packet if ( server == null ) { throw CancelSendSignal.INSTANCE; } ChatEvent chatEvent = new ChatEvent( con, server, chat.getMessage() ); if ( !bungee.getPluginManager().callEvent( chatEvent ).isCancelled() ) { chat.setMessage( chatEvent.getMessage() ); if ( !chatEvent.isCommand() || !bungee.getPluginManager().dispatchCommand( con, chat.getMessage().substring( 1 ) ) ) { server.unsafe().sendPacket( chat ); } } throw CancelSendSignal.INSTANCE; }
public PluginMessagingForwardingSource(String channel, ServerFilter serverFilter, NuVotifier nuVotifier, VoteCache cache, int dumpRate) { super(channel, serverFilter, nuVotifier, cache, dumpRate); ProxyServer.getInstance().getPluginManager().registerListener(nuVotifier, this); }