- if (name == "visible") {
- type.visible = in.GetBool();
- } else if (name == "texture") {
- // TODO: load textures as requested
- in.ReadString(tex_name);
- if (tex_name == "rock-1") {
- type.texture = 1;
- } else if (tex_name == "rock-2") {
- type.texture = 2;
- } else if (tex_name == "rock-3") {
- type.texture = 3;
- } else if (tex_name == "debug") {
- type.texture = 0;
- } else {
- throw runtime_error("unknown texture: " + tex_name);
- }
- } else if (name == "color") {
- in.ReadVec(type.color);
- } else if (name == "label") {
- in.ReadString(type.label);
- } else if (name == "luminosity") {
- type.luminosity = in.GetInt();
- } else if (name == "block_light") {
- type.block_light = in.GetBool();
- } else if (name == "collision") {
- type.collision = in.GetBool();
- } else if (name == "collide_block") {
- type.collide_block = in.GetBool();
- } else if (name == "shape") {
- in.ReadIdentifier(shape_name);
- if (shape_name == "block") {
- type.shape = &block_shape;
- type.fill = { true, true, true, true, true, true };
- } else if (shape_name == "slab") {
- type.shape = &slab_shape;
- type.fill = { false, true, false, false, false, false };
- } else if (shape_name == "stair") {
- type.shape = &stair_shape;
- type.fill = { false, true, false, false, false, true };
- } else {
- throw runtime_error("unknown block shape: " + shape_name);
- }
+ if (prop_name == "root") {
+ model.RootPart().Read(in, tex_index, shapes);
+ } else if (prop_name == "body") {
+ model.SetBody(in.GetULong());
+ } else if (prop_name == "eyes") {
+ model.SetEyes(in.GetULong());