Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recipe changes #340

Merged
merged 2 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Obsidian.API/Crafting/CuttingRecipe.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Obsidian.API.Crafting;

public sealed class CuttingRecipe : IRecipe
public sealed class CuttingRecipe : IRecipeWithResult
{
public required string Identifier { get; init; }

public required CraftingType Type { get; init; }

public string? Group { get; init; }

public required Ingredient? Result { get; init; }
public required Ingredient Result { get; init; }

public required Ingredient Ingredient { get; init; }

Expand Down
5 changes: 4 additions & 1 deletion Obsidian.API/Crafting/IRecipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ public interface IRecipe
public CraftingType Type { get; init; }

public string? Group { get; init; }
}

public Ingredient? Result { get; init; }
public interface IRecipeWithResult : IRecipe
{
public Ingredient Result { get; init; }
}
4 changes: 2 additions & 2 deletions Obsidian.API/Crafting/ShapedRecipe.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Obsidian.API.Crafting;

public sealed class ShapedRecipe : IRecipe
public sealed class ShapedRecipe : IRecipeWithResult
{
public required string Identifier { get; init; }

Expand All @@ -10,7 +10,7 @@ public sealed class ShapedRecipe : IRecipe

public required CraftingBookCategory Category { get; init; }

public required Ingredient? Result { get; init; }
public required Ingredient Result { get; init; }

public required IReadOnlyList<string> Pattern { get; init; }

Expand Down
4 changes: 2 additions & 2 deletions Obsidian.API/Crafting/ShapelessRecipe.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Obsidian.API.Crafting;

public sealed class ShapelessRecipe : IRecipe
public sealed class ShapelessRecipe : IRecipeWithResult
{
public required string Identifier { get; init; }

Expand All @@ -10,7 +10,7 @@ public sealed class ShapelessRecipe : IRecipe

public string? Group { get; init; }

public required Ingredient? Result { get; init; }
public required Ingredient Result { get; init; }

public required IReadOnlyList<Ingredient> Ingredients { get; init; }

Expand Down
4 changes: 2 additions & 2 deletions Obsidian.API/Crafting/SmeltingRecipe.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
namespace Obsidian.API.Crafting;

public sealed class SmeltingRecipe : IRecipe
public sealed class SmeltingRecipe : IRecipeWithResult
{
public required string Identifier { get; init; }

public required CraftingType Type { get; init; }

public string? Group { get; init; }

public required Ingredient? Result { get; init; }
public required Ingredient Result { get; init; }

public required Ingredient Ingredient { get; init; }

Expand Down
8 changes: 3 additions & 5 deletions Obsidian.API/Crafting/SmithingRecipe.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Obsidian.API.Crafting;

public sealed class SmithingRecipe : IRecipe
public sealed class SmithingRecipe : IRecipeWithResult
{
public required string Identifier { get; init; }

Expand All @@ -24,15 +24,15 @@ public sealed class SmithingRecipe : IRecipe
/// <remarks>
/// Only used if 1.20 feature flag was enabled.
/// </remarks>
public sealed class SmithingTransformRecipe : IRecipe
public sealed class SmithingTransformRecipe : IRecipeWithResult
{
public required string Identifier { get; init; }

public required CraftingType Type { get; init; }

public string? Group { get; init; }

public required Ingredient? Result { get; init; }
public required Ingredient Result { get; init; }

public required Ingredient Base { get; init; }

Expand Down Expand Up @@ -64,7 +64,5 @@ public sealed class SmithingTrimRecipe : IRecipe

public required Ingredient Template { get; init; }

Ingredient? IRecipe.Result { get; init; } = null;

internal SmithingTrimRecipe() { }
}