Nathan Salapat 38680e9370 Update code for 5.8 9 months ago
..
models e4a345c43d Added some new plants and artwork. 2 years ago
textures 38680e9370 Update code for 5.8 9 months ago
bushes.lua e4a345c43d Added some new plants and artwork. 2 years ago
crops.lua 6c4f3a9eee Added a bunch more plants and trees. 3 years ago
flowers.lua cc4c3ed17e Made flowers pickable. 2 years ago
fungi.lua e929010d14 added a bunch of new nodes. 3 years ago
grass.lua 77ba4db0df Added a bunch of plants. 3 years ago
init.lua e4a345c43d Added some new plants and artwork. 2 years ago
license.txt 6c4f3a9eee Added a bunch more plants and trees. 3 years ago
misc.lua 59c215680c Added things, lol. 2 years ago
mod.conf 68f25b9960 fixes #13 3 years ago
readme.txt a130f93272 Documentation and code refactor. 3 years ago
sapling.lua 9686869684 Added multihome mod. 2 years ago

readme.txt

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.