From 3b78a223717c69918a5af422e21561f47ec74ce1 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 30 Mar 2021 01:25:11 +0300 Subject: Degrotate support for mesh nodes (#7840) --- builtin/game/item.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'builtin/game/item.lua') 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) -- cgit v1.2.3