mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
ContentBuilder: Add method `get` to get definition or nullptr ContentLoader: Add functionality to clone from definition specified in `parent` field in json
17 lines
462 B
C++
17 lines
462 B
C++
#include "ItemDef.hpp"
|
|
|
|
#include "util/stringutil.hpp"
|
|
|
|
ItemDef::ItemDef(const std::string& name) : name(name) {
|
|
caption = util::id_to_caption(name);
|
|
}
|
|
void ItemDef::cloneTo(ItemDef& dst) {
|
|
dst.caption = caption;
|
|
dst.stackSize = stackSize;
|
|
dst.generated = generated;
|
|
std::copy(&emission[0], &emission[3], dst.emission);
|
|
dst.iconType = iconType;
|
|
dst.icon = icon;
|
|
dst.placingBlock = placingBlock;
|
|
dst.scriptName = scriptName;
|
|
}
|