injecting BlockEvents? or adding redstone power?

Discussion in 'Plugin Development' started by halley, Oct 12, 2011.

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

    halley

    How does one go about injecting new BlockEvents (of existing types) into the game engine to be processed normally?

    For example, if I read a redstone block, I can get the current level of redstone power at that block, but I cannot just set it. A button changing state creates an event that sets the current, which propagates down the line potentially with more events if there are listeners. If I wanted to emulate something like a button press without actually having a button, how would I inject a redstone pulse onto a wire?

    Or is there some other way to say "hey, I have this block, it should act as a redstone power source for now"?
     
  2. Offline

    Afforess

    There is no way to do this in CB, which is unfortuante, because it's rather easy to do with notch code.

    Fortunately, you can do it very easily with Spout's API.

    block.setPowered(true);

    All done.
     
  3. Offline

    geekygenius

    You could change the block to something powered like a torch, and now send the client an update.
     
Thread Status:
Not open for further replies.

Share This Page