cadaverous-eris / Rustic

A medieval themed Minecraft mod based around decoration, exploration, and agriculture
68 stars 35 forks source link

Added proper recipe API, added some CrT method with it #299

Closed Riernar closed 3 years ago

Riernar commented 4 years ago

Following #298 breaking Rustic Thaumaturgy due to internal changes, I added a proper API to add/remove/get Rustic recipes. This will be followed by a PR on Rustic Thaumaturgy side to resolve the incompatibility.

As a side effect, the following CraftTweaker method were added:

The following clarification are suggested for the Wiki, on the page for crafttweaker support, for the evaporating recipe:

Specify that there can only either be one recipe associated with a Fluid type (e.g. water, lava) regardless of quantity. New recipes silently override previous recipe

Sorry the internal changes that breaks addons ^^'

cadaverous-eris commented 4 years ago

May I suggest a small change to fix Rustic Thaumaturgy compatibility on our end, since there's no guarantee that Voxel-Friend will accept your PR and update the mod? Rename the evaporatingRecipes hashmap to something else like evaporatingRecipesMap, and add an ArrayList<IEvaporatingBasinRecipe> called evaporatingRecipes. Then just copy the contents of the arraylist into the hashmap during postInit. That should allow mods that added evaporating recipes to keep working.

Riernar commented 4 years ago

That's an excellent idea, I did not think about it ! Implemented it in the above commit. I use putIfAbsent() on the HashMap so that CraftTweaker still takes precedence, even if CraftTweaker run the actions before PostInit (since I have no idea when this is done).