extend user block fields check
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "Block.hpp"
|
||||
|
||||
#include <set>
|
||||
#include <utility>
|
||||
|
||||
#include "core_defs.hpp"
|
||||
@@ -141,3 +142,10 @@ void Block::cloneTo(Block& dst) {
|
||||
dst.inventorySize = inventorySize;
|
||||
dst.tickInterval = tickInterval;
|
||||
}
|
||||
|
||||
static std::set<std::string, std::less<>> RESERVED_BLOCK_FIELDS {
|
||||
};
|
||||
|
||||
bool Block::isReservedBlockField(std::string_view view) {
|
||||
return RESERVED_BLOCK_FIELDS.find(view) != RESERVED_BLOCK_FIELDS.end();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ inline constexpr uint FACE_PZ = 5;
|
||||
/// complex hitboxes
|
||||
inline constexpr uint BLOCK_AABB_GRID = 16;
|
||||
|
||||
inline constexpr size_t MAX_BLOCK_FIELDS_SIZE = 240;
|
||||
inline constexpr size_t MAX_USER_BLOCK_FIELDS_SIZE = 240;
|
||||
|
||||
inline std::string DEFAULT_MATERIAL = "base:stone";
|
||||
|
||||
@@ -222,6 +222,8 @@ public:
|
||||
~Block();
|
||||
|
||||
void cloneTo(Block& dst);
|
||||
|
||||
static bool isReservedBlockField(std::string_view view);
|
||||
};
|
||||
|
||||
inline glm::ivec3 get_ground_direction(const Block& def, int rotation) {
|
||||
|
||||
Reference in New Issue
Block a user