diff options
author | md_5 <git@md-5.net> | 2018-07-15 10:00:00 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2018-07-15 10:00:00 +1000 |
commit | f8b2086d60942eb2cd7ac25a2a1408cb790c222c (patch) | |
tree | a3c2dab586f0cd6c23412324aefd83cdab113514 /src/main/java/org/bukkit/block/Block.java | |
parent | bdd0eda71f87cb8ca3b1842bd9bbd43bba5a08bd (diff) | |
download | bukkit-f8b2086d60942eb2cd7ac25a2a1408cb790c222c.tar bukkit-f8b2086d60942eb2cd7ac25a2a1408cb790c222c.tar.gz bukkit-f8b2086d60942eb2cd7ac25a2a1408cb790c222c.tar.lz bukkit-f8b2086d60942eb2cd7ac25a2a1408cb790c222c.tar.xz bukkit-f8b2086d60942eb2cd7ac25a2a1408cb790c222c.zip |
Update to Minecraft 1.13-pre7
Diffstat (limited to 'src/main/java/org/bukkit/block/Block.java')
-rw-r--r-- | src/main/java/org/bukkit/block/Block.java | 69 |
1 files changed, 27 insertions, 42 deletions
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java index 235c15bd..1aa3373f 100644 --- a/src/main/java/org/bukkit/block/Block.java +++ b/src/main/java/org/bukkit/block/Block.java @@ -6,6 +6,7 @@ import org.bukkit.Chunk; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.Location; +import org.bukkit.block.data.BlockData; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.Metadatable; @@ -14,6 +15,11 @@ import org.bukkit.metadata.Metadatable; * any given location in a world. The state of the block may change * concurrently to your own handling of it; use block.getState() to get a * snapshot state of a block which will not be modified. + * + * <br> + * Note that parts of this class which require access to the world at large + * (i.e. lighting and power) may not be able to be safely accessed during world + * generation when used in cases like BlockPhysicsEvent!!!! */ public interface Block extends Metadatable { @@ -27,6 +33,13 @@ public interface Block extends Metadatable { byte getData(); /** + * Gets the complete block data for this block + * + * @return block specific data + */ + BlockData getBlockData(); + + /** * Gets the block at the given offsets * * @param modX X-coordinate offset @@ -73,15 +86,6 @@ public interface Block extends Metadatable { Material getType(); /** - * Gets the type-id of this block - * - * @return block type-id - * @deprecated Magic value - */ - @Deprecated - int getTypeId(); - - /** * Gets the light level between 0-15 * * @return light level @@ -180,52 +184,34 @@ public interface Block extends Metadatable { void setData(byte data, boolean applyPhysics); /** - * Sets the type of this block + * Sets the complete data for this block * - * @param type Material to change this block to + * @param data new block specific data */ - void setType(Material type); + void setBlockData(BlockData data); /** - * Sets the type of this block + * Sets the complete data for this block * - * @param type Material to change this block to - * @param applyPhysics False to cancel physics on the changed block. + * @param data new block specific data + * @param applyPhysics false to cancel physics from the changed block */ - void setType(Material type, boolean applyPhysics); + void setBlockData(BlockData data, boolean applyPhysics); /** - * Sets the type-id of this block + * Sets the type of this block * - * @param type Type-Id to change this block to - * @return whether the block was changed - * @deprecated Magic value + * @param type Material to change this block to */ - @Deprecated - boolean setTypeId(int type); + void setType(Material type); /** - * Sets the type-id of this block + * Sets the type of this block * - * @param type Type-Id to change this block to + * @param type Material to change this block to * @param applyPhysics False to cancel physics on the changed block. - * @return whether the block was changed - * @deprecated Magic value */ - @Deprecated - boolean setTypeId(int type, boolean applyPhysics); - - /** - * Sets the type-id of this block - * - * @param type Type-Id to change this block to - * @param data The data value to change this block to - * @param applyPhysics False to cancel physics on the changed block - * @return whether the block was changed - * @deprecated Magic value - */ - @Deprecated - boolean setTypeIdAndData(int type, byte data, boolean applyPhysics); + void setType(Material type, boolean applyPhysics); /** * Gets the face relation of this block compared to the given block. @@ -330,8 +316,7 @@ public interface Block extends Metadatable { * Checks if this block is liquid. * <p> * A block is considered liquid when {@link #getType()} returns {@link - * Material#WATER}, {@link Material#STATIONARY_WATER}, {@link - * Material#LAVA} or {@link Material#STATIONARY_LAVA}. + * Material#WATER} or {@link Material#LAVA}. * * @return true if this block is liquid */ |