[UNSOLVED] Updating sign on placement not working

Discussion in 'Plugin Development' started by foldagerdk, Aug 25, 2012.

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

    foldagerdk

    Hi,
    I am currently making a plugin, but I am having a bug that I can't seem to fix.

    Eclipse cannot find any errors, which means that I must be forgetting something.
    The plugin was supposed to update the sign to fill on some text, which it does not in-game.

    This is what my code looks like:
    Main.java:
    http://pastebin.com/sAyPneLz
    Plugin.yml
    http://pastebin.com/3arYcNkJ
    Ignore the shit ton of sign.Update(), as I wasn't sure where to place them :p


    Thanks in advance,
    Foldager
     
  2. Offline

    Giant

    It would work if you would register the event and implement Listener...
     
  3. Offline

    foldagerdk

    Okay, I changed
    Code:
    public class Main extends JavaPlugin {
    to
    Code:
    public class Main implements Listener {
    and imported
    Code:
    import org.bukkit.event.Listener;
    , but that gives me errors in every place where it says
    Code:
    PluginDescriptionFile pdfile = this.getDescription();
    and an error at onDisable().
    Do I need to make a separate Java file for the Listener?
     
  4. Offline

    Giant

    You would have to do:
    Code:
    public class Main extends JavaPlugin implements Listener
    
    And in your onEnable() you would then add
    Code:
    getServer().getPluginManager().RegisterEvents(this, this);
    
     
  5. Offline

    foldagerdk

    Thanks man, it works now - just had to change the capital R in RegisterEvents to a lowercase r. It works now and I gotta say thank you :)

    EDIT: Apart from the first sign, none of them worked. Fixed it by moving some curly brackets around and changing to else if instead of if. Still - thank you!
     
Thread Status:
Not open for further replies.

Share This Page