2014-03-01 10:04:17 -05:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2020-09-25 05:13:59 -04:00
|
|
|
#include "ChunkDef.h"
|
2014-03-01 10:04:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-18 11:37:07 -04:00
|
|
|
|
2014-03-02 03:50:24 -05:00
|
|
|
// tolua_begin
|
2014-03-01 14:34:19 -05:00
|
|
|
class cBlockInfo
|
2014-03-01 10:04:17 -05:00
|
|
|
{
|
|
|
|
public:
|
2018-02-20 05:43:28 -05:00
|
|
|
|
|
|
|
// tolua_end
|
|
|
|
|
2020-09-12 14:57:44 -04:00
|
|
|
/** Returns how much of an explosion Destruction Lazor's (tm) intensity the given block attenuates.
|
|
|
|
See Physics\Explodinator.cpp for details of explosion block destruction. */
|
|
|
|
static float GetExplosionAbsorption(BLOCKTYPE Block);
|
|
|
|
|
2020-10-18 11:37:07 -04:00
|
|
|
// tolua_begin
|
2014-03-01 14:34:19 -05:00
|
|
|
|
|
|
|
/** How much light do the blocks emit on their own? */
|
2020-10-18 11:37:07 -04:00
|
|
|
static NIBBLETYPE GetLightValue(BLOCKTYPE Block);
|
2014-03-01 14:34:19 -05:00
|
|
|
|
|
|
|
/** How much light do the blocks consume? */
|
2020-10-18 11:37:07 -04:00
|
|
|
static NIBBLETYPE GetSpreadLightFalloff(BLOCKTYPE Block);
|
2014-03-01 10:04:17 -05:00
|
|
|
|
2020-10-18 11:37:07 -04:00
|
|
|
/** Can a finisher change it? */
|
|
|
|
static bool CanBeTerraformed(BLOCKTYPE Block);
|
2014-03-01 14:34:19 -05:00
|
|
|
|
2020-10-18 11:37:07 -04:00
|
|
|
/** Does this block fully occupy its voxel - is it a 'full' block? */
|
|
|
|
static bool FullyOccupiesVoxel(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. 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) */
|
|
|
|
static bool IsOneHitDig(BLOCKTYPE Block);
|
2014-03-01 14:34:19 -05:00
|
|
|
|
|
|
|
/** Can a piston break this block? */
|
2020-10-18 11:37:07 -04:00
|
|
|
static bool IsPistonBreakable(BLOCKTYPE Block);
|
2014-03-01 14:34:19 -05:00
|
|
|
|
2017-12-26 16:25:57 -05:00
|
|
|
/** Does this block block the passage of rain? */
|
2020-10-18 11:37:07 -04:00
|
|
|
static bool IsRainBlocker(BLOCKTYPE Block);
|
2017-12-26 16:25:57 -05:00
|
|
|
|
|
|
|
/** Does this block disperse sky light? (only relevant for transparent blocks) */
|
2020-10-18 11:37:07 -04:00
|
|
|
static bool IsSkylightDispersant(BLOCKTYPE Block);
|
2017-09-07 06:56:17 -04:00
|
|
|
|
2020-10-18 11:37:07 -04:00
|
|
|
static bool IsSnowable(BLOCKTYPE Block);
|
2014-03-01 14:34:19 -05:00
|
|
|
|
2020-10-18 11:37:07 -04:00
|
|
|
/** Is this block solid (player cannot walk through)? */
|
|
|
|
static bool IsSolid(BLOCKTYPE Block);
|
2016-10-12 08:38:45 -04:00
|
|
|
|
2020-10-18 11:37:07 -04:00
|
|
|
/** Is a block transparent? (https://minecraft.gamepedia.com/Opacity) */
|
|
|
|
static bool IsTransparent(BLOCKTYPE Block);
|
2014-03-01 10:04:17 -05:00
|
|
|
|
2020-10-18 11:37:07 -04:00
|
|
|
/** Can a spectator interact with this block? */
|
|
|
|
static bool IsUseableBySpectator(BLOCKTYPE Block);
|
2014-07-29 16:31:31 -04:00
|
|
|
|
2020-10-18 11:37:07 -04:00
|
|
|
/** Block's height. */
|
|
|
|
static float GetBlockHeight(BLOCKTYPE Block);
|
2015-11-10 08:02:07 -05:00
|
|
|
|
2016-11-06 13:30:19 -05:00
|
|
|
/** Block's hardness. The greater the value the longer the player needs to break the block. */
|
2020-10-18 11:37:07 -04:00
|
|
|
static float GetHardness(BLOCKTYPE Block);
|
|
|
|
};
|
|
|
|
// tolua_end
|
2014-03-01 10:04:17 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-02 14:25:05 -05:00
|
|
|
|
2020-04-03 02:57:01 -04:00
|
|
|
bool IsBlockWater(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockIce(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockWaterOrIce(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockLava(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockLiquid(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockRail(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockTypeOfDirt(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockFence(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockMaterialWood(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockMaterialPlants(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockMaterialVine(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockMaterialIron(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockMaterialLeaves(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockMaterialGourd(BLOCKTYPE a_BlockType);
|
|
|
|
|
|
|
|
bool IsBlockMaterialRock(BLOCKTYPE a_BlockType);
|