mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 03:51:50 +00:00
add block particles property
This commit is contained in:
parent
24af455bf0
commit
0eeb6b6eb2
11 changed files with 180 additions and 23 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "core_defs.hpp"
|
||||
#include "data/StructLayout.hpp"
|
||||
#include "presets/ParticlesPreset.hpp"
|
||||
#include "util/stringutil.hpp"
|
||||
|
||||
std::string to_string(BlockModel model) {
|
||||
|
|
@ -142,6 +143,7 @@ void Block::cloneTo(Block& dst) {
|
|||
dst.inventorySize = inventorySize;
|
||||
dst.tickInterval = tickInterval;
|
||||
dst.overlayTexture = overlayTexture;
|
||||
dst.particles = std::make_unique<ParticlesPreset>(*particles);
|
||||
}
|
||||
|
||||
static std::set<std::string, std::less<>> RESERVED_BLOCK_FIELDS {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
#include "maths/aabb.hpp"
|
||||
#include "typedefs.hpp"
|
||||
|
||||
struct ParticlesPreset;
|
||||
|
||||
namespace data {
|
||||
class StructLayout;
|
||||
}
|
||||
|
|
@ -199,6 +201,8 @@ public:
|
|||
|
||||
std::unique_ptr<data::StructLayout> dataStruct;
|
||||
|
||||
std::unique_ptr<ParticlesPreset> particles;
|
||||
|
||||
/// @brief Runtime indices (content indexing results)
|
||||
struct {
|
||||
/// @brief block runtime integer id
|
||||
|
|
|
|||
|
|
@ -60,6 +60,10 @@ public:
|
|||
return get(pos.x, pos.y, pos.z);
|
||||
}
|
||||
|
||||
inline const voxel* get(glm::ivec3 pos) const {
|
||||
return get(pos.x, pos.y, pos.z);
|
||||
}
|
||||
|
||||
light_t getLight(int32_t x, int32_t y, int32_t z) const;
|
||||
ubyte getLight(int32_t x, int32_t y, int32_t z, int channel) const;
|
||||
void set(int32_t x, int32_t y, int32_t z, uint32_t id, blockstate state);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue