mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2025-06-28 14:26:21 +02:00
Compare commits
3 Commits
airbrush
...
201808-26-
Author | SHA1 | Date | |
---|---|---|---|
409ee441c4 | |||
ca1ab44e78 | |||
e13d514ff7 |
20
init.lua
20
init.lua
@ -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()
|
||||
|
Reference in New Issue
Block a user