Controllers

For configuration instructions, click this link. How to Create a Controller?

What are Controllers?

In Masterful Machinery, the "controller" is referenced on many occasions. In it's simplest form, a controller is an in-game block. This block is incredibly important as it is what manages a multiblock machine. The controller is in-charge of detecting structures relative to its own position and processing recipes which may be available for any found structures.

How do Controllers Work?

While Masterful Machinery has gone through a few different forms, in code and user experience, the strong foundation of the controller block has remained a strong standing feature of the mod.

As mentioned previously, Controllers are the brain of a machines operations as they hold the role of detecting structures and performing process recipes.

Using its own position as the origin, a controller block will search around its-self for required blocks to form a structure which you will have defined in a Data Pack. if a full set of required blocks is confirmed at the correct positions, the controller caches (temporarily stores in memory) a few details about the structure and the ports which it contains. With this information, it searches for process recipes for the structure and checks whether the recipe's inputs are available and any outputs can be safely deposited.

This whole process happens every in-game tick. However, during the development process, many performance considerations have been implemented ensure unnecessary checks and validations are run. These performance favouring changes are found in current versions of the mod since 1.20.1-0.5.0 alpha releases. Despite these changes being relatively new, MM has a great track record of running smoothly and staying safe from causing lag and disruptions.

How to Create a Controller?

{
    "type": "mm:machine",
    "id": "my_controller",
    "name": "My Controller"
}

Explaining the Example

"type": "mm:machine"

The "type" field is used to define what type of controller you want to create. Here we use the type mm:machine, this indicates that we want a controller capable of detecting structures and running recipes, the default functionality of Masterful Machinery.

There is only one available controller type as of current. There are plans to include other types of controllers for specialised machines in the future.

"id": "my_controller"

The "id" field is an identifier which is unique to this controller and will be later used to reference this controller in other configuration and Data Pack files. When referencing this id in other files, be sure to prefix it with mm: For example our current id my_controller would simply be referenced as mm:my_controller from other files.

"name": "My Controller"

The "name" field is used to define the default en_US language translation name of the controller. You can change this value for other languages the with the usual method of resource pack lang files. The translation key for this controller would be block.mm.my_controller. To change other controller names the format is simply block.mm.<the id of your controller>.

Where do controller files go?

Assuming that your current working directory is at the root of your modpack Pack directory, the relative path is as follows: ./config/mm/controllers inside of this folder you can place the .json which contain the definitions for your desired controlles.

Last updated