codetaylor / pyrotech-1.12

An early game mod with new primitive devices, combustion machines, smelting mechanics, storage options, tools, torches, advancements, and absolutely zero GUIs -- with exception to the substantially complete, mostly illustrated, and charred guidebook.
https://pyrotech.readthedocs.io/en/latest/
Other
52 stars 19 forks source link

Custom output amounts from the Chopping Block #318

Closed FrogBirddd closed 3 years ago

FrogBirddd commented 4 years ago

The current functionality of the chopping block has a set value for the amount of outputs based on harvest level of the axe. This works fine by default, but in my case it doesn't work well. Below I have a short segment of script to show what I mean.

mods.pyrotech.Chopping.addRecipe("oaklog", <contenttweaker:oakboard>*8, <minecraft:log>);
mods.pyrotech.Chopping.addRecipe("oakslab", <minecraft:wooden_slab>*2, <minecraft:planks>);

For the recipe, I want to chop an oak log into 8 boards and an oak plank into 2 slabs. With the current setup, the amount of outputs does not match the recipe, but rather the number in the config file. If all the recipes have the same number of outputs this is fine, but if they vary between recipes it doesn't work. Basically, I'm asking for functionality more similar to the anvils, where the outputs can be changed for different recipes.

nihiltres commented 3 years ago

Isn't this already covered in the Chopping ZenScript support? That is, with the int[] quantities argument?

static void addRecipe(
  string name,                // unique recipe name
  IItemStack output,          // recipe output
  IIngredient input,          // recipe input
  int[] chops,                // overrides the default chops array in config
  int[] quantities,           // overrides the default quantities array in config
  @Optional boolean inherited // true if the recipe should be inherited
);
codetaylor commented 3 years ago

This can already be achieved with the recipe method indicated above.