From ccbf678937632896aaf6e2bf587531fafb8bde5a Mon Sep 17 00:00:00 2001 From: NewbProgrammer101 Date: Sun, 1 Oct 2017 16:48:36 -0500 Subject: [PATCH] Update actions.lua --- actions/actions.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/actions/actions.lua b/actions/actions.lua index 3a5ff9d..ede2336 100644 --- a/actions/actions.lua +++ b/actions/actions.lua @@ -208,7 +208,18 @@ end -- inventory, node will be placed anyways. -- 3. force_place: places node regardless of inventory - will not touch -- the NPCs inventory +function npc.getFacingNodeInfo(self) + local facing_dir = self.vFacingDirection + local dug_pos = { + x=self.vPos.x + villagers.NODE_AREA[facing_dir][1], + y=self.vTargetHeight, + z=self.vPos.z + villagers.NODE_AREA[facing_dir][2] + } + local node_names = npc.getNodeName(dug_pos) + return {dug_pos, node_names[1], node_names[2]} +end function npc.actions.cmd.PLACE(self, args) + local log = true local pos = args.pos local node = args.node local source = args.source