mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
Block rotation profiles
This commit is contained in:
parent
9ded9b63f8
commit
8bc8eb14bd
6 changed files with 53 additions and 16 deletions
|
|
@ -52,6 +52,17 @@ Block* ContentLoader::loadBlock(string name, path file) {
|
|||
cerr << "unknown model " << model << endl;
|
||||
def->model = BlockModel::none;
|
||||
}
|
||||
|
||||
// rotation profile
|
||||
string profile = "none";
|
||||
root->str("rotation", profile);
|
||||
def->rotatable = profile != "none";
|
||||
if (profile == "pipe") {
|
||||
def->rotations = BlockRotProfile::PIPE;
|
||||
} else if (profile != "none") {
|
||||
cerr << "unknown rotation profile " << profile << endl;
|
||||
def->rotatable = false;
|
||||
}
|
||||
|
||||
// block hitbox AABB [x, y, z, width, height, depth]
|
||||
json::JArray* hitboxobj = root->arr("hitbox");
|
||||
|
|
@ -76,7 +87,6 @@ Block* ContentLoader::loadBlock(string name, path file) {
|
|||
root->flag("light-passing", def->lightPassing);
|
||||
root->flag("breakable", def->breakable);
|
||||
root->flag("selectable", def->selectable);
|
||||
root->flag("rotatable", def->rotatable);
|
||||
root->flag("sky-light-passing", def->skyLightPassing);
|
||||
root->num("draw-group", def->drawGroup);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue