Package net.risingworld.api.definitions
Class Plants.PlantDefinition
java.lang.Object
net.risingworld.api.definitions.Plants.PlantDefinition
- Enclosing class:
Plants
-
Field Summary
Modifier and TypeFieldDescriptionAsset path to the plant prefabScale factors which will be applied to the bounds when placing it.Break sound for this plantboolean
If true, this plant can growfloat
Optional vertical offset (Y) for the center of mass of felled trees (rigidbody)Collide sound (only for trees)float
Y position (offset) of the cut edgeOptional asset path of debris (when cutting down the plant).If the element is destroyed, this is the item the player getsint
Determines number of "destroyitems" the player gets when destroying the elementIf not null, this object element gets spawned when the plant is (fully) destroyedIf the plant gets destroyed, this plant remains (the rest plant)Plant size / extentfloat
Brightness for falling leavesint
Number of falling leaves to spawn when destroying this plant (if 0, no leaves spawn)float
If leaves should spawn when destroying this plant, this determines the radius of the spawn areafloat
If leaves should spawn when destroying this plant, this determines the size per leaf particleint
If leaves should spawn when destroying this plant, this is the submesh of the leaves of the original tree mesh (or log mesh).If leaves should spawn when destroying this plant, this determines the texture for the leaf particlesFall sound (only for trees)Seasons during which the plant can grow.int
Duration (seconds) until the next growth stage is reachedboolean
Determines if this plant is harvestable with a sickleIf player harvests this plant with a sickle, this is the item he getsint
Amount of items player gets when harvesting this plantboolean
If true, the pickup item is also added to player inventory when harvesting the plantIf player harvests this plant with a sickle, this plant remains (if null, the plant fully despawns)boolean
If true, there is a chance that birds live in this plantOptional asset path to hit decal.Hit sound for this plantshort
Internal type ID of the plantfloat
Maximum scale factor that may be applied to the plant (default scale: 1.0)float
Minimum scale factor that may be applied to the plant (default scale: 1.0)Name of the plantName of the next growth stage plantIf plant can be picked up, this is the item the player getsint
Determines number of items player get when picking up the plant (if that's possible at all)If player can pick up this plant, this is the name of the plant that remainsPlace soundboolean
If true, the Y rotation will change randomly when reaching the next growth stagefloat
Optional plant offset when rendering the plant iconOptional plant rotation when rendering the plant iconfloat
Scale factors when rendering the plant icon.boolean
If true, this plant can only be planted on farmland (TODO)boolean
If true, this plant requires sunlight to grow (TODO)boolean
If true, this plant requires water to grow (TODO)Sapling item that spawns when cutting down this plant (only used for trees)int
Maximum number of saplings that spawn (only used for trees)int
Minimum number of saplings that spawn (only used for trees)int
Optional item variant for the sapling.boolean
If true, the number of items the player gets when harvesting/destroying/picking up the item depends on the scale of the plantfloat
If growing on slopes, how much will this plant align to the slope (0-1)Array of all terrain material types this plant can naturally spawn onfloat
Additional vertical (Y) adjustment of the plant when it spawns naturallyCurrent plant stage (default, dead, growing, sapling etc)short
Plant strength (hit points)Optional asset path of the tree stump (only relevant for trees).int
Damage that's applied to the player when touching the plant (requires a trigger on the plant prefab!)Treelog item that spawns when cutting down (only used for trees)Optional asset path of the tree log (only relevant for trees).int
Number of treelog items that spawn when cutting down (only used for trees)int
Optional item variant for the treelog.float
Height (offset) of the treetop.Plant typefloat
Amount how much this plant is affected by wind (TBD)int
Determines the tree wind sound parameter: tree1 (dead, thin), tree2 (dead, thick), tree3 (deciduous, thin), tree4 (deciduous, thick), tree5 (coniferous), tree6 (palm), tree7 (young), tree8 (cactus) -
Method Summary
-
Field Details
-
id
public short idInternal type ID of the plant -
name
Name of the plant -
type
Plant type -
stage
Current plant stage (default, dead, growing, sapling etc) -
assetpath
Asset path to the plant prefab -
strength
public short strengthPlant strength (hit points) -
extent
Plant size / extent -
windparam
public int windparamDetermines the tree wind sound parameter: tree1 (dead, thin), tree2 (dead, thick), tree3 (deciduous, thin), tree4 (deciduous, thick), tree5 (coniferous), tree6 (palm), tree7 (young), tree8 (cactus) -
windaffection
public float windaffectionAmount how much this plant is affected by wind (TBD) -
slopeadjustment
public float slopeadjustmentIf growing on slopes, how much will this plant align to the slope (0-1) -
spawngroundtypes
Array of all terrain material types this plant can naturally spawn on -
spawnoffsety
public float spawnoffsetyAdditional vertical (Y) adjustment of the plant when it spawns naturally -
centerofmassoffset
public float centerofmassoffsetOptional vertical offset (Y) for the center of mass of felled trees (rigidbody) -
minspawnsize
public float minspawnsizeMinimum scale factor that may be applied to the plant (default scale: 1.0) -
maxspawnsize
public float maxspawnsizeMaximum scale factor that may be applied to the plant (default scale: 1.0) -
touchdamage
public int touchdamageDamage that's applied to the player when touching the plant (requires a trigger on the plant prefab!) -
treelog
Treelog item that spawns when cutting down (only used for trees) -
treelogvariant
public int treelogvariantOptional item variant for the treelog. By default 0 -
treelogcount
public int treelogcountNumber of treelog items that spawn when cutting down (only used for trees) -
sapling
Sapling item that spawns when cutting down this plant (only used for trees) -
saplingvariant
public int saplingvariantOptional item variant for the sapling. By default 0 -
saplingcountmin
public int saplingcountminMinimum number of saplings that spawn (only used for trees) -
saplingcountmax
public int saplingcountmaxMaximum number of saplings that spawn (only used for trees) -
pickupitem
If plant can be picked up, this is the item the player gets -
pickupitemcount
public int pickupitemcountDetermines number of items player get when picking up the plant (if that's possible at all) -
pickuprestplant
If player can pick up this plant, this is the name of the plant that remains -
harvestable
public boolean harvestableDetermines if this plant is harvestable with a sickle -
harvestrestplant
If player harvests this plant with a sickle, this plant remains (if null, the plant fully despawns) -
harvestitem
If player harvests this plant with a sickle, this is the item he gets -
harvestitemcount
public int harvestitemcountAmount of items player gets when harvesting this plant -
harvestpickupitem
public boolean harvestpickupitemIf true, the pickup item is also added to player inventory when harvesting the plant -
destroyrestplant
If the plant gets destroyed, this plant remains (the rest plant) -
destroyrestobject
If not null, this object element gets spawned when the plant is (fully) destroyed -
destroyitem
If the element is destroyed, this is the item the player gets -
destroyitemcount
public int destroyitemcountDetermines number of "destroyitems" the player gets when destroying the element -
scaleitemcount
public boolean scaleitemcountIf true, the number of items the player gets when harvesting/destroying/picking up the item depends on the scale of the plant -
hasbirds
public boolean hasbirdsIf true, there is a chance that birds live in this plant -
treetop
public float treetopHeight (offset) of the treetop. Will be used for sound position, or falling leaves particles etc. -
fallingleavescount
public int fallingleavescountNumber of falling leaves to spawn when destroying this plant (if 0, no leaves spawn) -
fallingleavesradius
public float fallingleavesradiusIf leaves should spawn when destroying this plant, this determines the radius of the spawn area -
fallingleavessize
public float fallingleavessizeIf leaves should spawn when destroying this plant, this determines the size per leaf particle -
fallingleavesbrightness
public float fallingleavesbrightnessBrightness for falling leaves -
fallingleavesspawnsubmesh
public int fallingleavesspawnsubmeshIf leaves should spawn when destroying this plant, this is the submesh of the leaves of the original tree mesh (or log mesh). -1 for no submesh -
fallingleavestexture
If leaves should spawn when destroying this plant, this determines the texture for the leaf particles -
treelogassetpath
Optional asset path of the tree log (only relevant for trees). May be null -
stumpassetpath
Optional asset path of the tree stump (only relevant for trees). May be null -
debrisassetpath
Optional asset path of debris (when cutting down the plant). May be null -
hitdecal
Optional asset path to hit decal. May be null -
cutedge
public float cutedgeY position (offset) of the cut edge -
cangrow
public boolean cangrowIf true, this plant can grow -
nextgrowthstage
Name of the next growth stage plant -
growthtime
public int growthtimeDuration (seconds) until the next growth stage is reached -
randomgrowthrotation
public boolean randomgrowthrotationIf true, the Y rotation will change randomly when reaching the next growth stage -
growingseasons
Seasons during which the plant can grow. Never null! -
requiresfarmland
public boolean requiresfarmlandIf true, this plant can only be planted on farmland (TODO) -
requireswater
public boolean requireswaterIf true, this plant requires water to grow (TODO) -
requiressunlight
public boolean requiressunlightIf true, this plant requires sunlight to grow (TODO) -
boundscale
Scale factors which will be applied to the bounds when placing it. Smaller values to make the bounds smaller etc. Default is 1 1 1 -
renderscale
public float renderscaleScale factors when rendering the plant icon. Default: 1.0 -
renderoffset
public float renderoffsetOptional plant offset when rendering the plant icon -
renderrotation
Optional plant rotation when rendering the plant icon -
hitsound
Hit sound for this plant -
breaksound
Break sound for this plant -
fallsound
Fall sound (only for trees) -
collidesound
Collide sound (only for trees) -
placesound
Place sound
-
-
Method Details
-
synchronize
public void synchronize()
-