From fec64bb91c03c5e872a8f6fbc1a253f341373072 Mon Sep 17 00:00:00 2001 From: Persson-dev <66266021+Persson-dev@users.noreply.github.com> Date: Wed, 29 Dec 2021 20:28:41 +0100 Subject: Improved farmer AI & Fixed entity loading functions (#5351) * Allow villagers to pickup items * Add farmer villager harvesting * Use of auto keyword * Using for loop to check adjacent crops * Show particules when farmer harvest * Fix area comment * Move constants to header file * Removing unnecessary semicolon * Initialization of CropBlockType variable * Apply 12xx12 suggestion * Fixing area constant size * Refactor bounding box calculation, use vectors. * Add Api documentation * Update lua docs * Rework farmer ai * Fixing lua docs notes * Add missing capitalisation * Add villagers inventory save * Fixing loading entities from disk inconsistencies * Add farmer harvest animation * Fix beetroots grow state Co-authored-by: Alexander Harkness --- Server/Plugins/APIDump/APIDesc.lua | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'Server/Plugins/APIDump/APIDesc.lua') diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua index e2b0043a1..a6b6a957d 100644 --- a/Server/Plugins/APIDump/APIDesc.lua +++ b/Server/Plugins/APIDump/APIDesc.lua @@ -10183,8 +10183,8 @@ a_Player:OpenWindow(Window); Params = { { - Name = "Player", - Type = "cPlayer", + Name = "Entity", + Type = "cEntity", }, }, Returns = @@ -10194,7 +10194,7 @@ a_Player:OpenWindow(Window); Type = "boolean", }, }, - Notes = "Tries to make the player collect the pickup. Returns true if the pickup was collected, at least partially.", + Notes = "Tries to make the entity collect the pickup. Returns true if the pickup was collected, at least partially.", }, GetAge = { @@ -18877,6 +18877,24 @@ end }, Notes = "Returns true if the specified item type is any kind of a tool (axe, hoe, pickaxe, shovel or FIXME: sword)", }, + IsVillagerFood = + { + IsStatic = true, + Params = + { + { + Name = "ItemType", + Type = "number", + }, + }, + Returns = + { + { + Type = "boolean", + }, + }, + Notes = "Returns true if the specified item type is any kind of a pickable food by a villager (potato, carrot, wheat, bread and any kind of seeds).", + } }, AdditionalInfo = { -- cgit v1.2.3