![]() |
Bukkit
1.4.7-R1.0
|
Represents a block. More...
Inheritance diagram for org.bukkit.block.Block:
Collaboration diagram for org.bukkit.block.Block:Public Member Functions | |
| byte | getData () |
| Gets the metadata for this block. | |
| Block | getRelative (int modX, int modY, int modZ) |
| Gets the block at the given offsets. | |
| Block | getRelative (BlockFace face) |
| Gets the block at the given face. | |
| Block | getRelative (BlockFace face, int distance) |
| Gets the block at the given distance of the given face. | |
| Material | getType () |
| Gets the type of this block. | |
| int | getTypeId () |
| Gets the type-id of this block. | |
| byte | getLightLevel () |
| Gets the light level between 0-15. | |
| byte | getLightFromSky () |
| Get the amount of light at this block from the sky. | |
| byte | getLightFromBlocks () |
| Get the amount of light at this block from nearby blocks. | |
| World | getWorld () |
| Gets the world which contains this Block. | |
| int | getX () |
| Gets the x-coordinate of this block. | |
| int | getY () |
| Gets the y-coordinate of this block. | |
| int | getZ () |
| Gets the z-coordinate of this block. | |
| Location | getLocation () |
| Gets the Location of the block. | |
| Location | getLocation (Location loc) |
| Stores the location of the block in the provided Location object. | |
| Chunk | getChunk () |
| Gets the chunk which contains this block. | |
| void | setData (byte data) |
| Sets the metadata for this block. | |
| void | setData (byte data, boolean applyPhysics) |
| Sets the metadata for this block. | |
| void | setType (Material type) |
| Sets the type of this block. | |
| boolean | setTypeId (int type) |
| Sets the type-id of this block. | |
| boolean | setTypeId (int type, boolean applyPhysics) |
| Sets the type-id of this block. | |
| boolean | setTypeIdAndData (int type, byte data, boolean applyPhysics) |
| Sets the type-id of this block. | |
| BlockFace | getFace (Block block) |
| Gets the face relation of this block compared to the given block. | |
| BlockState | getState () |
| Captures the current state of this block. | |
| Biome | getBiome () |
| Returns the biome that this block resides in. | |
| void | setBiome (Biome bio) |
| Sets the biome that this block resides in. | |
| boolean | isBlockPowered () |
| Returns true if the block is being powered by Redstone. | |
| boolean | isBlockIndirectlyPowered () |
| Returns true if the block is being indirectly powered by Redstone. | |
| boolean | isBlockFacePowered (BlockFace face) |
| Returns true if the block face is being powered by Redstone. | |
| boolean | isBlockFaceIndirectlyPowered (BlockFace face) |
| Returns true if the block face is being indirectly powered by Redstone. | |
| int | getBlockPower (BlockFace face) |
| Returns the redstone power being provided to this block face. | |
| int | getBlockPower () |
| Returns the redstone power being provided to this block. | |
| boolean | isEmpty () |
| Checks if this block is empty. | |
| boolean | isLiquid () |
| Checks if this block is liquid. | |
| double | getTemperature () |
| Gets the temperature of the biome of this block. | |
| double | getHumidity () |
| Gets the humidity of the biome of this block. | |
| PistonMoveReaction | getPistonMoveReaction () |
| Returns the reaction of the block when moved by a piston. | |
| boolean | breakNaturally () |
| Breaks the block and spawns items as if a player had digged it. | |
| boolean | breakNaturally (ItemStack tool) |
| Breaks the block and spawns items as if a player had digged it with a specific tool. | |
| Collection< ItemStack > | getDrops () |
| Returns a list of items which would drop by destroying this block. | |
| Collection< ItemStack > | getDrops (ItemStack tool) |
| Returns a list of items which would drop by destroying this block with a specific tool. | |
Public Member Functions inherited from org.bukkit.metadata.Metadatable | |
| void | setMetadata (String metadataKey, MetadataValue newMetadataValue) |
| Sets a metadata value in the implementing object's metadata store. | |
| List< MetadataValue > | getMetadata (String metadataKey) |
| Returns a list of previously set metadata values from the implementing object's metadata store. | |
| boolean | hasMetadata (String metadataKey) |
| Tests to see whether the implementing object contains the given metadata value in its metadata store. | |
| void | removeMetadata (String metadataKey, Plugin owningPlugin) |
| Removes the given metadata value from the implementing object's metadata store. | |
Represents a block.
This is a live object, and only one Block may exist for 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.
Definition at line 18 of file Block.java.
| boolean org.bukkit.block.Block.breakNaturally | ( | ) |
Breaks the block and spawns items as if a player had digged it.
| boolean org.bukkit.block.Block.breakNaturally | ( | ItemStack | tool | ) |
Breaks the block and spawns items as if a player had digged it with a specific tool.
| tool | The tool or item in hand used for digging |
| Biome org.bukkit.block.Block.getBiome | ( | ) |
Returns the biome that this block resides in.
| int org.bukkit.block.Block.getBlockPower | ( | BlockFace | face | ) |
Returns the redstone power being provided to this block face.
| face | the face of the block to query or BlockFace.SELF for the block itself |
| int org.bukkit.block.Block.getBlockPower | ( | ) |
Returns the redstone power being provided to this block.
| Chunk org.bukkit.block.Block.getChunk | ( | ) |
Gets the chunk which contains this block.
| byte org.bukkit.block.Block.getData | ( | ) |
Gets the metadata for this block.
| Collection<ItemStack> org.bukkit.block.Block.getDrops | ( | ) |
Returns a list of items which would drop by destroying this block.
Returns a list of items which would drop by destroying this block with a specific tool.
| tool | The tool or item in hand used for digging |
Gets the face relation of this block compared to the given block.
For example:
Block current = world.getBlockAt(100, 100, 100); Block target = world.getBlockAt(100, 101, 100);
current.getFace(target) == BlockFace.Up;
If the given block is not connected to this block, null may be returned
| block | Block to compare against this block |
| double org.bukkit.block.Block.getHumidity | ( | ) |
Gets the humidity of the biome of this block.
| byte org.bukkit.block.Block.getLightFromBlocks | ( | ) |
Get the amount of light at this block from nearby blocks.
Any light given from other sources (such as the sun) will be ignored.
| byte org.bukkit.block.Block.getLightFromSky | ( | ) |
Get the amount of light at this block from the sky.
Any light given from other sources (such as blocks like torches) will be ignored.
| byte org.bukkit.block.Block.getLightLevel | ( | ) |
Gets the light level between 0-15.
| Location org.bukkit.block.Block.getLocation | ( | ) |
Gets the Location of the block.
Referenced by org.bukkit.event.block.BlockPistonRetractEvent.getRetractLocation().
| PistonMoveReaction org.bukkit.block.Block.getPistonMoveReaction | ( | ) |
Returns the reaction of the block when moved by a piston.
| Block org.bukkit.block.Block.getRelative | ( | int | modX, |
| int | modY, | ||
| int | modZ | ||
| ) |
Gets the block at the given offsets.
| modX | X-coordinate offset |
| modY | Y-coordinate offset |
| modZ | Z-coordinate offset |
Referenced by org.bukkit.util.BlockIterator.BlockIterator(), org.bukkit.event.block.BlockPistonExtendEvent.getBlocks(), org.bukkit.event.block.BlockPistonRetractEvent.getRetractLocation(), and org.bukkit.event.block.BlockFromToEvent.getToBlock().
Gets the block at the given face.
This method is equal to getRelative(face, 1)
| face | Face of this block to return |
Gets the block at the given distance of the given face.
For example, the following method places water at 100,102,100; two blocks above 100,100,100.
Block block = world.getBlockAt(100, 100, 100); Block shower = block.getRelative(BlockFace.UP, 2); shower.setType(Material.WATER);
| face | Face of this block to return |
| distance | Distance to get the block at |
| BlockState org.bukkit.block.Block.getState | ( | ) |
Captures the current state of this block.
You may then cast that state into any accepted type, such as Furnace or Sign.
The returned object will never be updated, and you are not guaranteed that (for example) a sign is still a sign after you capture its state.
| double org.bukkit.block.Block.getTemperature | ( | ) |
Gets the temperature of the biome of this block.
| Material org.bukkit.block.Block.getType | ( | ) |
Gets the type of this block.
Referenced by org.bukkit.generator.ChunkGenerator.canSpawn(), and org.bukkit.event.block.BlockPistonEvent.isSticky().
| int org.bukkit.block.Block.getTypeId | ( | ) |
Gets the type-id of this block.
| World org.bukkit.block.Block.getWorld | ( | ) |
| int org.bukkit.block.Block.getX | ( | ) |
Gets the x-coordinate of this block.
| int org.bukkit.block.Block.getY | ( | ) |
Gets the y-coordinate of this block.
| int org.bukkit.block.Block.getZ | ( | ) |
Gets the z-coordinate of this block.
| boolean org.bukkit.block.Block.isBlockFaceIndirectlyPowered | ( | BlockFace | face | ) |
Returns true if the block face is being indirectly powered by Redstone.
| face | The block face |
| boolean org.bukkit.block.Block.isBlockFacePowered | ( | BlockFace | face | ) |
Returns true if the block face is being powered by Redstone.
| face | The block face |
| boolean org.bukkit.block.Block.isBlockIndirectlyPowered | ( | ) |
Returns true if the block is being indirectly powered by Redstone.
| boolean org.bukkit.block.Block.isBlockPowered | ( | ) |
Returns true if the block is being powered by Redstone.
| boolean org.bukkit.block.Block.isEmpty | ( | ) |
Checks if this block is empty.
A block is considered empty when getType() returns Material#AIR.
| boolean org.bukkit.block.Block.isLiquid | ( | ) |
Checks if this block is liquid.
A block is considered liquid when getType() returns Material#WATER, Material#STATIONARY_WATER, Material#LAVA or Material#STATIONARY_LAVA.
| void org.bukkit.block.Block.setBiome | ( | Biome | bio | ) |
Sets the biome that this block resides in.
| bio | new Biome type for this block |
| void org.bukkit.block.Block.setData | ( | byte | data | ) |
Sets the metadata for this block.
| data | New block specific metadata |
| void org.bukkit.block.Block.setData | ( | byte | data, |
| boolean | applyPhysics | ||
| ) |
Sets the metadata for this block.
| data | New block specific metadata |
| applyPhysics | False to cancel physics from the changed block. |
| void org.bukkit.block.Block.setType | ( | Material | type | ) |
Sets the type of this block.
| type | Material to change this block to |
| boolean org.bukkit.block.Block.setTypeId | ( | int | type | ) |
Sets the type-id of this block.
| type | Type-Id to change this block to |
| boolean org.bukkit.block.Block.setTypeId | ( | int | type, |
| boolean | applyPhysics | ||
| ) |
Sets the type-id of this block.
| type | Type-Id to change this block to |
| applyPhysics | False to cancel physics on the changed block. |
| boolean org.bukkit.block.Block.setTypeIdAndData | ( | int | type, |
| byte | data, | ||
| boolean | applyPhysics | ||
| ) |
Sets the type-id of this block.
| type | Type-Id to change this block to |
| data | The data value to change this block to |
| applyPhysics | False to cancel physics on the changed block |