Erro In e.getWhoClicked(), and Connection to BungeeCord

Discussion in 'Plugin Help/Development/Requests' started by david9874101, Sep 28, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    david9874101

    Help Pls D:
    Code:java
    1. @EventHandler
    2. public void onInventoryClick1(InventoryClickEvent e) {
    3. if (!e.getInventory().getName().equalsIgnoreCase(inv.getName())) return;
    4. if (e.getCurrentItem().getItemMeta() == compass) return;
    5. if (e.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§f§lKit§4§lPvP")) {
    6. e.setCancelled(true);
    7. e.getWhoClicked();{
    8. if (plugin.getConfig().getBoolean("config.bungee.teleport_all_to_server_on_stop.tp")) {
    9. final String server = plugin.getConfig().getString("config.bungee.teleport_all_to_server_on_stop.server");
    10. Bukkit.getScheduler().runTaskLater((Plugin) this, new Runnable() {
    11. public void run() {
    12. for (Player p : Bukkit.getOnlinePlayers()) {
    13. connectToServer(p.getName(), server);
    14. }
    15. }
    16. }, 30L);
    17. return;
    18. }
    19. e.getWhoClicked().closeInventory();
    20. }
    21. }
    22. }
    23.  
    24. public static void connectToServer(String player, String server) {
    25. try {
    26. out.writeUTF("Connect");
    27. out.writeUTF(server);
    28. } catch (IOException e) {
    29. e.printStackTrace();
    30. }
    31. Bukkit.getPlayer(player).sendPluginMessage(plugin, "BungeeCord", stream.toByteArray());
    32. }
     
  2. Offline

    Creeoer

    1. e.setCancelled(true);
    2. e.getWhoClicked();{ Cool, an if statement with no closing Anyways did you register these events inside the main class? Please provide more information than help pls );
    3. getServer().getPluginManager().registerEvents(this, this); Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord"); Then register the listener class in the main class as well.
    Co
     
  3. Offline

    david9874101

    So it is mi onEnable
    Code:java
    1. public void onEnable (){
    2. getConfig().addDefault("config.auto_updating", true);
    3. getConfig().options().copyDefaults(true);
    4. getConfig().addDefault("config.bungee.teleport_all_to_server_on_stop.tp", true);
    5. getConfig().addDefault("config.bungee.teleport_all_to_server_on_stop.server", "kitpvp");
    6. this.saveConfig();
    7. Bukkit.getServer().getPluginManager().registerEvents(this, this);
     
Thread Status:
Not open for further replies.

Share This Page