Class Plants.PlantDefinition

java.lang.Object
net.risingworld.api.definitions.Plants.PlantDefinition
Enclosing class:
Plants

public final class Plants.PlantDefinition extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Asset path to the plant prefab
    Scale factors which will be applied to the bounds when placing it.
    Break sound for this plant
    boolean
    If true, this plant can grow
    float
    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 edge
    Optional asset path of debris (when cutting down the plant).
    If the element is destroyed, this is the item the player gets
    int
    Determines number of "destroyitems" the player gets when destroying the element
    If not null, this object element gets spawned when the plant is (fully) destroyed
    If the plant gets destroyed, this plant remains (the rest plant)
    Plant size / extent
    float
    Brightness for falling leaves
    int
    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 area
    float
    If leaves should spawn when destroying this plant, this determines the size per leaf particle
    int
    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 particles
    Fall sound (only for trees)
    Seasons during which the plant can grow.
    int
    Duration (seconds) until the next growth stage is reached
    boolean
    Determines if this plant is harvestable with a sickle
    If player harvests this plant with a sickle, this is the item he gets
    int
    Amount of items player gets when harvesting this plant
    boolean
    If true, the pickup item is also added to player inventory when harvesting the plant
    If 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 plant
    Optional asset path to hit decal.
    Hit sound for this plant
    short
    Internal type ID of the plant
    float
    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 plant
    Name of the next growth stage plant
    If plant can be picked up, this is the item the player gets
    int
    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 remains
    Place sound
    boolean
    If true, the Y rotation will change randomly when reaching the next growth stage
    float
    Optional plant offset when rendering the plant icon
    Optional plant rotation when rendering the plant icon
    float
    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 plant
    float
    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 on
    float
    Additional vertical (Y) adjustment of the plant when it spawns naturally
    Current 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 type
    float
    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

    Modifier and Type
    Method
    Description
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • id

      public short id
      Internal type ID of the plant
    • name

      public String name
      Name of the plant
    • type

      public Plants.Type type
      Plant type
    • stage

      public Plants.Stage stage
      Current plant stage (default, dead, growing, sapling etc)
    • assetpath

      public String assetpath
      Asset path to the plant prefab
    • strength

      public short strength
      Plant strength (hit points)
    • extent

      public Plants.Size extent
      Plant size / extent
    • windparam

      public int windparam
      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)
    • windaffection

      public float windaffection
      Amount how much this plant is affected by wind (TBD)
    • slopeadjustment

      public float slopeadjustment
      If growing on slopes, how much will this plant align to the slope (0-1)
    • spawngroundtypes

      public Plants.TerrainMaterialType[] spawngroundtypes
      Array of all terrain material types this plant can naturally spawn on
    • spawnoffsety

      public float spawnoffsety
      Additional vertical (Y) adjustment of the plant when it spawns naturally
    • centerofmassoffset

      public float centerofmassoffset
      Optional vertical offset (Y) for the center of mass of felled trees (rigidbody)
    • minspawnsize

      public float minspawnsize
      Minimum scale factor that may be applied to the plant (default scale: 1.0)
    • maxspawnsize

      public float maxspawnsize
      Maximum scale factor that may be applied to the plant (default scale: 1.0)
    • touchdamage

      public int touchdamage
      Damage that's applied to the player when touching the plant (requires a trigger on the plant prefab!)
    • treelog

      public String treelog
      Treelog item that spawns when cutting down (only used for trees)
    • treelogvariant

      public int treelogvariant
      Optional item variant for the treelog. By default 0
    • treelogcount

      public int treelogcount
      Number of treelog items that spawn when cutting down (only used for trees)
    • sapling

      public String sapling
      Sapling item that spawns when cutting down this plant (only used for trees)
    • saplingvariant

      public int saplingvariant
      Optional item variant for the sapling. By default 0
    • saplingcountmin

      public int saplingcountmin
      Minimum number of saplings that spawn (only used for trees)
    • saplingcountmax

      public int saplingcountmax
      Maximum number of saplings that spawn (only used for trees)
    • pickupitem

      public String pickupitem
      If plant can be picked up, this is the item the player gets
    • pickupitemcount

      public int pickupitemcount
      Determines number of items player get when picking up the plant (if that's possible at all)
    • pickuprestplant

      public String pickuprestplant
      If player can pick up this plant, this is the name of the plant that remains
    • harvestable

      public boolean harvestable
      Determines if this plant is harvestable with a sickle
    • harvestrestplant

      public String harvestrestplant
      If player harvests this plant with a sickle, this plant remains (if null, the plant fully despawns)
    • harvestitem

      public String harvestitem
      If player harvests this plant with a sickle, this is the item he gets
    • harvestitemcount

      public int harvestitemcount
      Amount of items player gets when harvesting this plant
    • harvestpickupitem

      public boolean harvestpickupitem
      If true, the pickup item is also added to player inventory when harvesting the plant
    • destroyrestplant

      public String destroyrestplant
      If the plant gets destroyed, this plant remains (the rest plant)
    • destroyrestobject

      public String destroyrestobject
      If not null, this object element gets spawned when the plant is (fully) destroyed
    • destroyitem

      public String destroyitem
      If the element is destroyed, this is the item the player gets
    • destroyitemcount

      public int destroyitemcount
      Determines number of "destroyitems" the player gets when destroying the element
    • scaleitemcount

      public boolean scaleitemcount
      If 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 hasbirds
      If true, there is a chance that birds live in this plant
    • treetop

      public float treetop
      Height (offset) of the treetop. Will be used for sound position, or falling leaves particles etc.
    • fallingleavescount

      public int fallingleavescount
      Number of falling leaves to spawn when destroying this plant (if 0, no leaves spawn)
    • fallingleavesradius

      public float fallingleavesradius
      If leaves should spawn when destroying this plant, this determines the radius of the spawn area
    • fallingleavessize

      public float fallingleavessize
      If leaves should spawn when destroying this plant, this determines the size per leaf particle
    • fallingleavesbrightness

      public float fallingleavesbrightness
      Brightness for falling leaves
    • fallingleavesspawnsubmesh

      public int fallingleavesspawnsubmesh
      If 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

      public String fallingleavestexture
      If leaves should spawn when destroying this plant, this determines the texture for the leaf particles
    • treelogassetpath

      public String treelogassetpath
      Optional asset path of the tree log (only relevant for trees). May be null
    • stumpassetpath

      public String stumpassetpath
      Optional asset path of the tree stump (only relevant for trees). May be null
    • debrisassetpath

      public String debrisassetpath
      Optional asset path of debris (when cutting down the plant). May be null
    • hitdecal

      public String hitdecal
      Optional asset path to hit decal. May be null
    • cutedge

      public float cutedge
      Y position (offset) of the cut edge
    • cangrow

      public boolean cangrow
      If true, this plant can grow
    • nextgrowthstage

      public String nextgrowthstage
      Name of the next growth stage plant
    • growthtime

      public int growthtime
      Duration (seconds) until the next growth stage is reached
    • randomgrowthrotation

      public boolean randomgrowthrotation
      If true, the Y rotation will change randomly when reaching the next growth stage
    • growingseasons

      public Seasons.Season[] growingseasons
      Seasons during which the plant can grow. Never null!
    • requiresfarmland

      public boolean requiresfarmland
      If true, this plant can only be planted on farmland (TODO)
    • requireswater

      public boolean requireswater
      If true, this plant requires water to grow (TODO)
    • requiressunlight

      public boolean requiressunlight
      If true, this plant requires sunlight to grow (TODO)
    • boundscale

      public Vector3f 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 renderscale
      Scale factors when rendering the plant icon. Default: 1.0
    • renderoffset

      public float renderoffset
      Optional plant offset when rendering the plant icon
    • renderrotation

      public Quaternion renderrotation
      Optional plant rotation when rendering the plant icon
    • hitsound

      public String hitsound
      Hit sound for this plant
    • breaksound

      public String breaksound
      Break sound for this plant
    • fallsound

      public String fallsound
      Fall sound (only for trees)
    • collidesound

      public String collidesound
      Collide sound (only for trees)
    • placesound

      public String placesound
      Place sound
  • Method Details

    • synchronize

      public void synchronize()