fix: missing pack.has_indices if content is not loaded
This commit is contained in:
+13
-10
@@ -3,6 +3,7 @@
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <optional>
|
||||
|
||||
#include "typedefs.hpp"
|
||||
#include "content_fwd.hpp"
|
||||
@@ -36,6 +37,16 @@ struct DependencyPack {
|
||||
std::string id;
|
||||
};
|
||||
|
||||
struct ContentPackStats {
|
||||
size_t totalBlocks;
|
||||
size_t totalItems;
|
||||
size_t totalEntities;
|
||||
|
||||
inline bool hasSavingContent() const {
|
||||
return totalBlocks + totalItems + totalEntities > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct ContentPack {
|
||||
std::string id = "none";
|
||||
std::string title = "untitled";
|
||||
@@ -48,6 +59,8 @@ struct ContentPack {
|
||||
|
||||
io::path getContentFile() const;
|
||||
|
||||
std::optional<ContentPackStats> loadStats() const;
|
||||
|
||||
static inline const std::string PACKAGE_FILENAME = "package.json";
|
||||
static inline const std::string CONTENT_FILENAME = "content.json";
|
||||
static inline const io::path BLOCKS_FOLDER = "blocks";
|
||||
@@ -87,16 +100,6 @@ struct ContentPack {
|
||||
}
|
||||
};
|
||||
|
||||
struct ContentPackStats {
|
||||
size_t totalBlocks;
|
||||
size_t totalItems;
|
||||
size_t totalEntities;
|
||||
|
||||
inline bool hasSavingContent() const {
|
||||
return totalBlocks + totalItems + totalEntities > 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct WorldFuncsSet {
|
||||
bool onblockplaced;
|
||||
bool onblockreplaced;
|
||||
|
||||
Reference in New Issue
Block a user