mirror of
https://github.com/mt-mods/unifieddyes.git
synced 2024-11-22 07:23:48 +01:00
more strict checking of need to reset param2 on place
fixes wood (coloredwood mod), stone (blox mod), bricks (unified bricks mod), etc. being rotated wrong
This commit is contained in:
parent
368205d3b8
commit
545968517b
17
init.lua
17
init.lua
@ -172,20 +172,25 @@ minetest.register_on_placenode(
|
||||
end
|
||||
|
||||
if not string.find(itemstack:to_string(), "palette_index") then
|
||||
local param2 = 0
|
||||
local param2
|
||||
local color = 0
|
||||
|
||||
if def.palette == "unifieddyes_palette_extended.png" then
|
||||
if def.palette == "unifieddyes_palette_extended.png"
|
||||
and def.paramtype2 == "color" then
|
||||
param2 = 240
|
||||
color = 240
|
||||
elseif def.palette == "unifieddyes_palette_colorwallmounted.png" then
|
||||
elseif def.palette == "unifieddyes_palette_colorwallmounted.png"
|
||||
and def.paramtype2 == "colorwallmounted" then
|
||||
param2 = newnode.param2 % 8
|
||||
else -- it's a split palette
|
||||
elseif string.find(def.palette, "unifieddyes_palette_")
|
||||
and def.paramtype2 == "colorfacedir" then -- it's a split palette
|
||||
param2 = newnode.param2 % 32
|
||||
end
|
||||
|
||||
minetest.swap_node(pos, {name = newnode.name, param2 = param2})
|
||||
minetest.get_meta(pos):set_int("palette_index", color)
|
||||
if param2 then
|
||||
minetest.swap_node(pos, {name = newnode.name, param2 = param2})
|
||||
minetest.get_meta(pos):set_int("palette_index", color)
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user