MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Block_SetCollide

Function Block_SetCollide

src/Block.c:144–155  ·  view source on GitHub ↗

Sets the basic and extended collide types of the given block */

Source from the content-addressed store, hash-verified

142
143/* Sets the basic and extended collide types of the given block */
144static void Block_SetCollide(BlockID block, cc_uint8 collide) {
145 Blocks.ExtendedCollide[block] = collide;
146 Block_RecalcIsLiquid(block);
147
148 /* Reduce extended collision types to their simpler forms */
149 if (collide == COLLIDE_ICE) collide = COLLIDE_SOLID;
150 if (collide == COLLIDE_SLIPPERY_ICE) collide = COLLIDE_SOLID;
151
152 if (collide == COLLIDE_WATER) collide = COLLIDE_LIQUID;
153 if (collide == COLLIDE_LAVA) collide = COLLIDE_LIQUID;
154 Blocks.Collide[block] = collide;
155}
156
157/* Sets draw type and updates related state (e.g. FullOpaque) for the given block */
158static void Block_SetDrawType(BlockID block, cc_uint8 draw) {

Callers 2

Block_DefineCustomFunction · 0.85
Block_ResetPropsFunction · 0.85

Calls 1

Block_RecalcIsLiquidFunction · 0.85

Tested by

no test coverage detected