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

[Enhancement] Improved Recipe System #1582

Open
MauveCloud opened this issue Nov 1, 2020 · 4 comments
Open

[Enhancement] Improved Recipe System #1582

MauveCloud opened this issue Nov 1, 2020 · 4 comments

Comments

@MauveCloud
Copy link
Collaborator

Based on leagris's comment in #1546:

GT_MachineRecipeLoader has been subverted and abused since very long ago.
It was initially designed to load Machine recipes with ingredients not having Ore Dictionary entries and no Unification rules, like Torches (no OreName) with stick and IC2 Harz (No OreName).
This whole class is an ever growing spaghetti growing with each contribution.

I plan to adapt from EnderIO's xml recipe system (note that Ender IO is public domain), which will:

  1. Allow recipes that would normally be added by GT_MachineRecipeLoader to be read from assets in the jar.
  2. Allow user-specified recipes to be read from the config folder, without needing GTTweaker.
  3. Allow ore dictionary inputs, even with items that don't get unified due to settings or blacklisting.
@Techlone
Copy link
Collaborator

Techlone commented Nov 2, 2020

Why XML? JSON\YAML\INI\Forge-style are more readable.

@MauveCloud
Copy link
Collaborator Author

@Techlone @leagris I hadn't actually firmly decided on XML. The main consideration was to allow variable input and output lists for the recipes potentially including NBT tags, and names to distinguish between things like duration and EU/t without relying purely on argument order (I'm fairly sure there have been some bugs caused by that). XML has the advantage of already being supported by the standard Java API.

JSON is a good suggestion, since it is already used by vanilla Minecraft (for resource packs at least, data packs in newer versions, and possibly other places I'm less familiar with)

YAML might work, but would probably require adding extra libraries to the project.

I'm not so sure INI or Forge-style would be more readable in this case. If you want me to consider these, could you please provide some examples of what GT machine recipes would look like in these formats?

@MauveCloud
Copy link
Collaborator Author

Update: I haven't actually started on the "read recipes from file/asset" part yet - first I want to make sure the change to the foundation to allow ore dictionary inputs (or even alternates that don't share an ore dictionary entry, and maybe even allow different stack sizes depending on which item is used, though I'm uncertain how well I'll be able to get the second half of that working) doesn't break things, and I'm having some difficulty with the Microwave, Printer, Recycler, and Large Chemical Reactor.

@MauveCloud
Copy link
Collaborator Author

@Techlone @leagris I've opened a PR for this, #1583, though still WIP, in case you want to take a look at what I've got so far and maybe help test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants