From af781b4317273eaf2dac3ece3822fa79ccce0c40 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Fri, 7 Jan 2011 16:53:29 +0000 Subject: Added state update() --- src/main/java/org/bukkit/block/BlockState.java | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src') 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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); } -- cgit v1.2.3