Need help with Redstone Current Change event.

Discussion in 'Plugin Development' started by Javin, Dec 22, 2011.

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

    Javin

    So I have the following code to register the event in my BlockListener:

    plugin.PlugMan.registerEvent(Event.Type.REDSTONE_CHANGE, this, Event.Priority.Monitor, plugin);

    Additionally, I use the following method to capture this event:

    public void onRedstoneChange(BlockRedstoneEvent event){
    Debug.Print("Redstone Change 1");

    I'm sure I'm doing something wrong, but I can't get the event to register at all. As I toggle redstone on and off, there is nothing being printed to my logs indicating that the event is being run. (I suspect it has to do with the signature of the method being wrong.)

    Help please!

    -Javin
     
  2. Offline

    unicode21B9

  3. Offline

    Javin

    Ahhh, that does seem to have been the problem, but now I have another one in that this event didn't do what I expected it to. Now that it's actually working (with your help) I see that it tells me when a REDSTONE BLOCK (specifically) changes its state from powered to unpowered and vice versa. What it DOESN'T tell me is when a block GETS POWERED by redstone. For instance, if I have a line of redstone leading to an obsidian block, when that line of redstone powers on, I need to detect the event of that obsidian block becoming "powered."

    Is the only way to do this by checking all 6 "sides" of the block every time there's a Redstone event? This would seem incredibly unoptimized if it's the case, but I can't seem to find another event that would do it.

    Thanks for your help!
     
Thread Status:
Not open for further replies.

Share This Page