-
Notifications
You must be signed in to change notification settings - Fork 29
User API 2.4.x
This section will explain how to use the User JSON api to define recipes or curve the behaviour of growthcraft beyond the basic configuration options provided.
- Troubleshoot
- Timing
- Common Schemas
- Item Key Schemas
- Brewing Recipes
- Fermenting Recipes
- Heat Sources
- Pressing Recipes
- Yeast Generation
From here on, basic understanding of how to write JSON files is needed, if you have no idea what JSON is, you probably shouldn't be reading this yet.
From this point on $MINECRAFT
will refer to your minecraft installation directory (normally ~/.minecraft
for *nix users, and %APPDATA%\.minecraft
for Windows)
$CONFIG
will refer to $MINECRAFT/config
, and $GRC_CONFIG
will refer to $CONFIG/growthcraft
All paths will use UNIX, /
instead of Windows \
, because 2 out of 3 OSes are UNIX based, so (⌐■_■) Deal With It™
If Growthcraft does strange things, or you feel something is missing, try removing the json config files and allow Growthcraft to rebuild them, then re-apply your edits and test again.
Growthcraft WILL skip any invalid items, blocks, entries to the best of its ability.
If you think something is broken, or missing, try setting the "debug" option in $GRC_CONFIG/*.conf
and watching the console output, where * is the module you wish to debug.
Growthcraft will load all User config files during PRE-INIT, all registration will be done POST-INIT, this means your game will FAIL early, if your config files have syntax or structural errors. And no, we won't "catch" these errors, deal with them like decent users.
Throughout this document, you will encounter certain common schemas types:
ItemStackSchema {
"comment": String,
"mod_id": String,
"name": String,
"meta": Integer,
"amount": Integer
}
OreItemSchema {
"comment": String,
"name": String,
"amount": Integer
}
// Allows you to specify either or both an item and ore dictionary name
ItemKeySchema extends ItemStackSchema {
"ore": String
}
FluidStackSchema {
"comment": String,
"name": String,
"amount": Integer
}
// 2.4.1
ResidueSchema extends ItemKeySchema {
"pomace": Float
}
// 2.4.0
ResidueSchema extends ItemStackSchema {
"pomace": Float
}
You may notice the inclusion of a comment field, this is completely optional and does nothing.
Previously mentioned, ItemKeySchemas are a combined version of the OreItemSchema and ItemStackSchema This allows you to specify an item OR an ore dictionary name to use in place of the item, you may specify both, but its recommended only to use one or the other.
To specify an Item, use the ItemStackSchema form:
{
"mod_id": "Growthcraft|Cellar",
"name": "grc.yeast",
"meta": 0,
"amount": 1
}
To specify an OreDictionary item, use this:
{
"ore": "yeast",
"amount": 1
}
NOTE Notice the use of "ore" instead of "name", name is specific to the ItemStackSchema, the only thing shared is the amount.
If you want, you can specify both, all items found will be registered for the recipe, IF supported (all recipes have been updated to support this so far)
{
"mod_id": "Growthcraft|Cellar",
"name": "grc.yeast",
"meta": 0,
"ore": "yeast",
"amount": 1
}
Brewing Recipes may be added via the $GRC_CONFIG/cellar/brewing.json
The JSON structure is Array<UserBrewingRecipe>
NOTE The
As of the latest commits to development, this is no longer valid, input_fluid
amount is ignored and only the output_fluid
amount is used.input_fluid
amount can vary from the output_fluid
amount
UserBrewingRecipe {
"comment": String,
"item": ItemKeySchema,
"input_fluid": FluidStackSchema,
"output_fluid": FluidStackSchema,
"residue": ResidueSchema,
"time": Integer
}
[
{
"item": {
"mod_id": "Growthcraft|Rice",
"name": "grc.rice",
"amount": 1,
"meta": 0
},
"input_fluid": {
"name": "water",
"amount": 20
},
"output_fluid": {
"name": "grc.sake0",
"amount": 20
},
"residue": {
"mod_id": "minecraft",
"name": "dye",
"amount": 1,
"meta": 15,
"pomace": 0.3
},
"time": 20
}
]
Fermenting Recipes may be added via the $GRC_CONFIG/cellar/fermenting.json
The JSON structure is Array<UserFermentingRecipe>
Note Fermenting recipes will IGNORE any fluid amount
specified. unless you specified zero, in which case the behaviour is undefined, to be safe just set it as 1 and leave it be.
UserFermentingRecipe {
"comment": String,
"item": ItemKeySchema,
"input_fluid": FluidStackSchema,
"output_fluid": FluidStackSchema,
"time": Integer
}
{
"item": {
"comment": "Brewers Yeast",
"mod_id": "Growthcraft|Cellar",
"name": "grc.yeast",
"meta": 0,
"amount": 1
},
"input_fluid": {
"name": "grc.sake0",
"amount": 1
},
"output_fluid": {
"name": "grc.sake1",
"amount": 1
},
"time": 12000
}
Heat sources may be added via the $GRC_CONFIG/cellar/heatsources.json
The JSON structure is Array<UserHeatSourceEntry>
UserHeatSourceEntry {
"comment": String,
"mod_id": String,
"block_name": String,
"states": Map<Integer, Float> {
"metadata": Float
}
}
metadata is replaced with the Block's metadata, OR "-1", OR "32767", where the latter 2 are wildcards, any value less than 0 will be treated as a wildcard.
Due to the JSON format, all keys must be Strings
, and so metadata is written as a String
rather than its Integer
format.
# YES
"-1": 1.0f
# NO
-1: 1.0f
As of this writing (2015/11/21) the default entries are:
[
{
"mod_id": "minecraft",
"block_name": "fire",
"states": {
"32767": 1.0
}
},
{
"mod_id": "minecraft",
"block_name": "flowing_lava",
"states": {
"32767": 0.7
}
},
{
"mod_id": "minecraft",
"block_name": "lava",
"states": {
"32767": 0.7
}
}
]
Pressing Recipes may be added via the $GRC_CONFIG/cellar/pressing.json
The JSON structure is Array<UserPressingRecipe>
UserPressingRecipe {
"comment": String,
"item": ItemKeySchema,
"fluid": FluidStackSchema,
"time": Integer,
"residue": ResidueSchema
}
[
{
"item": {
"mod_id": "minecraft",
"name": "apple",
"amount": 1,
"meta": 0
},
"fluid": { "name": "grc.appleCider0", "amount": 40 },
"time": 40,
"residue": {
"mod_id": "minecraft",
"name": "dye",
"amount": 1,
"meta": 15,
"pomace": 0.3
},
}
]
Yeast items can be registered to biomes via the $GRC_CONFIG/cellar/yeast.json
The JSON structure is Array<UserYeastEntry>
UserYeastEntry {
"comment": String,
"item": ItemKeySchema,
"biomes": Array<String>
}
As of (2015/11/21), these are the default entries
[
{
"item": {
"mod_id": "Growthcraft|Cellar",
"name": "grc.yeast",
"amount": 1,
"meta": 0
},
"biomes": ["HOT", "SPARSE", "DENSE", "WET", "DRY", "SAVANNA", "CONIFEROUS", "JUNGLE", "SPOOKY",
"DEAD", "LUSH", "NETHER", "END", "OCEAN", "RIVER", "WATER", "MESA", "FOREST", "PLAINS", "MOUNTAIN",
"HILLS", "SWAMP", "SANDY", "SNOWY", "WASTELAND", "BEACH", "DESERT", "FROZEN"]
},
{
"item": {
"mod_id": "Growthcraft|Cellar",
"name": "grc.yeast",
"amount": 1,
"meta": 1
},
"biomes": ["COLD"]
},
{
"item": {
"mod_id": "Growthcraft|Cellar",
"name": "grc.yeast",
"amount": 1,
"meta": 3
},
"biomes": ["MUSHROOM", "MAGICAL"]
}
]
[General Information](General Information)
In-Game Documentation
Growthcraft Apples
Growthcraft Bamboo
Growthcraft Bees
Growthcraft Cellar
Growthcraft Cellar - Yeast
Growthcraft Fishtrap
Growthcraft Grapes
Growthcraft Hops
Growthcraft Milk
Growthcraft Rice
API Documentation
Dev Documentation
Module Contribution Guide
How-To Build Growthcraft
Modpack Documentation