Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.alpenblock.bukkit.eventbug;
- import org.bukkit.Bukkit;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.plugin.java.JavaPlugin;
- public class BugPlugin extends JavaPlugin
- {
- public void onEnable()
- {
- Bukkit.getMessenger().registerOutgoingPluginChannel(this, "bugchannel");
- }
- public void onDisable()
- {
- Bukkit.getMessenger().unregisterOutgoingPluginChannel(this, "bugchannel");
- }
- public boolean onCommand(CommandSender sender,Command cmd,String label, String[] args)
- {
- if(cmd.getName().equalsIgnoreCase("start"))
- {
- //only a player should execute this command
- if(sender instanceof Player)
- {
- //of course permissions will be checked ... but not here -> testcase
- //do some actions here ... just to let it look more realistic
- //we are on the lobby server and we want to move to main server now
- sender.sendMessage("Moving you to the main server ...");
- ((Player) sender).sendPluginMessage(this, "bugchannel", "server main".getBytes());
- //work is done here ... now bungeecord has to do its work
- return true;
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement