Jump to content

Recipes with attributes


KA3NMNP

Recommended Posts

Hello everyone, i am developing a mod for disassembling and recycling metal products. And when it came to shields, I discovered that many of their varieties are implemented through attributes. I started writing their variations in the recipe using “*”, but the recipes don’t work that way. For example:

Spoiler
[
	{
		ingredientPattern: "HC	_I",
		recipeGroup: 24,
		ingredients: {
			"H": { type: "item", code: "game:hammer-*", isTool: true},
			"C": { type: "item", code: "game:chisel-*", isTool: true},
			"I": { type: "item", code: "game:shield-woodmetal", attributes: { "metal": "{*}", name: "metal", allowedVariants: ["tinbronze", "bismuthbronze", "blackbronze", "iron", "meteoriciron", "steel", "gold", "silver"] }
		},
		width: 2,
		height: 2,
		output: { type: "item", code: "game:metalbit-{metal}", quantity: 40 }
	}
]

 

 

However, if I specify a specific value for each attribute, the recipe is workable, like this:

Spoiler
[
	{
		ingredientPattern: "HC	_I",
		recipeGroup: 24,
		ingredients: {
			"H": { type: "item", code: "game:hammer-*", isTool: true},
			"C": { type: "item", code: "game:chisel-*", isTool: true},
			"I": { type: "item", code: "game:shield-woodmetal", attributes: { "metal": "{metal}", "wood": "{wood}", "deco": "none" }} }
		},
		width: 2,
		height: 2,
		output: { type: "item", code: "game:metalbit-{metal}", quantity: 40 }
	}
]

 

For now, I’m busy writing out each of the 384 recipes manually, but I’d like to find a more rational method.

Link to comment
Share on other sites

I'm just not seeing a more rational only solution without getting C# involved. On the upside, this sort of thing only applies to shields and junk in ruins afaik.

I guess one slightly more sane solution would be to use your language of preference to autogenerate the json files, if c# is not an option for you.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.