Add potential support for models defining 'vanilla like' rotations in Forge's Modified Blockstate format.

This commit is contained in:
LexManos committed 2018-05-24 18:37:05 -07:00
1 parent f492e25bc9
commit b654b84393
2 files changed
+8 -27

No files matched your search

@@ -945,11 +945,15 @@ public class ForgeBlockStateV1 extends Marker
}
return ret;
}
else
else if (e.isJsonArray())
{
// quaternion
return new Quat4f(parseFloatArray(e, 4, "Rotation"));
JsonArray array = e.getAsJsonArray();
if (array.size() == 3) //Vanilla rotation
return TRSRTransformation.quatFromXYZDegrees(new Vector3f(parseFloatArray(e, 3, "Rotation")));
else // quaternion
return new Quat4f(parseFloatArray(e, 4, "Rotation"));
}
else throw new JsonParseException("Rotation: expected array or object, got: " + e);
}
else if (e.isJsonObject())
{