[Request] Piston events

Discussion in 'Bukkit Discussion' started by MG127, Jul 2, 2011.

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

    MG127

    i think you already planned this, but this is what i'm thinking of it should be:

    onPistonChange(PistonEvent event)
    the pistonEvent should contain the activation status (activating, deactivating) and the block it pulls/pushes
    i dont think that onBlockRedstoneChange can be used for this, since the pistons also activates if they are beside an activated block (indirect powered)

    MoveBlock(Location loc, BlockFace ,Int speed)
    MoveBlock(Block block, BlockFace) <- with default speed
    -> pistonlike movement for a block without a piston :D


    i'm planning to connect sticky pistons for easier movements.
    i would also like to see a new version of Movecraft (now with real movement)

    as long as a piston is moved by another piston, the block connected to the first, should also move
    and activated pistons should also be moveable
     
  2. Offline

    Edoxile

    Lol, 'char' direction? How about BlockFace direction?
    But I do agree that these things should be implemented.
     
  3. Offline

    MG127

    yeah, whatever they will use for the direction, it doesnt realy metter. as long they will implement this event + function
    i have never worked with blockfaces b4 and i have no idea how they work
     
  4. Offline

    Alzurana

    I was working alot with pistons since the update and I have to agree.
    I started to download eclipse again, just to write a plugin for
    pistons_moving(pistons_moving(pistons_moving(pistons_moving(pistons_moving(pistons_moving(blocks)))))), JUST to figure out that the only way to write that plugin was to use the "onRedstoneChange" event and to "copy->paste" blocks, which just looks ugly ala movecraft.
    A onPistonEvent is highly recommended!
    We really need it to make pistons awesome.

    *EDIT:

    I got some suggestions for you, MG127

    Code:
    1. config file with proberties like.
    -PullRange = 12
    (how many pistons will a piston actually pull)
    -PistonStick = true/false
    (if the last piston is reached, will the stack disconnect from following blocks or will it stick to it causeing no movement at all(useless IMO))
     
    drantor likes this.
  5. Offline

    MG127

    hey bukkit-team,
    would be good to know that you are working on it or at least thinking about it
    just let me know :)
    (reworked the 1st post)
     
  6. Offline

    Hretsam

    Just noticed your post, i am trying to pull this off.
    I got it working with a BlockFromToEvent, it will stop the block from moving on the server. However for some reason it doesn't stop it client side..
     
  7. Offline

    MG127

    i don't think thats the right event for pistons
    maybe there is something to readout that a piston activates/deactivates,
    maybe with
    public void onBlockFade(BlockFadeEvent event) {}
    public void onBlockForm(BlockFormEvent event) {}
    but nothing to simulate the movement of a block that is pushed/pulled by a piston
     
  8. Offline

    Hretsam

    Yeah i know.
    After a lot of tests i finally got it working.
    Made a new event for it, onBlockPush.

    It looks if the block is allowed to be pushed, if you cancel the event, the block wont be pushed!
    Will clean everything up and submit a pull request
     
  9. Offline

    MG127

    push and pull is the same?
    i mean technicaly, yes, it triggeres the same event for blockmovement
     
  10. Offline

    Hretsam

    Pull event is not in there now, will see if i can find it in the code, and add that to (as a onBlockPullEvent)

    EDIT:
    Bukkit pull request
    CraftBukkit pull request
     
  11. Offline

    MG127

    thx
    now the only thing that is missing is the push(block,direction) function
     
  12. Offline

    Hretsam

    Yeah i am working on that.

    Edit:
    Updated it, it will now also throw an event when a block is pulled!

    How do you mean?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
Thread Status:
Not open for further replies.

Share This Page