From dff88c70b309f13463f5f35d91c3d714fcff9e9e Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 7 Jan 2018 23:43:23 +0100 Subject: [PATCH] Optimize top snow level 8 rendering --- mods/ITEMS/mcl_core/nodes_base.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 9bf82dfcef..d37a4acd08 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -879,7 +879,7 @@ for i=0,3 do end for i=1,8 do - local id, desc, longdesc, usagehelp, help, walkable + local id, desc, longdesc, usagehelp, help, walkable, drawtype, node_box if i == 1 then id = "mcl_core:snow" desc = "Top Snow" @@ -894,6 +894,13 @@ for i=1,8 do end walkable = true end + if i ~= 8 then + drawtype = "nodebox" + node_box = { + type = "fixed", + fixed = { -0.5, -0.5, -0.5, 0.5, -0.5 + (2*i)/16, 0.5 }, + } + end local on_place = function(itemstack, placer, pointed_thing) -- Placement is only allowed on top of solid blocks if pointed_thing.type ~= "node" then @@ -962,7 +969,7 @@ for i=1,8 do sunlight_propagates = true, buildable_to = true, node_placement_prediction = "", -- to prevent client flickering when stacking snow - drawtype = "nodebox", + drawtype = drawtype, stack_max = 64, walkable = walkable, floodable = true, @@ -971,12 +978,7 @@ for i=1,8 do local node = minetest.get_node(npos) mcl_core.clear_snow_dirt(npos, node) end, - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.5+(i*2)/16, 0.5}, - }, - }, + node_box = node_box, groups = {shovely=1, attached_node=1,deco_block=1, dig_by_piston=1, snow_cover=1, top_snow=i}, sounds = mcl_sounds.node_sound_snow_defaults(), on_construct = mcl_core.on_snow_construct,