Summary
Hooks
Hooks
Implements hook ClockworkInitPostEntity
Called after all map entities have been initialized; spawns the saved plants.
Implements hook GetProgressBarInfo
Called when the progress bar info is needed; shows the harvesting progress bar.
Returns
- Map Progress bar
text,percentageandflash, ornilwhen no harvest is running
Spawns the plants saved for the current map with their seed item, growth and plant model.
Plants whose seed item no longer exists are skipped. Data saved before growth was stored as
age and remaining holds the CurTime values spawn and grow of an earlier map, which
are used as they are.
PLUGIN:PlayerHarvest(player, uniqueID)
server gamemodes/cwhl2rp/plugins/farming/plugin/sv_hooks.lua:25Implements hook PlayerHarvest
Called when a player finishes harvesting a ripe plant; rolls and gives the harvest.
The roll is 1 to 100 plus up to 50 from the farming attribute. At 40 or more the player gets the seeds back (twice above 100) and from 50 one to four crops; below 40 the harvest fails. Either way the farming attribute progresses.
Parameters
- player Player The player who harvested
- uniqueID String Unique ID of the seed item the plant grew from; its
Harvestfield lists the seed and crop IDs
Implements hook PostSaveData
Called after Catwork saves its data; saves the plants.
Saves the position, angles, growth and seed item of every plant on the map.
The data goes to plugins/farming/<map>.