Shared definition of the cw_plant entity: its entity fields and the getters for the time it was planted, the time
it ripens and the unique ID of the seed item it grew from.
Summary
Methods
Methods
ENT:Draw()
client gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/cl_init.lua:33Draws the plant's model.
ENT:GetGrowTime()
shared gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/shared.lua:28Returns when the plant is ripe.
Returns
- Number The
CurTimethe plant ripens at
ENT:GetItem()
shared gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/shared.lua:34Returns the unique ID of the seed item the plant grew from.
Returns
- String The seed item's unique ID
ENT:GetSpawnTime()
shared gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/shared.lua:22Returns when the plant was planted.
Returns
- Number The
CurTimethe seeds were planted at
ENT:HUDPaintTargetID(x, y, alpha)
client gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/cl_init.lua:7Draws the plant's name and, for players with over 25 farming, its maturity percentage.
Parameters
- x
- y
- alpha
ENT:Initialize()
shared gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/init.lua:14On the server
Sets up the plant's default pot model and physics.
On the client
Does nothing on the client.
Defined in
ENT:OnTakeDamage(dmg)
server gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/init.lua:48Destroys the plant when a player damages it.
Parameters
- dmg
ENT:SetGrowTime(time)
server gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/init.lua:113Sets when the plant is ripe.
Parameters
- time Number The
CurTimethe plant ripens at
ENT:SetItem(uniqueID)
server gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/init.lua:119Sets the seed item the plant grew from, which decides its name and harvest.
Parameters
- uniqueID String The seed item's unique ID
ENT:SetSpawnTime(time)
server gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/init.lua:107Sets when the plant was planted.
Parameters
- time Number The
CurTimethe seeds were planted at
ENT:SetupDataTables()
shared gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/shared.lua:14Sets up the networked plant time, grow time and seed item ID.
On the server
Scales the plant up from a quarter of its size as it grows, checking every five seconds.
On the client
Does nothing on the client.
Defined in
ENT:Use(activator)
server gamemodes/cwhl2rp/plugins/farming/plugin/entities/entities/cw_plant/init.lua:59Starts harvesting the ripe plant for a crouching, untied player.
The harvest takes 11 to 25 seconds, less with the farming attribute, during which the player
must stay crouched and near the plant. On success it fires PlayerHarvest and removes the
plant.
Parameters
- activator