Package be.seeseemelk.mockbukkit.block
Class BlockMock
java.lang.Object
be.seeseemelk.mockbukkit.block.BlockMock
- All Implemented Interfaces:
net.kyori.adventure.translation.Translatable,Block,Metadatable
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a basic block made of air.Creates a basic block made of air at a certain location.Creates a basic block with a given material.Creates a basic block with a given material that is also linked to a specific location. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplyBoneMeal(@NotNull BlockFace face) voidassertType(@NotNull Material material) Assets that the material type of the block is equal to a given type.booleanbooleanbreakNaturally(boolean triggerEffect) booleanbreakNaturally(@NotNull ItemStack tool, boolean triggerEffect) booleanbreakNaturally(@Nullable ItemStack tool) boolean@NotNull BiomegetBiome()@NotNull BlockDatalongDeprecated.intintgetBlockPower(@NotNull BlockFace face) @NotNull SoundGroup@NotNull BoundingBoxfloatgetBreakSpeed(@NotNull Player player) @NotNull ChunkgetChunk()@NotNull VoxelShape@NotNull BiomebytegetData()Deprecated.@org.jetbrains.annotations.NotNull floatgetDestroySpeed(@NotNull ItemStack itemStack) @org.jetbrains.annotations.NotNull floatgetDestroySpeed(@NotNull ItemStack itemStack, boolean considerEnchants) @NotNull Collection<ItemStack>getDrops()@NotNull Collection<ItemStack>@NotNull Collection<ItemStack>doublebytebytebyte@NotNull LocationgetLocation(@Nullable Location loc) @NotNull List<MetadataValue>getMetadata(String metadataKey) @NotNull PistonMoveReaction@NotNull BlockgetRelative(int modX, int modY, int modZ) @NotNull BlockgetRelative(@NotNull BlockFace face) @NotNull BlockgetRelative(@NotNull BlockFace face, int distance) @NotNull BlockSoundGroupDeprecated, for removal: This API element is subject to removal in a future version.@NotNull BlockStategetState()@NotNull BlockStategetState(boolean useSnapshot) double@NotNull String@NotNull MaterialgetType()@NotNull WorldgetWorld()intgetX()intgetY()intgetZ()booleanhasMetadata(String metadataKey) booleanisBlockFaceIndirectlyPowered(@NotNull BlockFace face) booleanisBlockFacePowered(@NotNull BlockFace face) booleanbooleanbooleanbooleanbooleanbooleanisEmpty()booleanisLiquid()booleanbooleanisPreferredTool(@NotNull ItemStack tool) booleanbooleanisSolid()booleanisValidTool(@NotNull ItemStack itemStack) voidrayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) voidremoveMetadata(String metadataKey, Plugin owningPlugin) voidvoidsetBlockData(@NotNull BlockData data) voidsetBlockData(@NotNull BlockData data, boolean applyPhysics) voidsetMetadata(String metadataKey, @NotNull MetadataValue newMetadataValue) voidsetState(@NotNull BlockStateMock state) This method sets the currentBlockStateto the providedBlockStateMock.voidvoidvoidtick()@NotNull String
-
Constructor Details
-
BlockMock
public BlockMock()Creates a basic block made of air. -
BlockMock
Creates a basic block made of air at a certain location.- Parameters:
location- The location of the block.
-
BlockMock
Creates a basic block with a given material.- Parameters:
material- The material to give the block.
-
BlockMock
Creates a basic block with a given material that is also linked to a specific location.- Parameters:
material- The material of the block.location- The location of the block. Can benullif not needed.
-
-
Method Details
-
setMetadata
- Specified by:
setMetadatain interfaceMetadatable
-
getMetadata
- Specified by:
getMetadatain interfaceMetadatable
-
hasMetadata
- Specified by:
hasMetadatain interfaceMetadatable
-
removeMetadata
- Specified by:
removeMetadatain interfaceMetadatable
-
getData
Deprecated. -
getRelative
- Specified by:
getRelativein interfaceBlock
-
getRelative
- Specified by:
getRelativein interfaceBlock
-
getRelative
- Specified by:
getRelativein interfaceBlock
-
assertType
Assets that the material type of the block is equal to a given type.- Parameters:
material- The material type that the block should have.- Throws:
AssertionError- Thrown if the material type of the block does not equal the given material type.
-
getType
-
getLightLevel
public byte getLightLevel()- Specified by:
getLightLevelin interfaceBlock
-
getLightFromSky
public byte getLightFromSky()- Specified by:
getLightFromSkyin interfaceBlock
-
getLightFromBlocks
public byte getLightFromBlocks()- Specified by:
getLightFromBlocksin interfaceBlock
-
getWorld
-
getX
public int getX() -
getY
public int getY() -
getZ
public int getZ() -
getBlockKey
Deprecated.- Specified by:
getBlockKeyin interfaceBlock
-
getLocation
- Specified by:
getLocationin interfaceBlock
-
getLocation
- Specified by:
getLocationin interfaceBlock
-
getChunk
-
setType
-
setType
-
getFace
-
getState
-
getBiome
-
getComputedBiome
- Specified by:
getComputedBiomein interfaceBlock
-
getDestroySpeed
@NotNull public @org.jetbrains.annotations.NotNull float getDestroySpeed(@NotNull @NotNull ItemStack itemStack) - Specified by:
getDestroySpeedin interfaceBlock
-
getState
-
isValidTool
- Specified by:
isValidToolin interfaceBlock
-
setBiome
-
isBlockPowered
public boolean isBlockPowered()- Specified by:
isBlockPoweredin interfaceBlock
-
isBlockIndirectlyPowered
public boolean isBlockIndirectlyPowered()- Specified by:
isBlockIndirectlyPoweredin interfaceBlock
-
isBlockFacePowered
- Specified by:
isBlockFacePoweredin interfaceBlock
-
isBlockFaceIndirectlyPowered
- Specified by:
isBlockFaceIndirectlyPoweredin interfaceBlock
-
getBlockPower
- Specified by:
getBlockPowerin interfaceBlock
-
getBlockPower
public int getBlockPower()- Specified by:
getBlockPowerin interfaceBlock
-
isEmpty
public boolean isEmpty() -
isBurnable
public boolean isBurnable()- Specified by:
isBurnablein interfaceBlock
-
isSolid
public boolean isSolid() -
isCollidable
public boolean isCollidable()- Specified by:
isCollidablein interfaceBlock
-
isReplaceable
public boolean isReplaceable()- Specified by:
isReplaceablein interfaceBlock
-
isLiquid
public boolean isLiquid() -
isBuildable
public boolean isBuildable()- Specified by:
isBuildablein interfaceBlock
-
getSoundGroup
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
getSoundGroupin interfaceBlock
-
getBlockSoundGroup
- Specified by:
getBlockSoundGroupin interfaceBlock
-
getTranslationKey
- Specified by:
getTranslationKeyin interfaceBlock
-
getDestroySpeed
@NotNull public @org.jetbrains.annotations.NotNull float getDestroySpeed(@NotNull @NotNull ItemStack itemStack, boolean considerEnchants) - Specified by:
getDestroySpeedin interfaceBlock
-
breakNaturally
- Specified by:
breakNaturallyin interfaceBlock
-
tick
public void tick() -
randomTick
public void randomTick()- Specified by:
randomTickin interfaceBlock
-
breakNaturally
public boolean breakNaturally(boolean triggerEffect) - Specified by:
breakNaturallyin interfaceBlock
-
getTemperature
public double getTemperature()- Specified by:
getTemperaturein interfaceBlock
-
getHumidity
public double getHumidity()- Specified by:
getHumidityin interfaceBlock
-
getPistonMoveReaction
- Specified by:
getPistonMoveReactionin interfaceBlock
-
breakNaturally
public boolean breakNaturally()- Specified by:
breakNaturallyin interfaceBlock
-
breakNaturally
- Specified by:
breakNaturallyin interfaceBlock
-
getDrops
-
getDrops
-
getBlockData
- Specified by:
getBlockDatain interfaceBlock
-
setBlockData
- Specified by:
setBlockDatain interfaceBlock
-
setBlockData
- Specified by:
setBlockDatain interfaceBlock
-
isPassable
public boolean isPassable()- Specified by:
isPassablein interfaceBlock
-
rayTrace
public RayTraceResult rayTrace(@NotNull @NotNull Location start, @NotNull @NotNull Vector direction, double maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode) -
getBoundingBox
- Specified by:
getBoundingBoxin interfaceBlock
-
getCollisionShape
- Specified by:
getCollisionShapein interfaceBlock
-
getDrops
@NotNull public @NotNull Collection<ItemStack> getDrops(@NotNull @NotNull ItemStack tool, Entity entity) -
setState
This method sets the currentBlockStateto the providedBlockStateMock. Do not call this method directly, useBlockState.update()instead.- Parameters:
state- TheBlockStatethat should be set.
-
applyBoneMeal
- Specified by:
applyBoneMealin interfaceBlock
-
isPreferredTool
- Specified by:
isPreferredToolin interfaceBlock
-
getBreakSpeed
- Specified by:
getBreakSpeedin interfaceBlock
-
canPlace
-
translationKey
- Specified by:
translationKeyin interfacenet.kyori.adventure.translation.Translatable
-