1
0
cuberite-2a/MCServer/Plugins/sTick/onblockplace.lua
madmaxoft@gmail.com 9fa165488b sTick: Updated the plugin to work with current code
git-svn-id: http://mc-server.googlecode.com/svn/trunk@920 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-10-03 07:24:25 +00:00

19 lines
456 B
Lua

function OnBlockPlace(Player, BlockX, BlockY, BlockZ, BlockFace, HeldItem)
-- dont check if the direction is in the air
if BlockFace == BLOCK_FACE_NONE then
return false
end
if (HeldItem.m_ItemType ~= 280) then
-- not a Stick of Ticking
return false
end
LOG("Setting next block tick to {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}")
Player:GetWorld():SetNextBlockTick(BlockX, BlockY, BlockZ);
return true
end