mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2025-07-12 21:30:41 +02:00
Compare commits
6 Commits
2020-02-16
...
30c55bec6d
Author | SHA1 | Date | |
---|---|---|---|
30c55bec6d | |||
e2c35e6694 | |||
c91c68e0f5 | |||
09f95729c5 | |||
71d7e3c954 | |||
17e87a8162 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +0,0 @@
|
|||||||
*~
|
|
11
init.lua
11
init.lua
@ -161,7 +161,8 @@ minetest.register_on_placenode(
|
|||||||
|
|
||||||
if not def
|
if not def
|
||||||
or not def.palette
|
or not def.palette
|
||||||
or def.after_place_node then
|
or def.after_place_node
|
||||||
|
or not placer then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -192,6 +193,7 @@ minetest.register_on_placenode(
|
|||||||
-- The complementary function: strip-off the color if the node being dug is still white/neutral
|
-- The complementary function: strip-off the color if the node being dug is still white/neutral
|
||||||
|
|
||||||
local function move_item(item, pos, inv, digger)
|
local function move_item(item, pos, inv, digger)
|
||||||
|
if not (digger and digger:is_player()) then return end
|
||||||
local creative = creative_mode or minetest.check_player_privs(digger, "creative")
|
local creative = creative_mode or minetest.check_player_privs(digger, "creative")
|
||||||
if inv:room_for_item("main", item)
|
if inv:room_for_item("main", item)
|
||||||
and (not creative or not inv:contains_item("main", item, true)) then
|
and (not creative or not inv:contains_item("main", item, true)) then
|
||||||
@ -203,7 +205,7 @@ local function move_item(item, pos, inv, digger)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function unifieddyes.on_dig(pos, node, digger)
|
function unifieddyes.on_dig(pos, node, digger)
|
||||||
|
if not digger then return end
|
||||||
local playername = digger:get_player_name()
|
local playername = digger:get_player_name()
|
||||||
if minetest.is_protected(pos, playername) then
|
if minetest.is_protected(pos, playername) then
|
||||||
minetest.record_protection_violation(pos, playername)
|
minetest.record_protection_violation(pos, playername)
|
||||||
@ -1145,10 +1147,11 @@ minetest.register_tool("unifieddyes:airbrush", {
|
|||||||
|
|
||||||
unifieddyes.player_last_right_clicked[player_name] = {pos = pos, node = node, def = def}
|
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)
|
unifieddyes.show_airbrush_form(placer)
|
||||||
elseif keys.sneak then
|
elseif keys.sneak then
|
||||||
|
|
||||||
if not pos or not def then return end
|
if not pos or not def then return end
|
||||||
local newcolor = unifieddyes.color_to_name(node.param2, def)
|
local newcolor = unifieddyes.color_to_name(node.param2, def)
|
||||||
|
|
||||||
|
1
mod.conf
1
mod.conf
@ -1,3 +1,4 @@
|
|||||||
name = unifieddyes
|
name = unifieddyes
|
||||||
description = Unified Dyes expands the standard dye set from 15 to 90 colors.
|
description = Unified Dyes expands the standard dye set from 15 to 90 colors.
|
||||||
depends = default, dye, basic_materials
|
depends = default, dye, basic_materials
|
||||||
|
min_minetest_version = 5.2.0
|
||||||
|
Reference in New Issue
Block a user