add 'on_block_removed' event
This commit is contained in:
@@ -51,6 +51,7 @@ struct BlockFuncsSet {
|
||||
bool onblocktick : 1;
|
||||
bool onblockstick : 1;
|
||||
bool onblockpresent : 1;
|
||||
bool onblockremoved : 1;
|
||||
};
|
||||
|
||||
struct CoordSystem {
|
||||
|
||||
@@ -19,6 +19,7 @@ static uint8_t get_events_bits(const Block& def) {
|
||||
auto funcsset = def.rt.funcsset;
|
||||
bits |= BlockRegisterEvent::UPDATING_BIT * funcsset.onblocktick;
|
||||
bits |= BlockRegisterEvent::PRESENT_EVENT_BIT * funcsset.onblockpresent;
|
||||
bits |= BlockRegisterEvent::REMOVED_EVENT_BIT * funcsset.onblockremoved;
|
||||
return bits;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ struct BlockRegisterEvent {
|
||||
static inline constexpr uint8_t REGISTER_BIT = 0x1;
|
||||
static inline constexpr uint8_t UPDATING_BIT = 0x2;
|
||||
static inline constexpr uint8_t PRESENT_EVENT_BIT = 0x4;
|
||||
static inline constexpr uint8_t REMOVED_EVENT_BIT = 0x8;
|
||||
uint8_t bits;
|
||||
blockid_t id;
|
||||
glm::ivec3 coord;
|
||||
|
||||
Reference in New Issue
Block a user