First step towards param2-based grass color

This commit is contained in:
Wuzzy 2019-12-13 14:03:12 +01:00
parent 8e224d0bd9
commit 325801efd7
7 changed files with 30 additions and 43 deletions

View file

@ -653,9 +653,9 @@ function mcl_core.get_grass_block_type(pos)
end
end
if dry then
return {name="mcl_core:dirt_with_dry_grass"}
return {name="mcl_core:dirt_with_grass", param2=1}
else
return {name="mcl_core:dirt_with_grass"}
return {name="mcl_core:dirt_with_grass", param2=0}
end
end
@ -1232,10 +1232,11 @@ end
-- * itemstring_clear: Itemstring of the original “clear” node without snow
-- * tiles: Optional custom tiles
-- * sounds: Optional custom sounds
-- * clear_colorization: Optional. If true, will clear all paramtype2="color" related node def. fields
--
-- The snowable nodes also MUST have _mcl_snowed defined to contain the name
-- of the snowed node.
mcl_core.register_snowed_node = function(itemstring_snowed, itemstring_clear, tiles, sounds)
mcl_core.register_snowed_node = function(itemstring_snowed, itemstring_clear, tiles, sounds, clear_colorization)
local def = table.copy(minetest.registered_nodes[itemstring_clear])
local create_doc_alias
if def.description then
@ -1270,6 +1271,11 @@ mcl_core.register_snowed_node = function(itemstring_snowed, itemstring_clear, ti
else
def.tiles = tiles
end
if clear_colorization then
def.paramtype2 = nil
def.color = nil
def.overlay_tiles = nil
end
if not sounds then
def.sounds = mcl_sounds.node_sound_dirt_defaults({
footstep = { name = "pedology_snow_soft_footstep", gain = 0.5 }