Skip to content

CraftBlockScript

Ferdinand Calo edited this page Jun 4, 2020 · 3 revisions
# BlockScript Implementation overview
Name: Craft Block Script
Function: adds the ability to create customizable "crafter-type" machines
Extendable: yes
Needs-Extension: no

The CraftBlockScript allows you to create multiblock "machines" to "craft" Things!
Recipes can be added via "simple" JSON config files!
There are also dedicated GUIs in FVTM to access this script ingame "visually".
This is also the main way FVTM recipes are processed (besides FCL:BPT).

Includes:

  • support for recipes taking items/fluids from multiple inventories
  • support for recipes "consuming" custom values
  • support for recipes putting items/fluids into multiple inventories
  • support for recipes with "alternative" input (see vanilla "ingredient")
  • support for recipes with OreDictionary input

Limitations:

  • the code is kept relatively simple, please don't add multiple times the same ingredient
    • consider to split across inventories if you must
    • try to stack them instead,
    • same with output

The CraftBlockScript can be extended! Just remember about super calls!


Config (when using default implementation):

  • auto_recipe_chooser - if a recipe should be choosen automatically when there is none
    selected by the player directly (default:false)
  • instant - if recipes are processed "instantly" or after X ticks (default:false)
  • cooldown - cooldown time in ticks between completed or failed crafting
  • process_speed - speed how quick recipes are processed,
  • cooldown_speed - speed how quick cooldown cools down
  • process_time - time in ticks how long a recipe is processed to be complete

Implementing:

  • if you want to use the default script implementation without any code additions,
    add to config as follows:
    • "Script": "net.fexcraft.mod.fvtm.util.script.DefaultCraftBlockScript.class"
  • if you want to extend it, you can either extend DefaultCraftBlockScript
    or CraftBlockScript directly.
Clone this wiki locally