diff --git a/Loading/RegistryObjectType.cs b/Loading/RegistryObjectType.cs index b613dd0..a69566c 100644 --- a/Loading/RegistryObjectType.cs +++ b/Loading/RegistryObjectType.cs @@ -320,9 +320,10 @@ protected static void solveByType(JToken json, string codePath, API.Datastructur { throw new FormatException("Invalid value at key: " + entry.Key); } + var catchAll = jobj["*"]; foreach (var byTypeProperty in jobj) { - if (WildcardUtil.Match(byTypeProperty.Key, codePath)) + if(byTypeProperty.Key != "*" && WildcardUtil.Match(byTypeProperty.Key, codePath)) { JToken typedToken = byTypeProperty.Value; // Unnecessary to solveByType specifically on this new token's contents as we will be doing a solveByType on all the tokens in the jsonObj anyhow, after adding the propertiesToAdd if (propertiesToAdd == null) propertiesToAdd = new Dictionary(); @@ -330,6 +331,11 @@ protected static void solveByType(JToken json, string codePath, API.Datastructur break; // Replaces for first matched key only } } + if(catchAll is not null && (propertiesToAdd is null || !propertiesToAdd.ContainsKey(trueKey))) + { + propertiesToAdd ??= new Dictionary(); + propertiesToAdd.Add(trueKey, catchAll); + } if (propertiesToRemove == null) propertiesToRemove = new List(); propertiesToRemove.Add(entry.Key); }