Solved Restoring a couple blocks via BlockState

Discussion in 'Plugin Development' started by Paxination, Dec 20, 2013.

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

    Paxination

    So is restoring a couple random blocks as simple as this?

    BlockState state = loc.getblock().getblockstate

    and after they are modified by some one, do...
    state.update()?
     
  2. Offline

    adam753

    It's probably better to do state.update(true) which enabled the "force" flag. The javadoc is hard to understand but it looks like you'd need to do this for it to work properly. Besides, forcing is always good in programming, right?

    But in a word, yes.
     
  3. Offline

    Paxination

    TY! Worked a charm. Too bad tho that sign text and chest contents dont work yet. Which is the whole reason why I looked into BlockState. But using BS (hee hee) makes it easier to restore the blocks back than my method.

    https://bukkit.atlassian.net/browse/BUKKIT-3522
     
Thread Status:
Not open for further replies.

Share This Page