*/
#include "content_nodemeta.h"
+#include "nodemetadata.h"
+#include "nodetimer.h"
#include "inventory.h"
#include "log.h"
+#include "serialization.h"
#include "util/serialize.h"
#include "util/string.h"
#include "constants.h" // MAP_BLOCKSIZE
inv->getList("0")->setName("main");
}
assert(inv->getList("main") && !inv->getList("0"));
-
+
meta->setString("formspec","size[8,9]"
"list[current_name;main;0,0;8,4;]"
"list[current_player;main;0,5;8,4;]");
inv->getList("0")->setName("main");
}
assert(inv->getList("main") && !inv->getList("0"));
-
+
meta->setString("formspec","size[8,9]"
"list[current_name;main;0,0;8,4;]"
"list[current_player;main;0,5;8,4;]");
void content_nodemeta_deserialize_legacy(std::istream &is,
NodeMetadataList *meta, NodeTimerList *timers,
- IGameDef *gamedef)
+ IItemDefManager *item_def_mgr)
{
meta->clear();
timers->clear();
if(version > 1)
{
- infostream<<__FUNCTION_NAME<<": version "<<version<<" not supported"
+ infostream<<FUNCTION_NAME<<": version "<<version<<" not supported"
<<std::endl;
- throw SerializationError(__FUNCTION_NAME);
+ throw SerializationError(FUNCTION_NAME);
}
u16 count = readU16(is);
if(meta->get(p) != NULL)
{
- infostream<<"WARNING: "<<__FUNCTION_NAME<<": "
+ warningstream<<FUNCTION_NAME<<": "
<<"already set data at position"
<<"("<<p.X<<","<<p.Y<<","<<p.Z<<"): Ignoring."
<<std::endl;
continue;
}
- NodeMetadata *data = new NodeMetadata(gamedef);
+ NodeMetadata *data = new NodeMetadata(item_def_mgr);
bool need_timer = content_nodemeta_deserialize_legacy_meta(is, data);
meta->set(p, data);
if(need_timer)
- timers->set(p, NodeTimer(1., 0.));
+ timers->set(NodeTimer(1., 0., p));
}
}
-
-void content_nodemeta_serialize_legacy(std::ostream &os, NodeMetadataList *meta)
-{
- // Sorry, I was too lazy to implement this. --kahrl
- writeU16(os, 1); // version
- writeU16(os, 0); // count
-}
-
-// END