Cuberite
A lightweight, fast and extensible game server for Minecraft
Static Public Member Functions | List of all members
cBlockInfo Class Reference

#include <BlockInfo.h>

Static Public Member Functions

static bool CanBeTerraformed (BLOCKTYPE Block)
 Can a finisher change it? More...
 
static bool FullyOccupiesVoxel (BLOCKTYPE Block)
 Does this block fully occupy its voxel - is it a 'full' block? More...
 
static float GetBlockHeight (BLOCKTYPE Block)
 Block's height. More...
 
static float GetHardness (BLOCKTYPE Block)
 Block's hardness. More...
 
static NIBBLETYPE GetLightValue (BLOCKTYPE Block)
 How much light do the blocks emit on their own? More...
 
static NIBBLETYPE GetSpreadLightFalloff (BLOCKTYPE Block)
 How much light do the blocks consume? More...
 
static bool IsClickedThrough (BLOCKTYPE a_Block)
 Does the client pretend the block doesn't exist when clicking? For example, digging a fire will hit the block below the fire, so fire is "clicked through". More...
 
static bool IsOneHitDig (BLOCKTYPE Block)
 Is a block destroyed after a single hit? Warning: IsOneHitDig does not take into account enchantments / status effects / swim state / floating state and therefore may be incorrect. More...
 
static bool IsPistonBreakable (BLOCKTYPE Block)
 Can a piston break this block? More...
 
static bool IsRainBlocker (BLOCKTYPE Block)
 Does this block block the passage of rain? More...
 
static bool IsSkylightDispersant (BLOCKTYPE Block)
 Does this block disperse sky light? (only relevant for transparent blocks) More...
 
static bool IsSnowable (BLOCKTYPE Block)
 
static bool IsSolid (BLOCKTYPE Block)
 Is this block solid (player cannot walk through)? More...
 
static bool IsTransparent (BLOCKTYPE Block)
 Is a block transparent? (https://minecraft.wiki/w/Opacity) More...
 
static bool IsUseableBySpectator (BLOCKTYPE Block)
 Can a spectator interact with this block? More...
 

Detailed Description

Definition at line 11 of file BlockInfo.h.

Member Function Documentation

◆ CanBeTerraformed()

bool cBlockInfo::CanBeTerraformed ( BLOCKTYPE  Block)
static

Can a finisher change it?

Definition at line 575 of file BlockInfo.cpp.

◆ FullyOccupiesVoxel()

bool cBlockInfo::FullyOccupiesVoxel ( BLOCKTYPE  Block)
static

Does this block fully occupy its voxel - is it a 'full' block?

Definition at line 606 of file BlockInfo.cpp.

◆ GetBlockHeight()

float cBlockInfo::GetBlockHeight ( BLOCKTYPE  Block)
static

Block's height.

Definition at line 1153 of file BlockInfo.cpp.

◆ GetHardness()

float cBlockInfo::GetHardness ( BLOCKTYPE  Block)
static

Block's hardness.

The greater the value the longer the player needs to break the block.

Definition at line 1187 of file BlockInfo.cpp.

◆ GetLightValue()

NIBBLETYPE cBlockInfo::GetLightValue ( BLOCKTYPE  Block)
static

How much light do the blocks emit on their own?

Definition at line 411 of file BlockInfo.cpp.

◆ GetSpreadLightFalloff()

NIBBLETYPE cBlockInfo::GetSpreadLightFalloff ( BLOCKTYPE  Block)
static

How much light do the blocks consume?

Definition at line 447 of file BlockInfo.cpp.

◆ IsClickedThrough()

bool cBlockInfo::IsClickedThrough ( BLOCKTYPE  a_Block)
static

Does the client pretend the block doesn't exist when clicking? For example, digging a fire will hit the block below the fire, so fire is "clicked through".

Definition at line 720 of file BlockInfo.cpp.

◆ IsOneHitDig()

bool cBlockInfo::IsOneHitDig ( BLOCKTYPE  Block)
static

Is a block destroyed after a single hit? Warning: IsOneHitDig does not take into account enchantments / status effects / swim state / floating state and therefore may be incorrect.

Only use to check if hardness is 0. If you want to check if a player would instantly mine a_Block use cPlayer::CanInstantlyMine(a_Block)

Definition at line 731 of file BlockInfo.cpp.

◆ IsPistonBreakable()

bool cBlockInfo::IsPistonBreakable ( BLOCKTYPE  Block)
static

Can a piston break this block?

Definition at line 750 of file BlockInfo.cpp.

◆ IsRainBlocker()

bool cBlockInfo::IsRainBlocker ( BLOCKTYPE  Block)
static

Does this block block the passage of rain?

Definition at line 847 of file BlockInfo.cpp.

◆ IsSkylightDispersant()

bool cBlockInfo::IsSkylightDispersant ( BLOCKTYPE  Block)
static

Does this block disperse sky light? (only relevant for transparent blocks)

Definition at line 864 of file BlockInfo.cpp.

◆ IsSnowable()

bool cBlockInfo::IsSnowable ( BLOCKTYPE  Block)
static

Definition at line 879 of file BlockInfo.cpp.

◆ IsSolid()

bool cBlockInfo::IsSolid ( BLOCKTYPE  Block)
static

Is this block solid (player cannot walk through)?

Definition at line 892 of file BlockInfo.cpp.

◆ IsTransparent()

bool cBlockInfo::IsTransparent ( BLOCKTYPE  Block)
static

Is a block transparent? (https://minecraft.wiki/w/Opacity)

Definition at line 961 of file BlockInfo.cpp.

◆ IsUseableBySpectator()

bool cBlockInfo::IsUseableBySpectator ( BLOCKTYPE  Block)
static

Can a spectator interact with this block?

Definition at line 1134 of file BlockInfo.cpp.


The documentation for this class was generated from the following files: