diff options
author | Vitaliy <numzer0@yandex.ru> | 2021-03-30 01:25:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-30 00:25:11 +0200 |
commit | 3b78a223717c69918a5af422e21561f47ec74ce1 (patch) | |
tree | aafa2961a6faafc58a2712dfcc277e662d149382 /builtin/game | |
parent | fde2785fe363c55e8acfd17af71375a231df41c1 (diff) | |
download | minetest-3b78a223717c69918a5af422e21561f47ec74ce1.tar.gz minetest-3b78a223717c69918a5af422e21561f47ec74ce1.tar.bz2 minetest-3b78a223717c69918a5af422e21561f47ec74ce1.zip |
Degrotate support for mesh nodes (#7840)
Diffstat (limited to 'builtin/game')
-rw-r--r-- | builtin/game/item.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/game/item.lua b/builtin/game/item.lua index b68177c22..17746e9a8 100644 --- a/builtin/game/item.lua +++ b/builtin/game/item.lua @@ -157,7 +157,7 @@ end function core.is_colored_paramtype(ptype) return (ptype == "color") or (ptype == "colorfacedir") or - (ptype == "colorwallmounted") + (ptype == "colorwallmounted") or (ptype == "colordegrotate") end function core.strip_param2_color(param2, paramtype2) @@ -168,6 +168,8 @@ function core.strip_param2_color(param2, paramtype2) param2 = math.floor(param2 / 32) * 32 elseif paramtype2 == "colorwallmounted" then param2 = math.floor(param2 / 8) * 8 + elseif paramtype2 == "colordegrotate" then + param2 = math.floor(param2 / 32) * 32 end -- paramtype2 == "color" requires no modification. return param2 @@ -345,6 +347,8 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2, color_divisor = 8 elseif def.paramtype2 == "colorfacedir" then color_divisor = 32 + elseif def.paramtype2 == "colordegrotate" then + color_divisor = 32 end if color_divisor then local color = math.floor(metatable.palette_index / color_divisor) |