Solved Error

Discussion in 'BungeeCord Plugin Development' started by wantsome909, May 13, 2017.

  1. Error:
    https://gyazo.com/3bbcb9e6d98ceb2715b6d771b54690f5

    it wont send me to game. if that helps

    Code:

    Code (Text):
        @SuppressWarnings("deprecation")
        @EventHandler
        public void playerInteract3(PlayerInteractEvent event) {
            Player player = event.getPlayer();
            Action action = event.getAction();

            if (action.equals(Action.RIGHT_CLICK_BLOCK) || action.equals(Action.LEFT_CLICK_BLOCK)) {

                if (event.getClickedBlock().getState() instanceof Sign) {
                    Sign s = (Sign) event.getClickedBlock().getState();

                    signutil.getManager().addSign(s.getBlock());

                    if (s.getLine(0).contains("[XLLIVINGROOM]")) {
                        if (s.getLine(1).contains("[LOBBY]")) {
                            bungeecord.getManager().sendToServer(player, "mgserver1");
                        }
                        if (s.getLine(1).contains("[FULL]")) {
                            player.sendMessage("§cGame is currently full!");
                        }
                        if (s.getLine(1).contains("[INGAME]")) {
                            bungeecord.getManager().sendToServer(player, "mgserver1");
                        }
                        if (s.getLine(1).contains("[END]")) {
                            player.sendMessage("§cGame is currently ending!");
                        }
                    }
                }
            }
        }

     
    Code (Text):

        private static bungeecord manager = new bungeecord();

        public static bungeecord getManager(){
            return manager;
        }

        public void sendToServer(Player player, String targetServer){
            ByteArrayOutputStream b = new ByteArrayOutputStream();
            DataOutputStream out = new DataOutputStream(b);
            try{
                out.writeUTF("Connect");
                out.writeUTF(targetServer);
            }catch(Exception e){
                e.printStackTrace();
            }
            player.sendPluginMessage(Main.getPlugin(), "BungeeCord", b.toByteArray());
        }
     
     
  2. nvm i solved it for to register bungeecord