Solved 1.9.4 Not Working For Me

Discussion in 'Spigot Plugin Development' started by Joedon, May 22, 2016.

Thread Status:
Not open for further replies.
  1. Hi there, my plugin is being disabled with no error or disable message when I use 1.9.4. I am using an NMS interface that works fine with 1.8.x, 1.9.x, except with 1.9.4. Any ideas? (Yes, I am using 1_9_R2)
     
  2. Sounds like something other than the plugin itself is disabling it? Try loading the plugin and only the plugin.
     
  3. Still being disabled with 0 messages explaining why
     
  4. Can we see your code? Does it have any "if(something) disable plugin"?
     
  5. Code (Text):
              String implVersion;
                 try {
                     implVersion = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
                 } catch (ArrayIndexOutOfBoundsException e) {
                     implVersion = "unknown";
                 }
                 switch(implVersion) {
                     case "v1_8_R3":
                         this.nmsInstance= (NMS) new VersionDetector18(plugin2);
                         Bukkit.getServer().getPluginManager().registerEvents(this, this);

                         break;
                     case "v1_9_R1":
                         this.nmsInstance= (NMS) new VersionDetector19(plugin1);
                         Bukkit.getServer().getPluginManager().registerEvents(this, this);
                         break;
                         
                     case "v1_9_R2":
                         this.nmsInstance= (NMS) new VersionDetector194(plugin3);
                         Bukkit.getServer().getPluginManager().registerEvents(this, this);

                     default:
                          this.setEnabled(false);
                          return;
                 }
    I just debugged it and it is running the case "v1_9_R2":
     
  6. Go with me here for a second. Try this:
    Code (Text):
              String implVersion;
                 try {
                     implVersion = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3];
                 } catch (ArrayIndexOutOfBoundsException e) {
                     implVersion = "unknown";
                 }
                 switch(implVersion) {
                     case "v1_8_R3":
                         this.nmsInstance= (NMS) new VersionDetector18(plugin2);
                         Bukkit.getServer().getPluginManager().registerEvents(this, this);

                         break;
                     case "v1_9_R1":
                         this.nmsInstance= (NMS) new VersionDetector19(plugin1);
                         Bukkit.getServer().getPluginManager().registerEvents(this, this);
                         break;
                         
                     case "v1_9_R2":
                         this.nmsInstance= (NMS) new VersionDetector194(plugin3);
                         Bukkit.getServer().getPluginManager().registerEvents(this, this);
                     case "unknown":
                         //alert
                         System.out.println("fag");

                     default:
                          this.setEnabled(false);
                          return;
                 }
     
  7. Oh lmao. Because I wasn't using a break; it did that. Thank you for your help xD
     
  8. Ah, it fell through. Clean up that syntax! It's dirty! Good luck :)
     
  9. Is this clean enough lol:
    [​IMG]
    I never focus on this kind of stuff.
     
  10. Looks great! Nice highlighter.

    space out those equal signs too.

    nmsInstance = <>
     
  11. I feel like Mr. Clean now
     
    • Like Like x 1
Thread Status:
Not open for further replies.