Class McBlock
java.lang.Object
com.shanebeestudios.nms.api.world.block.McBlock
Wrapper for Minecraft Block
Provides easy-to-use mapped methods for Blocks
Keep in mind, a Minecraft Block differs from a Bukkit Block, A Minecraft Block is actually a TYPE, not a reference to a block in the world.
-
Method Summary
Modifier and TypeMethodDescription@Nullable net.minecraft.world.item.Item
asItem()
Get the Item version of this Blockfloat
Get the explosion resistance of this Blockfloat
Get the friction of this Blockfloat
Get the jump factor of this Blockfloat
Get the speed factor of this Blockboolean
Check if this Block has collisionboolean
Check if this Block is destroyablestatic McBlock
wrap
(net.minecraft.world.level.block.Block block) Wrap a Minecraft Block as an McBlockstatic McBlock
Wrap a Bukkit Block as an McBlock
-
Method Details
-
wrap
Wrap a Minecraft Block as an McBlock- Parameters:
block
- Minecraft block to wrap- Returns:
- Wrapper for Minecraft Block
-
wrap
Wrap a Bukkit Block as an McBlockBeing different Block classes, this essentially grabs the type of a Bukkit Block
- Parameters:
bukkitBlock
- Bukkit Block to wrap- Returns:
- Wrapper for Minecraft Block
-
asItem
@Nullable public @Nullable net.minecraft.world.item.Item asItem()Get the Item version of this Block- Returns:
- Item version of this Block
-
getFriction
public float getFriction()Get the friction of this Block- Returns:
- Friction of this block
-
getExplosionResistance
public float getExplosionResistance()Get the explosion resistance of this Block- Returns:
- Explosion resistance of this Block
-
getJumpFactor
public float getJumpFactor()Get the jump factor of this Block- Returns:
- Jump factor of this Block
-
getSpeedFactor
public float getSpeedFactor()Get the speed factor of this Block- Returns:
- Speed factor of this Block
-
hasCollision
public boolean hasCollision()Check if this Block has collision- Returns:
- True if Block has collision
-
isDestroyable
public boolean isDestroyable()Check if this Block is destroyable- Returns:
- True if Block is destroyable
-