diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-07 16:53:29 +0000 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-01-07 16:53:29 +0000 |
commit | af781b4317273eaf2dac3ece3822fa79ccce0c40 (patch) | |
tree | 673ca4c83838d9afef58950336e8e1fba3ed9dd4 /src/main | |
parent | 4cdd5199630510b6d15437202e6870e6786605b8 (diff) | |
download | bukkit-af781b4317273eaf2dac3ece3822fa79ccce0c40.tar bukkit-af781b4317273eaf2dac3ece3822fa79ccce0c40.tar.gz bukkit-af781b4317273eaf2dac3ece3822fa79ccce0c40.tar.lz bukkit-af781b4317273eaf2dac3ece3822fa79ccce0c40.tar.xz bukkit-af781b4317273eaf2dac3ece3822fa79ccce0c40.zip |
Added state update()
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/block/BlockState.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/block/BlockState.java b/src/main/java/org/bukkit/block/BlockState.java index 6b8c6161..cb124fc7 100644 --- a/src/main/java/org/bukkit/block/BlockState.java +++ b/src/main/java/org/bukkit/block/BlockState.java @@ -105,4 +105,34 @@ public interface BlockState { * @param type Type-ID to change this block to */ void setTypeID(int type); + + /** + * Attempts to update the block represented by this state, setting it to the + * new values as defined by this state. <br /> + * <br /> + * This has the same effect as calling update(false). That is to say, + * this will not modify the state of a block if it is no longer the same + * type as it was when this state was taken. It will return false in this + * eventuality. + * + * @return true if the update was successful, otherwise false + * @see BlockState.update(boolean force) + */ + boolean update(); + + /** + * Attempts to update the block represented by this state, setting it to the + * new values as defined by this state. <br /> + * <br /> + * Unless force is true, this will not modify the state of a block if it is + * no longer the same type as it was when this state was taken. It will return + * false in this eventuality.<br /> + * <br /> + * If force is true, it will set the type of the block to match the new state, + * set the state data and then return true. + * + * @param force true to forcefully set the state + * @return true if the update was successful, otherwise false + */ + boolean update(boolean force); } |