public class BlockMock
extends java.lang.Object
implements org.bukkit.block.Block
| Constructor and Description |
|---|
BlockMock()
Creates a basic block made of air.
|
BlockMock(@NotNull org.bukkit.Location location)
Creates a basic block made of air at a certain location.
|
BlockMock(@NotNull org.bukkit.Material material)
Creates a basic block with a given material.
|
BlockMock(@NotNull org.bukkit.Material material,
@Nullable org.bukkit.Location location)
Creates a basic block with a given material that is also linked to a specific location.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
applyBoneMeal(org.bukkit.block.BlockFace face) |
void |
assertType(@NotNull org.bukkit.Material material)
Assets that the material type of the block is equal to a given type.
|
boolean |
breakNaturally() |
boolean |
breakNaturally(org.bukkit.inventory.ItemStack tool) |
org.bukkit.block.Biome |
getBiome() |
org.bukkit.block.data.BlockData |
getBlockData() |
int |
getBlockPower() |
int |
getBlockPower(org.bukkit.block.BlockFace face) |
org.bukkit.util.BoundingBox |
getBoundingBox() |
org.bukkit.Chunk |
getChunk() |
byte |
getData()
Deprecated.
|
java.util.Collection<org.bukkit.inventory.ItemStack> |
getDrops() |
java.util.Collection<org.bukkit.inventory.ItemStack> |
getDrops(org.bukkit.inventory.ItemStack tool) |
java.util.Collection<org.bukkit.inventory.ItemStack> |
getDrops(org.bukkit.inventory.ItemStack tool,
org.bukkit.entity.Entity entity) |
org.bukkit.block.BlockFace |
getFace(org.bukkit.block.Block block) |
double |
getHumidity() |
byte |
getLightFromBlocks() |
byte |
getLightFromSky() |
byte |
getLightLevel() |
org.bukkit.Location |
getLocation() |
org.bukkit.Location |
getLocation(org.bukkit.Location loc) |
java.util.List<org.bukkit.metadata.MetadataValue> |
getMetadata(java.lang.String metadataKey) |
org.bukkit.block.PistonMoveReaction |
getPistonMoveReaction() |
org.bukkit.block.Block |
getRelative(org.bukkit.block.BlockFace face) |
org.bukkit.block.Block |
getRelative(org.bukkit.block.BlockFace face,
int distance) |
org.bukkit.block.Block |
getRelative(int modX,
int modY,
int modZ) |
org.bukkit.block.BlockState |
getState() |
double |
getTemperature() |
org.bukkit.Material |
getType() |
org.bukkit.World |
getWorld() |
int |
getX() |
int |
getY() |
int |
getZ() |
boolean |
hasMetadata(java.lang.String metadataKey) |
boolean |
isBlockFaceIndirectlyPowered(org.bukkit.block.BlockFace face) |
boolean |
isBlockFacePowered(org.bukkit.block.BlockFace face) |
boolean |
isBlockIndirectlyPowered() |
boolean |
isBlockPowered() |
boolean |
isEmpty() |
boolean |
isLiquid() |
boolean |
isPassable() |
boolean |
isPreferredTool(org.bukkit.inventory.ItemStack tool) |
org.bukkit.util.RayTraceResult |
rayTrace(org.bukkit.Location start,
org.bukkit.util.Vector direction,
double maxDistance,
org.bukkit.FluidCollisionMode fluidCollisionMode) |
void |
removeMetadata(java.lang.String metadataKey,
org.bukkit.plugin.Plugin owningPlugin) |
void |
setBiome(org.bukkit.block.Biome bio) |
void |
setBlockData(@NotNull org.bukkit.block.data.BlockData data) |
void |
setBlockData(org.bukkit.block.data.BlockData data,
boolean applyPhysics) |
void |
setMetadata(java.lang.String metadataKey,
org.bukkit.metadata.MetadataValue newMetadataValue) |
void |
setState(@NotNull BlockStateMock state)
This method sets the current
BlockState to the provided BlockStateMock. |
void |
setType(org.bukkit.Material type) |
void |
setType(org.bukkit.Material type,
boolean applyPhysics) |
public BlockMock()
public BlockMock(@NotNull
@NotNull org.bukkit.Location location)
location - The location of the block.public BlockMock(@NotNull
@NotNull org.bukkit.Material material)
material - The material to give the block.public BlockMock(@NotNull
@NotNull org.bukkit.Material material,
@Nullable
@Nullable org.bukkit.Location location)
material - The material of the block.location - The location of the block. Can be null if not needed.public void setMetadata(java.lang.String metadataKey,
org.bukkit.metadata.MetadataValue newMetadataValue)
setMetadata in interface org.bukkit.metadata.Metadatablepublic java.util.List<org.bukkit.metadata.MetadataValue> getMetadata(java.lang.String metadataKey)
getMetadata in interface org.bukkit.metadata.Metadatablepublic boolean hasMetadata(java.lang.String metadataKey)
hasMetadata in interface org.bukkit.metadata.Metadatablepublic void removeMetadata(java.lang.String metadataKey,
org.bukkit.plugin.Plugin owningPlugin)
removeMetadata in interface org.bukkit.metadata.Metadatable@Deprecated public byte getData()
getData in interface org.bukkit.block.Blockpublic org.bukkit.block.Block getRelative(int modX,
int modY,
int modZ)
getRelative in interface org.bukkit.block.Blockpublic org.bukkit.block.Block getRelative(org.bukkit.block.BlockFace face)
getRelative in interface org.bukkit.block.Blockpublic org.bukkit.block.Block getRelative(org.bukkit.block.BlockFace face,
int distance)
getRelative in interface org.bukkit.block.Blockpublic void assertType(@NotNull
@NotNull org.bukkit.Material material)
material - The material type that the block should have.java.lang.AssertionError - Thrown if the material type of the block does not equal the given material type.public org.bukkit.Material getType()
getType in interface org.bukkit.block.Blockpublic byte getLightLevel()
getLightLevel in interface org.bukkit.block.Blockpublic byte getLightFromSky()
getLightFromSky in interface org.bukkit.block.Blockpublic byte getLightFromBlocks()
getLightFromBlocks in interface org.bukkit.block.Blockpublic org.bukkit.World getWorld()
getWorld in interface org.bukkit.block.Blockpublic int getX()
getX in interface org.bukkit.block.Blockpublic int getY()
getY in interface org.bukkit.block.Blockpublic int getZ()
getZ in interface org.bukkit.block.Blockpublic org.bukkit.Location getLocation()
getLocation in interface org.bukkit.block.Blockpublic org.bukkit.Location getLocation(org.bukkit.Location loc)
getLocation in interface org.bukkit.block.Blockpublic org.bukkit.Chunk getChunk()
getChunk in interface org.bukkit.block.Blockpublic void setType(org.bukkit.Material type)
setType in interface org.bukkit.block.Blockpublic void setType(org.bukkit.Material type,
boolean applyPhysics)
setType in interface org.bukkit.block.Blockpublic org.bukkit.block.BlockFace getFace(org.bukkit.block.Block block)
getFace in interface org.bukkit.block.Blockpublic org.bukkit.block.BlockState getState()
getState in interface org.bukkit.block.Blockpublic org.bukkit.block.Biome getBiome()
getBiome in interface org.bukkit.block.Blockpublic void setBiome(org.bukkit.block.Biome bio)
setBiome in interface org.bukkit.block.Blockpublic boolean isBlockPowered()
isBlockPowered in interface org.bukkit.block.Blockpublic boolean isBlockIndirectlyPowered()
isBlockIndirectlyPowered in interface org.bukkit.block.Blockpublic boolean isBlockFacePowered(org.bukkit.block.BlockFace face)
isBlockFacePowered in interface org.bukkit.block.Blockpublic boolean isBlockFaceIndirectlyPowered(org.bukkit.block.BlockFace face)
isBlockFaceIndirectlyPowered in interface org.bukkit.block.Blockpublic int getBlockPower(org.bukkit.block.BlockFace face)
getBlockPower in interface org.bukkit.block.Blockpublic int getBlockPower()
getBlockPower in interface org.bukkit.block.Blockpublic boolean isEmpty()
isEmpty in interface org.bukkit.block.Blockpublic boolean isLiquid()
isLiquid in interface org.bukkit.block.Blockpublic double getTemperature()
getTemperature in interface org.bukkit.block.Blockpublic double getHumidity()
getHumidity in interface org.bukkit.block.Blockpublic org.bukkit.block.PistonMoveReaction getPistonMoveReaction()
getPistonMoveReaction in interface org.bukkit.block.Blockpublic boolean breakNaturally()
breakNaturally in interface org.bukkit.block.Blockpublic boolean breakNaturally(org.bukkit.inventory.ItemStack tool)
breakNaturally in interface org.bukkit.block.Blockpublic java.util.Collection<org.bukkit.inventory.ItemStack> getDrops()
getDrops in interface org.bukkit.block.Blockpublic java.util.Collection<org.bukkit.inventory.ItemStack> getDrops(org.bukkit.inventory.ItemStack tool)
getDrops in interface org.bukkit.block.Blockpublic org.bukkit.block.data.BlockData getBlockData()
getBlockData in interface org.bukkit.block.Blockpublic void setBlockData(@NotNull
@NotNull org.bukkit.block.data.BlockData data)
setBlockData in interface org.bukkit.block.Blockpublic void setBlockData(org.bukkit.block.data.BlockData data,
boolean applyPhysics)
setBlockData in interface org.bukkit.block.Blockpublic boolean isPassable()
isPassable in interface org.bukkit.block.Blockpublic org.bukkit.util.RayTraceResult rayTrace(org.bukkit.Location start,
org.bukkit.util.Vector direction,
double maxDistance,
org.bukkit.FluidCollisionMode fluidCollisionMode)
rayTrace in interface org.bukkit.block.Blockpublic org.bukkit.util.BoundingBox getBoundingBox()
getBoundingBox in interface org.bukkit.block.Blockpublic java.util.Collection<org.bukkit.inventory.ItemStack> getDrops(org.bukkit.inventory.ItemStack tool,
org.bukkit.entity.Entity entity)
getDrops in interface org.bukkit.block.Blockpublic void setState(@NotNull
@NotNull BlockStateMock state)
BlockState to the provided BlockStateMock.
Do not call this method directly, use BlockState.update() instead.state - The BlockState that should be set.public boolean applyBoneMeal(org.bukkit.block.BlockFace face)
applyBoneMeal in interface org.bukkit.block.Blockpublic boolean isPreferredTool(org.bukkit.inventory.ItemStack tool)
isPreferredTool in interface org.bukkit.block.Block