Skip to content

Harvestcraft CraftTweaker Functions

SokyranTheDragon edited this page Jan 16, 2020 · 1 revision

Important notice

  • None of the recipes accept ore dictionary values! They need to be provided with a single item or block.
  • There exist a chance, however unlikely, that recipes won't be possible to be added or removed (most likely due to changes to Harvestcraft). There exist functions to check if it's possible to add or remove recipes for every single block type.
  • Some blocks are hardcoded and it's impossible to easily modify them (like beehive or traps). Making them modifiable is a low priority for now, and most likely won't be touched unless there's an interest in it.
  • Currently there's no way to modify existing recipes (like changing market cost or machine output). It'll be added soon, and most likely done by having to remove a specific recipe first and re-adding a new one with same input.

Market and Shipping Bin

Checking if recipes can be added or removed

Returns a boolean value. It should be used to avoid a (potential) log spam in case recipes can't be modified.

mods.mia.harvestcraft.canAccessMarketRecipes();
mods.mia.harvestcraft.canAccessShippingBinRecipes();

Adding a new item that can be bought

Default currency - input/output (for market/shipping bin) - is using emeralds. Cost is automatically set between 1 and max stack size for input/output (for market/shipping bin). If a recipe with same input and output exists, then it won't be added.

mods.mia.harvestcraft.addMarketRecipe(IItemStack output, int cost, @Optional IItemStack input);
mods.mia.harvestcraft.addShippingBinRecipe(IItemStack input, int cost, @Optional IItemStack output);

Removing an existing item

Removes a recipe with a specific output item. It will also include an option to specify the second item in the near future.

mods.mia.harvestcraft.removeMarketRecipe(IItemStack output);
mods.mia.harvestcraft.removeShippingBinRecipe(IItemStack input);

Presser, Grinder, Water Filter

Checking if recipes can be added or removed

Returns a boolean value. It should be used to avoid a (potential) log spam in case recipes can't be modified.

mods.mia.harvestcraft.canAccessPressingRecipes();
mods.mia.harvestcraft.canAccessGrindingRecipes();
mods.mia.harvestcraft.canAccessWaterFilteringRecipes();

Adding a new pressing recipe

Only the first output item needs to be specified. The second one will be empty by default.

mods.mia.harvestcraft.addPressingRecipe(IItemStack input, IItemStack firstOutput, @Optional IItemStack secondOutput);
mods.mia.harvestcraft.addGrindingRecipe(IItemStack input, IItemStack firstOutput, @Optional IItemStack secondOutput);
mods.mia.harvestcraft.addWaterFilteringRecipe(IItemStack input, IItemStack firstOutput, @Optional IItemStack secondOutput);

Removing an existing item

Removes a recipe with a specific output item.

mods.mia.harvestcraft.removePressingRecipe(IItemStack output);
mods.mia.harvestcraft.removeGrindingRecipe(IItemStack output);
mods.mia.harvestcraft.removeWaterFilteringRecipe(IItemStack output);