mirror of
https://github.com/xtreme8000/CavEX.git
synced 2025-01-22 09:11:55 -05:00
Add cobweb block
This commit is contained in:
parent
1bfa42f6a0
commit
9b9b72f2ce
3 changed files with 49 additions and 1 deletions
47
source/block/block_cobweb.c
Normal file
47
source/block/block_cobweb.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
#include "blocks.h"
|
||||
|
||||
static enum block_material getMaterial(struct block_info* this) {
|
||||
return MATERIAL_STONE;
|
||||
}
|
||||
|
||||
static bool getBoundingBox(struct block_info* this, bool entity,
|
||||
struct AABB* x) {
|
||||
aabb_setsize(x, 1.0F, 1.0F, 1.0F);
|
||||
return !entity;
|
||||
}
|
||||
|
||||
static struct face_occlusion*
|
||||
getSideMask(struct block_info* this, enum side side, struct block_info* it) {
|
||||
return face_occlusion_empty();
|
||||
}
|
||||
|
||||
static enum block_render_type getRenderType(struct block_info* this) {
|
||||
return RENDERTYPE_CROSS;
|
||||
}
|
||||
|
||||
static uint8_t getTextureIndex(struct block_info* this, enum side side) {
|
||||
return TEXTURE_INDEX(11, 0);
|
||||
}
|
||||
|
||||
static uint32_t getBaseColor(struct block_info* this, enum side side) {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
|
||||
struct block block_cobweb = {
|
||||
.name = "Cobweb",
|
||||
.getRenderType = getRenderType,
|
||||
.getSideMask = getSideMask,
|
||||
.getBoundingBox = getBoundingBox,
|
||||
.getMaterial = getMaterial,
|
||||
.getTextureIndex = getTextureIndex,
|
||||
.transparent = false,
|
||||
.getBaseColor = getBaseColor,
|
||||
.renderBlock = render_block_cross,
|
||||
.renderBlockAlways = NULL,
|
||||
.luminance = 0,
|
||||
.double_sided = true,
|
||||
.can_see_through = true,
|
||||
.render_block_data.cross_random_displacement = false,
|
||||
.ignore_lighting = false,
|
||||
.flammable = false,
|
||||
};
|
|
@ -38,7 +38,7 @@ void blocks_init() {
|
|||
blocks[27] = &block_powered_rail;
|
||||
blocks[28] = &block_detector_rail;
|
||||
// sticky piston
|
||||
// cobweb
|
||||
blocks[30] = &block_cobweb;
|
||||
blocks[31] = &block_tallgrass;
|
||||
blocks[32] = &block_deadbush;
|
||||
// piston
|
||||
|
|
|
@ -172,6 +172,7 @@ extern struct block block_noteblock;
|
|||
extern struct block block_sponge;
|
||||
extern struct block block_dispenser;
|
||||
extern struct block block_tnt;
|
||||
extern struct block block_cobweb;
|
||||
|
||||
extern struct block* blocks[256];
|
||||
|
||||
|
|
Loading…
Reference in a new issue