Solved Removing a block sent with sendBlockChange()?

Discussion in 'Plugin Development' started by ColonelHedgehog, Dec 15, 2014.

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

    ColonelHedgehog

    Is there a way to reverse the fake block sent with sendBlockChange() (other than right-clicking[?] it)?
     
  2. Offline

    BrennyMullan

    Use the same method you used to spawn it in but set it AIR
     
  3. Offline

    ColonelHedgehog

    Uh, what if I sent the block change on grass or something?
     
  4. Offline

    BrennyMullan

    Before sending the block change save the block state of the blocks your going to change then use the same method for reverting it back using the saved state
     
  5. Offline

    ColonelHedgehog

    Ergh, I suspected it might be something like that.

    Thanks.
     
  6. Offline

    crolemol

    @ColonelHedgehog
    it is easy. the blockchange method send s a block change to a player so... the block isn't really changed. just get the block at that location (loc.getblock()) and get the material. use this material to send a new blockchange. done
     
  7. Offline

    ColonelHedgehog

    Not really. What if it's a specific type of wood, or a cauldron or something?
     
  8. Offline

    97WaterPolo

    @ColonelHedgehog
    Couldn't you save the block's state, and send the block change with the block's material and the data value? I believe you can get the data value (different woods) from the block state?
     
  9. Offline

    ColonelHedgehog

    Sure, I guess that'd work.
     
  10. Offline

    crolemol

    @ColonelHedgehog
    I use blockchanges for moving buildings and i can say you that the block is not really changed so when you use loc.getBlock() you get the block everyoneelse can see. to get the orientation and type use block.getdata() and maybe block.geBlockFace(). It works I can give you some code if you want to?
     
    Rocoty likes this.
  11. Offline

    Rocoty

    @97WaterPolo No need to store something that's already stored.
     
  12. Offline

    ColonelHedgehog

    Ah, I forgot about that. Thanks for that. :) And no, I don't think that'll be necessary.
     
  13. Offline

    xize

    @ColonelHedgehog
    (I know its solved, but...)
    a other option is just using block.getState().update(); which updates the client sided block back to normal because it resents basicly a block update to all clients.
     
    moo3oo3oo3 likes this.
  14. Offline

    ColonelHedgehog

    Okay. Thanks. ;)
     
Thread Status:
Not open for further replies.

Share This Page