Help!

Discussion in 'Plugin Development' started by becidycu, Apr 6, 2014.

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

    becidycu

    Hello! I recently updated my plugin to 1.7 from 1.6.4, and I got an error.
    This is the stack trace: http://pastebin.com/hCNPMaQm

    I really hope we can fix this.
    I will give you more information when you ask.

    -Becidycu
     
  2. Offline

    rfsantos1996

    Probably you used "new <main plugin class name>()", so you created another instance of your plugin, that Bukkit don't allow.

    Send me your events class
     
  3. Offline

    becidycu

  4. Offline

    rfsantos1996

  5. Offline

    becidycu

  6. Offline

    Code0

    Just so you know, it's an IllegalStateException in your MainClass at line 16.
     
  7. Offline

    becidycu

    Code0 I know. But the line is "public class MainClass extends JavaPlugin {", and nothing is wrong.. :(
     
  8. Offline

    Code0

    becidycu would you bother giving me the MainClass class through PasteBin?
     
  9. Offline

    rfsantos1996

    Code:java
    1. //onEnable @ MainClass
    2. getServer().getPluginManager().registerEvents(new Events(this), this);
    3. // this will maintain the same instance of your plugin, so you can use plugin.getConfig() on your Events class



    Code:java
    1. public class Events implements Listener {
    2.  
    3. private final MainClass plugin;
    4.  
    5. public Events(MainClass plugin) {
    6. this.plugin = plugin;
    7. }
    8.  
    9. /* events and methods here
    10. plugin.getConfig() is now avaliable here */
    11. }
     
  10. Offline

    Code0

    rfsantos1996

    Why thank you :) This should work perfectly fine.
     
  11. Offline

    becidycu

    Code0 rfsantos1996 I can still not use "getConfig()" for a weird reason..

    Oh. Never mined... :S
    THANKS!!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  12. Offline

    rfsantos1996

    replyied the wrong post I think
     
  13. Offline

    Code0

    rfsantos1996 Oh didn't even notice. Sorry

    Please mark this as solved.

    becidycu

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  14. Offline

    rfsantos1996

    I mean, I replyied to you instead of the thread creator xD
     
Thread Status:
Not open for further replies.

Share This Page