summaryrefslogtreecommitdiff
path: root/tool.lua
diff options
context:
space:
mode:
authorTenPlus1 <kinsellaja@yahoo.com>2017-07-03 13:33:52 +0100
committerTenPlus1 <kinsellaja@yahoo.com>2017-07-03 13:33:52 +0100
commita57800c046d017f0bd47321de941d25621daf875 (patch)
tree8528ffff64e594f60390c595d1534d64dca76cf1 /tool.lua
parent965ac2eaa5ab7f0711a617c4144a760e391c3000 (diff)
tool can place vertically, protector recipe changed (gold instead of steel ingot)
Diffstat (limited to 'tool.lua')
-rw-r--r--tool.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/tool.lua b/tool.lua
index 9c315ae..653ba36 100644
--- a/tool.lua
+++ b/tool.lua
@@ -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