getServer() Is nonexistant.

Discussion in 'Plugin Development' started by caHarkness, Mar 28, 2011.

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

    caHarkness

    Code:
    public void onBlockRedstoneChange(BlockRedstoneEvent i) {
            if (i.getBlock().getType() == Material.SIGN) {
                Sign s = (Sign) i.getBlock();
                String[] l = s.getLines();
    
                if (l[0].equals("[Alarm]")) {
                    // I need help here!
                }
    
            }
        }
    Where it says "// I need help here!", how can I broadcast a message? It seems as if I am unable to reach the .getServer() method from anything and everything I have tried. Can someone help me out here?
     
  2. Offline

    SpaceManiac

    Your blockListener needs to store a reference to your plugin class and use plugin.getServer().
     
  3. Offline

    caHarkness

    Wow! That seemed to work. I can't believe I didn't think of that before, but it works! I feel so stupid asking that question, but I'm sure someone will come along and find this thread helpful.
     
Thread Status:
Not open for further replies.

Share This Page