mirror of
https://notabug.org/TenPlus1/protector.git
synced 2025-01-25 08:41:27 +01:00
tool can place vertically, protector recipe changed (gold instead of steel ingot)
This commit is contained in:
parent
965ac2eaa5
commit
a57800c046
@ -49,6 +49,7 @@ Change log:
|
|||||||
2.1 - Added 'protector_night_pvp' setting so night-time becomes a free for all and
|
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)
|
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)
|
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
|
Lucky Blocks: 6
|
||||||
|
|
||||||
|
6
init.lua
6
init.lua
@ -424,7 +424,7 @@ minetest.register_craft({
|
|||||||
output = "protector:protect",
|
output = "protector:protect",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:stone", "default:stone", "default:stone"},
|
{"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"},
|
{"default:stone", "default:stone", "default:stone"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -500,7 +500,7 @@ minetest.register_node("protector:protect2", {
|
|||||||
|
|
||||||
on_blast = function() end,
|
on_blast = function() end,
|
||||||
})
|
})
|
||||||
|
--[[
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "protector:protect2",
|
output = "protector:protect2",
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -509,7 +509,7 @@ minetest.register_craft({
|
|||||||
{"default:stone", "default:stone", "default:stone"},
|
{"default:stone", "default:stone", "default:stone"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
]]
|
||||||
|
|
||||||
-- check formspec buttons or when name entered
|
-- check formspec buttons or when name entered
|
||||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
|
7
tool.lua
7
tool.lua
@ -28,9 +28,14 @@ minetest.register_craftitem("protector:tool", {
|
|||||||
local dir = minetest.dir_to_facedir( user:get_look_dir() )
|
local dir = minetest.dir_to_facedir( user:get_look_dir() )
|
||||||
local vec = {x = 0, y = 0, z = 0}
|
local vec = {x = 0, y = 0, z = 0}
|
||||||
local gap = (protector.radius * 2) + 1
|
local gap = (protector.radius * 2) + 1
|
||||||
|
local pit = user:get_look_pitch()
|
||||||
|
|
||||||
-- set placement coords
|
-- 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
|
vec.z = gap -- north
|
||||||
elseif dir == 1 then
|
elseif dir == 1 then
|
||||||
vec.x = gap -- east
|
vec.x = gap -- east
|
||||||
|
Loading…
Reference in New Issue
Block a user