|
TModLoader v1.4.4.9
TModLoader source code documentation
|
This class represents a type of modded tree. The tree will share a tile ID with the vanilla trees (5), so that the trees can freely convert between each other if the soil below is converted. This class encapsulates several functions that distinguish each type of tree from each other. More...
Inheritance diagram for Terraria.ModLoader.ModTree:
Collaboration diagram for Terraria.ModLoader.ModTree:Public Member Functions | |
| void | SetStaticDefaults () |
| Asset< Texture2D > | GetTexture () |
| virtual int | CreateDust () |
| Return the type of dust created when this tree is destroyed. Returns 7 by default. | |
| virtual int | TreeLeaf () |
| Return the type of gore created when the tree grow, being shook and falling leaves on windy days, returns -1 by default. | |
| virtual bool | Shake (int x, int y, ref bool createLeaves) |
| Executed on tree shake, return false to skip vanilla tree shake drops. The x and y coordinates correspond to the top of the tree, where items usually spawn. | |
| virtual bool | CanDropAcorn () |
| Whether or not this tree can drop acorns. Returns true by default. | |
| virtual int | SaplingGrowthType (ref int style) |
| Defines the sapling that can eventually grow into a tree. The type of the sapling should be returned here. Returns 20 and style 0 by default. The style parameter will determine which sapling is chosen if multiple sapling types share the same ID; even if you only have a single sapling in an ID, you must still set this to 0. | |
| int | DropWood () |
| The ID of the item that is dropped in bulk when this tree is destroyed. | |
| void | SetTreeFoliageSettings (Tile tile, ref int xoffset, ref int treeFrame, ref int floorY, ref int topTextureFrameWidth, ref int topTextureFrameHeight) |
| Asset< Texture2D > | GetTopTextures () |
| Return the texture containing the possible tree tops that can be drawn above this tree. The framing was determined under <cref>SetTreeFoliageSettings</cref> | |
| Asset< Texture2D > | GetBranchTextures () |
| Return the texture containing the possible tree branches that can be drawn next to this tree. The framing was determined under <cref>SetTreeFoliageSettings</cref> | |
| void ILoadable. | Load (Mod mod) |
| Called when loading the type. | |
| void ILoadable. | Unload () |
| Called during unloading when needed. | |
| bool | IsLoadingEnabled (Mod mod) |
| Whether or not this type should be loaded when it's told to. Returning false disables M:Terraria.ModLoader.Mod.AddContent(Terraria.ModLoader.ILoadable) from actually loading this type. | |
Static Public Attributes | |
| const int | VanillaStyleCount = 7 |
| const int | VanillaTopTextureCount = 100 |
Properties | |
| int | PlantTileId [get] |
| The tree will share a tile ID with the vanilla trees (5), so that the trees can freely convert between each other if the soil below is converted. | |
| int | VanillaCount [get] |
| TreePaintingSettings | TreeShaderSettings [get] |
| int[] | GrowsOnTileId [get, set] |
| virtual TreeTypes | CountsAsTreeType [get] |
| Used mostly for vanilla tree shake loot tables. | |
This class represents a type of modded tree. The tree will share a tile ID with the vanilla trees (5), so that the trees can freely convert between each other if the soil below is converted. This class encapsulates several functions that distinguish each type of tree from each other.
Definition at line 13 of file ModTree.cs.