Skip to content

Commit a0ef08e

Browse files
committed
Fix recipe selectables
1 parent 3f4e0f5 commit a0ef08e

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/PatchManager.Resources/Rulesets/ResourceRuleset.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ public class ResourceRuleset : IPatcherRuleSet
2020
public ISelectable ConvertToSelectable(string type, string name, string jsonData)
2121
{
2222
var obj = JObject.Parse(jsonData);
23-
if (obj.ContainsKey("isRecipe") && obj["isRecipe"].Value<bool>())
23+
if (obj.ContainsKey("isRecipe") && obj["isRecipe"]!.Value<bool>())
2424
{
2525
return new RecipeSelectable(jsonData);
2626
}
27-
else
28-
{
29-
return new ResourceSelectable(jsonData);
30-
}
27+
return new ResourceSelectable(jsonData);
3128
}
3229

3330
/// <inheritdoc />

src/PatchManager.Resources/Selectables/RecipeSelectable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public override bool MatchesClass(string @class, out DataValue classValue)
9292
public override bool IsSameAs(ISelectable other) => other is RecipeSelectable rs && rs.Name == Name;
9393

9494
/// <inheritdoc />
95-
public override IModifiable OpenModification() => new JTokenModifiable(JObject["data"], SetModified);
95+
public override IModifiable OpenModification() => new JTokenModifiable(JObject["recipeData"], SetModified);
9696

9797
/// <inheritdoc />
9898
public override ISelectable AddElement(string elementType)

0 commit comments

Comments
 (0)