-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to make recipe serialisers more reusable
This attempts to reduce some duplication in recipe serialisation (and deserialisation) by moving the structure of a recipe (group, category, ingredients, result) into seprate types. - Add ShapedRecipeSpec and ShapelessRecipeSpec, which store the core properties of shaped and shapeless recipes. There's a couple of additional classes here for handling some of the other shared or complex logic. - These classes are now used by two new Custom{Shaped,Shapeless}Recipe classes, which are (mostly) equivalent to Minecraft's shaped/shapeless recipes, just with support for nbt in results. - All the other similar recipes now inherit from these base classes, which allows us to reuse a lot of this serialisation code. Alas, the total code size has still gone up - maybe there's too much abstraction here :). - Mostly unrelated, but fix the skull recipes using the wrong UUID format. This allows us to remove our mixin for nbt in recipes (as we just use our custom recipe now) and simplify serialisation a bit - hopefully making the switch to codecs a little easier.
- Loading branch information
Showing
39 changed files
with
728 additions
and
558 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 0 additions & 72 deletions
72
...ommon/src/main/java/dan200/computercraft/shared/computer/recipe/ComputerFamilyRecipe.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.