Unlimited customizable Orechid variants for botanical progression
morechids.json
is the configuration file used to define custom Morechid flowers. Flowers are specified as fields of a JSON object where the key is the unique identifier for the flower. The value of the key is another JSON object containing the configured option values for the flower. Note that the unique identifiers are not case sensitive. Additionally, existing botania flower identifiers are off limits.
For example, the following JSON structure would create two flowers with unique names myflower
and my_second_flower
, each with default values for all options.
{
"myflower": {},
"my_SECOND_fLoWeR": {}
}
Each custom flower can have external resources provided just like any other block. The resource path is based on the unique name you use to define your flower. For the example above, the resource paths for the two flowers would be morechids:myflower
and morechids:my_second_flower
. Flowers are defined as "blockstate" resources rather than blocks.
Default files will be generated at resources/morechids/blockstates/<FLOWER_NAME>.json
and resources/morechids/textures/<FLOWER_NAME>.png
for any Morechid names that don't have the appropriate files. You will need to define a localization string for morechids:<FLOWER_NAME>.name
, morechids.nei.<FLOWER_NAME>
, and optionally, if you want flavor text on the tooltip, morechids:<FLOWER_NAME>.reference
in your .lang
file.
Each Morechid you create can have each parameter individually configured. Morechids can be configured to cost mana like an Orechid, time like a Pure Daisy, or some combination of the two. Any parameter can be configured to act differently in a Garden Of Glass world simply by appending "GOG" to the end of the parameter name. If not explicitly specified, all "GOG" parameters will default to the same value as the corresponding non-"GOG" parameter.
Example configuration for mimicking Botania's Orechid behavior: (minus the recipes) (Note: recipes must be configured separately through CraftTweaker)
{
"orechid_clone": {
"manaCostGOG": 700,
"cooldownGOG": 2,
}
}
The default values for a flower are already set up to act like a non-GoG Orechid. As "GOG" parameters default to the non-"GOG" values if not specified, those are the only values we have to configure.
Example configuration for mimicking Botania's Pure Daisy behavior: (Note: recipes must be configured separately through CraftTweaker)
{
"puredaisy_clone": {
"manaCost": 0,
"timeCost": 1200,
"cooldown": 0,
"color": "FFFFFF",
"range": 1,
"rangeY": 0,
"playSound": false
}
}
The Pure Daisy costs time instead of mana, has a smaller range, and doesn't play a sound. We also set its color to white. Note that because the Pure Daisy does not behave differently in a GoG world (besides actual recipes), we don't need to set any "GOG" parameters.
-
manaCost
/manaCostGOG
: Integer [0 ~ ∞] (default: 17500)- The amount of mana required to perform a conversion.
- For reference, 1 charcoal in an endoflame produces 1200 mana over 40 seconds. 17500 is the default Orechid cost in Botania (700 in a Garden Of Glass world).
-
timeCost
/timeCostGOG
: Integer [0 ~ ∞] (default: 0)- The number of ticks a block must remain in the flower's range in order to be converted.
- If
manaCost
is also specified, mana will not be consumed until the instant the block is converted.
-
cooldown
/cooldownGOG
: Integer [0 ~ ∞] (default: 100)- The minimum number of ticks that must pass between block conversions.
- If this value is 0, the flower will attempt to convert all blocks that meet the
timeCost
requirements in the same tick. IfmanaCost
is greater than 0, attempts will be made in a random order, and attempts will stop if the flower runs out of mana.
-
range
/rangeGOG
: Integer [0 ~ ∞] (default: 5)- The number of blocks horizontally from the flower in which a block will be detected.
- This number can cause performance issues. See the Performance Concerns section for more details.
-
rangeY
/rangeYGOG
: Integer [0 ~ ∞] (default: 3)- The number of blocks vetically from the flower in which a block will be detected.
- This number can cause performance issues. See the Performance Concerns section for more details.
-
maxMana
/maxManaGOG
: Integer [manaCost
~ ∞] (default: same asmanaCost
)- The maximum amount of mana that can be stored in this flower's buffer. A number larger than
manaCost
may allow for multiple blocks to be converted before the flower runs out of mana. - If
manaCost
is 0, this value will be ignored.
- The maximum amount of mana that can be stored in this flower's buffer. A number larger than
-
particleColor
/particleColorGOG
: String (default: "818181")- A hex value as a string (ex: "FF0000") representing the color of sparkles coming off the flower when active.
- If timeCost is greater than 0, this will also control the color of the sparkles coming off blocks which are in the process of being converted.
-
playSound
/playSoundGOG
: Boolean (default: true)- If true, the Orechid BANG! sound will play when a block is converted.
-
rangeCheckInterval
/rangeCheckIntervalGOG
: Integer [1 ~cooldown
] (default: 1)- The number of ticks to wait between checks for newly placed blocks.
- This number can cause performance issues. See the Performance Concerns section for more details.
-
blockBreakParticles
/blockBreakParticlesGOG
: Boolean (default: true)- If true, block breaking particles will appear when a block is converted.
In order to locate blocks to convert, flowers must search the surrounding area for valid candidates. This requires checking every block within the flower's range, meaning a volume of (2*range + 1)^2 * (2*rangeY + 1) - 1
blocks. For a flower with range
of 5 and rangeY
of 3 (like the default Orechid), this would mean 846 blocks every tick. Keep this in mind when setting the range of your flower.
Setting the rangeCheckInterval
value to 20, for example, would allow this check to occur once every second, rather than once every tick. There are a few optimizations in the code to prevent this check from occurring when it is not necessary (such as if a flower has less mana than its manaCost
), but for the most part please keep this in mind when selecting a flower range.
The rangeCheckInterval
value will have an effect on the flower's behavior, in that it will potentially cause some variation in the effective cooldown
value for a flower. If a block is placed in the tick right after the range check last occurred, it will not be detected until the next range check occurs. Because of this, for a flower with a timeCost
less than its rangeCheckInterval
, it will not detect the block until the next range check occurs.
There will be a better explanation here eventually, but hopefully this gets the idea across.
Adding recipes to a Morechid is very straight forward and simply requires the use of a CraftTweaker script.
-
mods.morechids.Registry.getFlower(String identifier)
; returnsMorechidDefinition
- Returns a
MorechidDefinition
object used to define recipes for the flower with the givenidentifier
.
- Returns a
-
MorechidDefinition::addRecipe(IIngredient input, IIngredient output, double weight)
- Adds a conversion from the
input
block(s) to theoutput
block(s) with the givenweight
used to specify the probability of this recipe being selected as a conversion. Each call toaddRecipe
adds a new conversion entry for each input block into the recipe set for this flower. Ifoutput
contains an array of items or an Ore Dictionary entry, the recipe entry will contain the entire set of all blocks inoutput
, rather than each output block being its own separate entry. If an entry with an array of outputs is selected for a conversion, the actual converted block is selected uniformly at random from the array. - If the same
output
is added for aninput
block again in a different call toaddRecipe()
, a new recipe entry will be created for that output block in addition to any existing entries that may contain the same output block. input
andoutput
can be any item or liquid that has a block representation, an Ore Dictionary entry containing blocks, or an array of items that have block representations.weight
is a positive number added to each recipe entry. The probability of any entry being selected for a giveninput
block isweight
of the entry divided by the sum of theweight
values for every recipe entry associated with thatinput
block.
- Adds a conversion from the
-
MorechidDefinition::removeRecipe(IIngredient input, IIngredient output)
- Removes the ability for any of the
input
block(s) to be converted to any of theoutput
block(s). This is applied to ALL recipe entries associated with this flower. Any recipe entries for eachinput
block which contain anyoutput
block will have thatoutput
block removed from its set of possible outputs for the entry, but the entry will not be removed entirely unless this removal causes the entry to be completely empty. input
andoutput
can be any item or liquid that has a block representation, an Ore Dictionary entry containing blocks, or an array of items that have block representations.
- Removes the ability for any of the
-
MorechidDefinition::removeOutput(IIngredient output)
- Removes the specified
output
block(s) as an output for all recipe entries that may contain it, regardless of input block. output
can be any item or liquid that has a block representation, an Ore Dictionary entry containing blocks, or an array of items that have block representations.
- Removes the specified
-
MorechidDefinition::removeInput(IIngredient input)
- Removes the specified
input
block(s) as an input for all recipe entries that may contain it, regardless of output block. input
can be any item or liquid that has a block representation, an Ore Dictionary entry containing blocks, or an array of items that have block representations.
- Removes the specified
Here is an example just to show how the functions can be used. Yes, I know this is a pretty useless script. Hopefully you'll make better choices in your recipes.
// Get the flower instance and save it in a variable
var myFlower = mods.morechids.Registry.getFlower("myflower");
// Add some stone conversions to the flower
myFlower.addRecipe(<minecraft:stone>, <ore:oreIron>, 100);
myFlower.addRecipe(<minecraft:stone>, <minecraft:dirt>, 5);
myFlower.addRecipe(<minecraft:stone>, <minecraft:cobblestone>, 5);
// Add a conversion for any glass or stained glass to convert to any sandstone
myFlower.addRecipe(<ore:blockGlass>, <ore:sandstone>, 1);
// Remove a specific sandstone variant from the glass->sandstone conversion
myFlower.removeRecipe(<ore:blockGlass>, <minecraft:sandstone:1>);
// Add that conversion back only for regular minecraft glass blocks but not stained glass blocks.
myFlower.addRecipe(<minecraft:blockGlass>, <minecraft:sandstone:1>, 0.2);
// Remove dirt as a possible output of any recipe
myFlower.removeOutput(<minecraft:dirt>);
// Remove stone as a possible input for any recipe
myFlower.removeInput(<minecraft:stone>);
// Get another flower instance and set its recipes
var mySecondFlower = mods.morechids.Registry.getFlower("my_second_flower");
mySecondFlower.addRecipe(...);
mySecondFlower.addRecipe(...);
mySecondFlower.addRecipe(...);
// Et cetera