1
0
mirror of https://github.com/mt-mods/unifieddyes.git synced 2025-06-28 14:26:21 +02:00

Compare commits

...

3 Commits

Author SHA1 Message Date
409ee441c4 respect protection 2018-08-26 08:59:28 -04:00
ca1ab44e78 add recipe for airbrush 2018-08-26 08:41:04 -04:00
e13d514ff7 allow shift-punch for airbrush form 2018-08-26 08:28:56 -04:00

View File

@ -644,13 +644,22 @@ function unifieddyes.on_airbrush(itemstack, player, pointed_thing)
end
local pos = minetest.get_pointed_thing_position(pointed_thing)
if not pos then unifieddyes.show_airbrush_form(player) return end
if not pos or player:get_player_control().sneak then
unifieddyes.show_airbrush_form(player)
return
end
if not painting_with then return end
local node = minetest.get_node(pos)
local def = minetest.registered_items[node.name]
if not def then return end
if minetest.is_protected(pos, player_name) then
minetest.chat_send_player(player_name, "Sorry, someone else owns that node.")
return
end
if not def.palette then
minetest.chat_send_player(player_name, "That node can't be colored.")
return
@ -877,6 +886,15 @@ minetest.register_tool("unifieddyes:airbrush", {
on_use = unifieddyes.on_airbrush
})
minetest.register_craft( {
output = "unifieddyes:airbrush",
recipe = {
{ "default:gold_ingot", "", "bucket:bucket_empty" },
{ "", "default:steel_ingot", "" },
{ "", "", "default:steel_ingot" }
},
})
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname == "unifieddyes:dye_select_form" then
local player_name = player:get_player_name()