Class McBlockState
java.lang.Object
com.shanebeestudios.nms.api.world.block.McBlockState
Wrapper for Minecraft BlockState
Provides easy-to-use mapped methods for BlockStates
Keep in mind, a Minecraft BlockState differs from a Bukkit BlockState.
A Minecraft BlockState is basically like Bukkit's BlockData
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if this BlockState can be replacedboolean
canSurvive
(Location location) Check if this BlockState can survive at a locationboolean
entityCanStandOn
(Entity bukkitEntity) Check if an Entity can stand on this BlockStatenet.minecraft.world.level.block.Block
getBlock()
Get the Block of this BlockStatenet.minecraft.world.phys.shapes.VoxelShape
getCollisionShape
(Location location) Get the collision shape of this BlockState at a location in the worldnet.minecraft.world.level.material.MapColor
getMapColor
(Location location) Get the MapColor this BlockState will appear on a mapGet a wrapped Block of this BlockStatestatic McBlockState
wrap
(net.minecraft.world.level.block.state.BlockState blockState) Wrap a Minecraft BlockState as an McBlockStatestatic McBlockState
Wrap a Bukkit BlockData as a Minecraft BlockState
-
Method Details
-
wrap
Wrap a Minecraft BlockState as an McBlockState- Parameters:
blockState
- BlockState to wrap- Returns:
- Wrapper for Minecraft BlockState
-
wrap
Wrap a Bukkit BlockData as a Minecraft BlockState- Parameters:
blockData
- BlockData to wrap- Returns:
- Wrapper for Minecraft BlockState
-
getBlock
public net.minecraft.world.level.block.Block getBlock()Get the Block of this BlockState- Returns:
- Block of this BlockState
-
getMcBlock
Get a wrapped Block of this BlockState- Returns:
- Wrapped Block of this BlockState
-
canSurvive
Check if this BlockState can survive at a locationExample of this would be checking if sand is supported or a block can be placed over farmland/dirt path
- Parameters:
location
- Location to check for survival- Returns:
- True if this BlockState can survive at this Location
-
entityCanStandOn
Check if an Entity can stand on this BlockState- Parameters:
bukkitEntity
- Entity to check if it can stand on this BlockState- Returns:
- True if the Entity can stand on this BlockState
-
canBeReplaced
public boolean canBeReplaced()Check if this BlockState can be replaced- Returns:
- True if it can be replaced
-
getCollisionShape
Get the collision shape of this BlockState at a location in the world- Parameters:
location
- Location to check for shape- Returns:
- VoxelShape of BlockState at location
-
getMapColor
Get the MapColor this BlockState will appear on a map- Parameters:
location
- Location of BlockState to test for color- Returns:
- MapColor of BlockState at given Location
-