From 67048ee057d0db912b383601c0fd39412e77e836 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 27 Jan 2013 03:45:40 +0000 Subject: Added cItems to Lua API. Now HOOK_BLOCK_TO_PICKUPS is fully functional, as demonstrated by HookNotify. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1178 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/HookNotify/HookNotify.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/HookNotify/HookNotify.lua b/MCServer/Plugins/HookNotify/HookNotify.lua index 519d837fe..9bae91d3c 100644 --- a/MCServer/Plugins/HookNotify/HookNotify.lua +++ b/MCServer/Plugins/HookNotify/HookNotify.lua @@ -74,9 +74,17 @@ end function OnBlockToPickups(...) - LOG("************************"); LogHook("OnBlockToPickups", unpack(arg)); - LOG("========================"); + local World, Digger, BlockX, BlockY, BlockZ, BlockType, BlockMeta, Pickups = unpack(arg); + if (Pickups ~= nil) then + local Name = "NULL"; + if (Digger ~= nil) then + Name = Digger:GetName() + end + LOG("Got cItems from " .. Name .. ", trying to manipulate them."); + Pickups:Add(cItem:new(E_ITEM_DIAMOND_SHOVEL, 1)); + LOG("Current size: " .. Pickups:Size()); + end; end; -- cgit v1.2.3