This mod can register three different types of nodes, crops, grass, and plants.
Crops come in two versions, and include a craft item that can be picked by punching the mature crop.
Grass registers as five variations of the same plant, doesn't have to be grass.
Plants are single nodes that have an option of glowing.
Register a crop with plants.register_crop(name, desc, bit1, bit2)
name will be the name of the node, as is also part of the texture file.
desc is the node description, and will be used for all three items.
bit1 and bit2 are used for the meshoptions bitflag. (Both are optional.)
`paramtype2 = "meshoptions"`
* Only valid for "plantlike" drawtype. `param2` encodes the shape and
optional modifiers of the "plant". `param2` is a bitfield.
* Bits 0 to 2 select the shape.
Use only one of the values below:
* 0 = a "x" shaped plant (ordinary plant)
* 1 = a "+" shaped plant (just rotated 45 degrees)
* 2 = a "*" shaped plant with 3 faces instead of 2
* 3 = a "#" shaped plant with 4 faces instead of 2
* 4 = a "#" shaped plant with 4 faces that lean outwards
* 5-7 are unused and reserved for future meshes.
* Bits 3 to 7 are used to enable any number of optional modifiers.
Just add the corresponding value(s) below to `param2`:
* 8 - Makes the plant slightly vary placement horizontally
* 16 - Makes the plant mesh 1.4x larger
* 32 - Moves each face randomly a small bit down (1/8 max)
* values 64 and 128 (bits 6-7) are reserved for future use.
* Example: `param2 = 0` selects a normal "x" shaped plant
* Example: `param2 = 17` selects a "+" shaped plant, 1.4x larger (1+16)
When a crop is registered two nodes will be created, you need to provide two textures.
textures must be named as follows,
plants_[name]_1.png This is the harvested version.
plants_[name]_2.png This is the full grown version.
A craftitem is also registered for the object that is harvested. It's texture is,
plants_[name].png
Register grass with
plants.register_grass(name, desc)
As with crops, name is the name of the node, and part of the texture. desc is the node description.
Textures must be named accordingly;
plants_[name]_1.png
plants_[name]_2.png
plants_[name]_3.png
plants_[name]_4.png
plants_[name]_5.png
The inventory image of a grass will be the _3 texture, and will placing one of the five nodes will be randomly placed.
Register a plant with
plants.register_plant(name, desc, light)
As in the above two functions name and desc do what you expect. The light field is optional, and lets a plant glow.
The texture must be named plants_[name].png
Plants get a random rotation upon placement using the paramtype2 of degrotate.