-
Notifications
You must be signed in to change notification settings - Fork 15
Packages
Packages is the primary way of adding new content to Forgero. Packages provide the data for the actual content, and organizes it a way that is easy to manage.
Packages needs to be placed in the data/forgero/packs
folder. The content is placed inside a folder with the name of your pack. The actual name of the folder is not important, but it is highly recommended to name the folder the name of the pack.
To be registered as a package, there needs to be a package.json file in the root folder of the package.
Example:
{
"name": "forgero-extended",
"resource_type": "PACKAGE",
"priority": 4,
"namespace": "forgero",
"dependencies": [
"minecraft",
"forgero",
"forgero-vanilla"
]
}
This is an example of the content of a package.json. All fields are required for a package to be registered correctly.
The name of the package needs to be unique, unless you wish to override another package, and should describe which content it contains. The namespace of the package is used to indicate where this package comes from. When creating a package, the namespace and name will be combined together to create an id: forgero:forgero-extended
. The id has to be unique, and there can only be 1 package registered for every id. This id is also used when disabling packages in the configuration menu.
The dependency list has a list of other packages and mods that needs to be loaded for this packages content to be loaded. If there is a listed name here which is not present when the game initializes the packages, this pack will be disabled. This is convenient for mod integrations, as the package will automatically be disabled if the mod this package add content for is not present.
The dependency list needs either names of other packages, or modid's to run.
Although Forgero packages are completely data-driven, they still needs to be package as a mod for Forgero to load them correctly. The reason for this is that Forgero packs adds new content to the game which needs to be registered in into Minecraft when the game starts up. At this point in the game-loading process, normal data packs are not loaded by the game. After this process is done, the Registry that allows you to add new items is frozen, and you are unable to add new items. Normal datapacks are loaded on a per-world basis, which means that they cannot add content to the registries as they are frozen.
I have considered creating systems that allows you to bypass this, but it is very likely to cause numerous issues, and would probably be really hard to get right, so I haven't put more effort into it. I am, however interested in supporting this functionality if someone wants to create and maintain a system for it.
To get started check out the Examble Forgero mod for Fabric
The packages makes it possible to define new resources, attach properties to them, and define relationships between them. The available content from Forgero is not the only thing that is possible to create with the package system. The concept of schematic and how they are combined with materials to form parts is created because it is an intuitive way of combining a resource with a template to create different parts with unique attributes. Changing the system to use casts, would work just as well, but it needs configuration.