summaryrefslogblamecommitdiffstats
path: root/MCServer/Plugins/sTick/onblockplace.lua
blob: 6bc2ce46a4b4356a3bad4dcd3451be7ee4a9c490 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                           

                                                     
                                             


                             

                                             


                             
                                                                                                 
 
                                                                    



                    
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