Open MerchantPug opened 2 years ago
I accidentally pressed enter while typing this out so this post may look unfinished at first.
This PR is finished, however the written explanation for Modify Crafting is not.
I'll likely update this to EMI 0.3.1 sometime in the future. Marking this as a draft until then.
On hold until Apoli's rewrite, mainly because I'm unsure whether inter mod compatibility features should be added before then.
I will rewrite Modify Recipe's extra recipes to be less hardcoded, as well as adding REI into this mix.
This PR adds EMI compatibility for any recipes from the Recipe Power and the Modify Crafting Power.
How the PR registers its recipes through EMI.
The PR gets powers from a new
valueStream()
method inPowerTypeRegistry
, first loading any multiple power types and their subpowers (to disable loading subpowers in the future) to use the base power's name for the recipe screen if the power is a subpower. A new instance of the power is created with a null entity and this is checked for whether it is an instance ofRecipePower
orModifyCraftingPower
and then it'll be handled dependent on which power it is.Explaining the Display
The display for these recipes follow a similar convention, where the required power's name will be displayed at the bottom of the display. The text of the title "Required Power" will be coloured dependent on the power's active state.
GRAY - You do not have the power RED - You have the power but it is not active. GREEN - The power is active.
Recipe Power
I've only implemented the shaped and shapeless recipe types within the recipe power functionality, this is because I'm unsure if the recipe power supports special recipe types.
This only shows in Show Craftable Only if the power is considered active.
Screenshot(s)
Here's a power you're familiar with as a proof of concept.
This power is not active (requiring the user to be in a plains biome).
Modify Crafting Power
TODO
Screenshot(s)
Flaws
Modify Crafting Power still shows the original recipe in the craftable menu when active I have avoided changing this as it could potentially require a rather disgusting mixin.
No support for Modify Grindstone You're free to attempt this yourself, however I chose to not attempt this as there is no feasible way to get any proper NBT from exclusively predicates.
While I considered adding new fields for the power specifically for EMI usage, I chose not to as it'd bloat the power for those who don't have the mod.
Adding this would require a total rewrite to conditions by giving more information to developers that can be accessed from a condition class (potential rewrite idea 👀).