Events are messed up, any help?

Discussion in 'Plugin Development' started by Keyboard, Mar 24, 2014.

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

    Keyboard

    Anyone know whats wrong with this?
    Code:
    //EVENTS THAT WORK
    //FIRST CLASS
    getCommand("admin").setExecutor(new AdminCommand());
        getCommand("invis").setExecutor(new InvisCommand());
        getCommand("vis").setExecutor(new InvisCommand());
        getCommand("inv").setExecutor(new InvCommand());
     
        getCommand("lag").setExecutor(new LagCommand());
        getCommand("tag").setExecutor(new TagCommand());
        getCommand("suicide").setExecutor(new SuicideCommand());
        getCommand("tell").setExecutor(new TellCommand());
        getCommand("r").setExecutor(new TellCommand());
     
        getCommand("setpodium").setExecutor(new Podium());
        getCommand("setspawn").setExecutor(new Spawn());
        getCommand("spawn").setExecutor(new Spawn());
     
        getCommand("stats").setExecutor(new StatsCommand());
     
        getCommand("ban").setExecutor(new EnforcerCommands());
        getCommand("unban").setExecutor(new EnforcerCommands());
        getCommand("kick").setExecutor(new EnforcerCommands());
     
        Bukkit.getPluginManager().registerEvents(new JoinListener(), this);
        Bukkit.getPluginManager().registerEvents(new InvisListener(), this);
        Bukkit.getPluginManager().registerEvents(new SpawnListener(this), this);
        Bukkit.getPluginManager().registerEvents(new StatsListener(), this);
        Bukkit.getPluginManager().registerEvents(new Soup(), this);
        Bukkit.getPluginManager().registerEvents(new Sponges(), this);
        Bukkit.getPluginManager().registerEvents(new DropItemListener(), this);
        Bukkit.getPluginManager().registerEvents(new SpamListener(), this);
        Bukkit.getPluginManager().registerEvents(new DamageListener(), this);
     
        getCommand("kangaroo").setExecutor(new KangarooKit());
        getCommand("thor").setExecutor(new ThorKit());
        getCommand("grandpa").setExecutor(new GrandpaKit());
        getCommand("monk").setExecutor(new MonkKit());
        getCommand("stomper").setExecutor(new StomperKit());
        getCommand("switcher").setExecutor(new SwitcherKit());
        getCommand("fisherman").setExecutor(new FishermanKit());
        getCommand("viper").setExecutor(new ViperKit());
        getCommand("phantom").setExecutor(new PhantomKit());
     
        Bukkit.getPluginManager().registerEvents(new KangarooAbility(), this);
        Bukkit.getPluginManager().registerEvents(new ThorAbility(this), this);
        Bukkit.getPluginManager().registerEvents(new MonkAbility(this), this);
        Bukkit.getPluginManager().registerEvents(new StomperAbility(), this);
        Bukkit.getPluginManager().registerEvents(new SwitcherAbility(this), this);
        Bukkit.getPluginManager().registerEvents(new FishermanAbility(), this);
        Bukkit.getPluginManager().registerEvents(new ViperAbility(), this);
        Bukkit.getPluginManager().registerEvents(new PhantomAbility(this), this);
        Bukkit.getPluginManager().registerEvents(new NoHunger(), this);
        Bukkit.getPluginManager().registerEvents(new DeathListener(), this);
        Bukkit.getPluginManager().registerEvents(new EnforcerListener(), this);
        Bukkit.getPluginManager().registerEvents(new ModifyWorld(), this);
     
    //EVENTS THAT DON'T WORK AND THAT I HAVE ADDED.
    //SECOND CLASS
    getCommand("admin").setExecutor(new AdminCommand());
                        getCommand("invis").setExecutor(new InvisCommand());
                        getCommand("vis").setExecutor(new InvisCommand());
                        getCommand("inv").setExecutor(new InvCommand());
                     
                        getCommand("tag").setExecutor(new TagCommand());
                        getCommand("suicide").setExecutor(new SuicideCommand());
                        getCommand("tell").setExecutor(new TellCommand());
                        getCommand("r").setExecutor(new TellCommand());
     
                        getCommand("setpodium").setExecutor(new Podium());
                        getCommand("setspawn").setExecutor(new Spawn());
                        getCommand("spawn").setExecutor(new Spawn());
                        getCommand("kits").setExecutor(new KitGUI());
                        getCommand("hg").setExecutor(new Tournament());
                     
                        getCommand("stats").setExecutor(new StatsCommand());
     
                        getCommand("ban").setExecutor(new EnforcerCommands());
                        getCommand("unban").setExecutor(new EnforcerCommands());
                        getCommand("kick").setExecutor(new EnforcerCommands());
     
                        Bukkit.getPluginManager().registerEvents(new JoinListener(), this);
                        Bukkit.getPluginManager().registerEvents(new InvisListener(), this);
                        Bukkit.getPluginManager().registerEvents(new SpawnListener(this), this);
                        Bukkit.getPluginManager().registerEvents(new StatsListener(), this);
                        Bukkit.getPluginManager().registerEvents(new Soup(), this);
                        Bukkit.getPluginManager().registerEvents(new Sponges(), this);
                        Bukkit.getPluginManager().registerEvents(new DropItemListener(this), this);
                        Bukkit.getPluginManager().registerEvents(new DamageListener(), this);
                        Bukkit.getPluginManager().registerEvents(new Tournament(), this);
                     
     
                        getCommand("kangaroo").setExecutor(new KangarooKit());
                        getCommand("thor").setExecutor(new ThorKit());
                        getCommand("grandpa").setExecutor(new GrandpaKit());
                        getCommand("monk").setExecutor(new MonkKit());
                        getCommand("stomper").setExecutor(new StomperKit());
                        getCommand("switcher").setExecutor(new SwitcherKit());
                        getCommand("fisherman").setExecutor(new FishermanKit());
                        getCommand("viper").setExecutor(new ViperKit());
                        getCommand("phantom").setExecutor(new PhantomKit());
                        getCommand("snail").setExecutor(new SnailKit());
                        getCommand("spectre").setExecutor(new SpectreKit());
                        getCommand("archer").setExecutor(new ArcherKit());
                        getCommand("camel").setExecutor(new CamelKit());
                        getCommand("reaper").setExecutor(new ReaperKit());
                        getCommand("none").setExecutor(new NoneKit());
     
                        Bukkit.getPluginManager().registerEvents(new CamelAbility(), this);
                        Bukkit.getPluginManager().registerEvents(new SnailAbility(), this);
                        Bukkit.getPluginManager().registerEvents(new SpectreAbility(this), this);
                        Bukkit.getPluginManager().registerEvents(new RiderAbility(), this);
                        Bukkit.getPluginManager().registerEvents(new ReaperAbility(), this);
                        Bukkit.getPluginManager().registerEvents(new KangarooAbility(), this);
                        Bukkit.getPluginManager().registerEvents(new ThorAbility(this), this);
                        Bukkit.getPluginManager().registerEvents(new MonkAbility(this), this);
                        Bukkit.getPluginManager().registerEvents(new StomperAbility(), this);
                        Bukkit.getPluginManager().registerEvents(new SwitcherAbility(this), this);
                        Bukkit.getPluginManager().registerEvents(new FishermanAbility(), this);
                        Bukkit.getPluginManager().registerEvents(new ViperAbility(), this);
                        Bukkit.getPluginManager().registerEvents(new PhantomAbility(this), this);
                        Bukkit.getPluginManager().registerEvents(new NoHunger(), this);
                        Bukkit.getPluginManager().registerEvents(new DeathListener(), this);
                        Bukkit.getPluginManager().registerEvents(new EnforcerListener(), this);
                        Bukkit.getPluginManager().registerEvents(new ModifyWorld(), this);
     
  2. Offline

    MrInspector

    Whats not working exactly?

    To fix something you must tell us the error log (if there is one) and the code of the thing that's not working AND whats not working.
     
  3. Offline

    Keyboard

    They just simply don't register
     
  4. Offline

    Wizehh

    Why are you registering each of them twice?
     
  5. Offline

    Keyboard

    What do you mean?

    they are seperate classes where it says // dont work
     
Thread Status:
Not open for further replies.

Share This Page