virtual bool nodeRemovalDisabled();
virtual std::string getInventoryDrawSpecString();
- std::string getOwner(){ return m_text; }
- void setOwner(std::string t){ m_text = t; }
+ virtual std::string getOwner(){ return m_text; }
+ virtual void setOwner(std::string t){ m_text = t; }
private:
Inventory *m_inventory;
#include "porting.h"
#include "mapgen.h"
#include "nodemetadata.h"
-#include "content_nodemeta.h"
-#include "content_mapnode.h"
/*
SQLite format specification:
if(meta_proto)
{
NodeMetadata *meta = meta_proto->clone();
- /* lockable chest, insert the owner's name */
- if (meta->typeId() == CONTENT_LOCKABLE_CHEST)
- {
- LockingChestNodeMetadata *lcm = (LockingChestNodeMetadata*)meta;
- lcm->setOwner(player_name);
- }
+ meta->setOwner(player_name);
setNodeMetadata(p, meta);
}
- else if (n.getContent() == CONTENT_LOCKABLE_CHEST)
- {
- LockingChestNodeMetadata *lcm = new LockingChestNodeMetadata();
- lcm->setOwner(player_name);
- setNodeMetadata(p, (NodeMetadata*)lcm);
- }
/*
If node is under sunlight and doesn't let sunlight through,
// Used to make custom inventory menus.
// See format in guiInventoryMenu.cpp.
virtual std::string getInventoryDrawSpecString(){return "";}
+ // primarily used for locking chests, but others can play too
+ virtual std::string getOwner(){ return std::string(""); }
+ virtual void setOwner(std::string t){ }
protected:
static void registerType(u16 id, Factory f);