1
0
mirror of https://github.com/mt-mods/unifieddyes.git synced 2025-07-15 14:50:33 +02:00

Compare commits

..

4 Commits

Author SHA1 Message Date
30c55bec6d Merge branch 'airbrush_on_place' into 'master'
Allows the airbrush to be placed into itemframes from homedecor

See merge request VanessaE/unifieddyes!7
2020-08-21 01:36:51 +00:00
e2c35e6694 Allows the airbrush to be placed into itemframes from homedecor 2020-08-21 03:27:13 +02:00
c91c68e0f5 Merge branch '6-move_item_crash' into 'master'
fix(bug):fix for a rare crash due to on_dig callback by non-player.

Closes #6

See merge request VanessaE/unifieddyes!6
2020-07-09 16:19:35 +00:00
09f95729c5 fix(bug):fix for a rare crash due to on_dig callback by non-player. 2020-07-09 12:05:10 -04:00

View File

@ -193,7 +193,7 @@ minetest.register_on_placenode(
-- The complementary function: strip-off the color if the node being dug is still white/neutral
local function move_item(item, pos, inv, digger)
if not digger then return end
if not (digger and digger:is_player()) then return end
local creative = creative_mode or minetest.check_player_privs(digger, "creative")
if inv:room_for_item("main", item)
and (not creative or not inv:contains_item("main", item, true)) then
@ -1147,10 +1147,11 @@ minetest.register_tool("unifieddyes:airbrush", {
unifieddyes.player_last_right_clicked[player_name] = {pos = pos, node = node, def = def}
if not keys.sneak then
if (not keys.sneak) and def.on_rightclick then
return def.on_rightclick(pos, node, placer, itemstack, pointed_thing)
elseif not keys.sneak then
unifieddyes.show_airbrush_form(placer)
elseif keys.sneak then
if not pos or not def then return end
local newcolor = unifieddyes.color_to_name(node.param2, def)