mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 09:25:37 +02:00
GenElementManager: Pass opaque handles to Lua and rename to ObjDefManager
Add core.clear_registered_schematics() and refactor schematics somewhat
This commit is contained in:
@@ -42,7 +42,7 @@ class NodeResolver;
|
||||
#define MTSCHEM_PROB_ALWAYS 0xFF
|
||||
|
||||
|
||||
class Schematic : public GenElement, public NodeResolver {
|
||||
class Schematic : public ObjDef, public NodeResolver {
|
||||
public:
|
||||
std::vector<content_t> c_nodes;
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
Rotation rot, bool force_placement, INodeDefManager *ndef);
|
||||
|
||||
bool loadSchematicFromFile(const char *filename, INodeDefManager *ndef,
|
||||
std::map<std::string, std::string> &replace_names);
|
||||
StringMap *replace_names);
|
||||
void saveSchematicToFile(const char *filename, INodeDefManager *ndef);
|
||||
bool getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2);
|
||||
|
||||
@@ -73,14 +73,16 @@ public:
|
||||
std::vector<std::pair<s16, u8> > *splist);
|
||||
};
|
||||
|
||||
class SchematicManager : public GenElementManager {
|
||||
class SchematicManager : public ObjDefManager {
|
||||
public:
|
||||
static const char *ELEMENT_TITLE;
|
||||
static const size_t ELEMENT_LIMIT = 0x10000;
|
||||
|
||||
SchematicManager(IGameDef *gamedef);
|
||||
~SchematicManager() {}
|
||||
|
||||
const char *getObjectTitle() const
|
||||
{
|
||||
return "schematic";
|
||||
}
|
||||
|
||||
Schematic *create(int type)
|
||||
{
|
||||
return new Schematic;
|
||||
|
Reference in New Issue
Block a user