apply_overrides($this->registry->active()->get_materials($forceRefresh)); } public function cached(): array { return $this->apply_overrides($this->registry->active()->get_cached_materials()); } public function find(?string $identifier): ?Material { if (!$identifier) { return null; } $material = $this->registry->active()->get_material($identifier); return $material ? $this->overrides->apply($material) : null; } public function provider(): \DS82\ThreeDPrintShowcase\Contracts\MaterialProviderInterface { return $this->registry->active(); } private function apply_overrides(array $materials): array { $result=[]; foreach($materials as $key=>$material){ $result[$key] = $material instanceof Material ? $this->overrides->apply($material) : $material; } return $result; } public function registry(): MaterialProviderRegistry { return $this->registry; } }