diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2017-07-03 13:33:52 +0100 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2017-07-03 13:33:52 +0100 |
commit | a57800c046d017f0bd47321de941d25621daf875 (patch) | |
tree | 8528ffff64e594f60390c595d1534d64dca76cf1 /tool.lua | |
parent | 965ac2eaa5ab7f0711a617c4144a760e391c3000 (diff) |
tool can place vertically, protector recipe changed (gold instead of steel ingot)
Diffstat (limited to 'tool.lua')
-rw-r--r-- | tool.lua | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -28,9 +28,14 @@ minetest.register_craftitem("protector:tool", { local dir = minetest.dir_to_facedir( user:get_look_dir() )
local vec = {x = 0, y = 0, z = 0}
local gap = (protector.radius * 2) + 1
+ local pit = user:get_look_pitch()
-- set placement coords
- if dir == 0 then
+ if pit > 1.2 then
+ vec.y = gap -- up
+ elseif pit < -1.2 then
+ vec.y = -gap -- down
+ elseif dir == 0 then
vec.z = gap -- north
elseif dir == 1 then
vec.x = gap -- east
|