tool can place vertically, protector recipe changed (gold instead of steel ingot)

master
TenPlus1 2017-07-03 13:33:52 +01:00
parent 965ac2eaa5
commit a57800c046
3 changed files with 10 additions and 4 deletions

View File

@ -49,6 +49,7 @@ Change log:
2.1 - Added 'protector_night_pvp' setting so night-time becomes a free for all and
players can hurt one another even inside protected areas (not spawn protected)
2.2 - Updated protector tool so that player only needs to stand nearby (2 block radius)
It can also place vertically (up and down) as well. New protector recipe added.
Lucky Blocks: 6

View File

@ -424,7 +424,7 @@ minetest.register_craft({
output = "protector:protect",
recipe = {
{"default:stone", "default:stone", "default:stone"},
{"default:stone", "default:steel_ingot", "default:stone"},
{"default:stone", "default:gold_ingot", "default:stone"},
{"default:stone", "default:stone", "default:stone"},
}
})
@ -500,7 +500,7 @@ minetest.register_node("protector:protect2", {
on_blast = function() end,
})
--[[
minetest.register_craft({
output = "protector:protect2",
recipe = {
@ -509,7 +509,7 @@ minetest.register_craft({
{"default:stone", "default:stone", "default:stone"},
}
})
]]
-- check formspec buttons or when name entered
minetest.register_on_player_receive_fields(function(player, formname, fields)

View File

@ -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