From 325801efd7aed7ebf239f605170a31191e5055c3 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 13 Dec 2019 14:03:12 +0100 Subject: [PATCH] First step towards param2-based grass color --- mods/ITEMS/mcl_core/functions.lua | 12 +++++-- mods/ITEMS/mcl_core/nodes_base.lua | 33 ++++-------------- .../ITEMS/mcl_core/textures/default_grass.png | Bin 428 -> 0 bytes .../mcl_core/textures/default_grass_side.png | Bin 423 -> 0 bytes .../mcl_core_grass_block_side_overlay.png | Bin 0 -> 394 bytes .../textures/mcl_core_grass_block_top.png | Bin 0 -> 393 bytes mods/MAPGEN/mcl_biomes/init.lua | 28 +++++++-------- 7 files changed, 30 insertions(+), 43 deletions(-) delete mode 100644 mods/ITEMS/mcl_core/textures/default_grass.png delete mode 100644 mods/ITEMS/mcl_core/textures/default_grass_side.png create mode 100644 mods/ITEMS/mcl_core/textures/mcl_core_grass_block_side_overlay.png create mode 100644 mods/ITEMS/mcl_core/textures/mcl_core_grass_block_top.png diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 9eec03d0..0d08c340 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -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 } diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index 75df8e5e..eb56b379 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -312,7 +312,12 @@ minetest.register_node("mcl_core:dirt_with_grass", { description = S("Grass Block"), _doc_items_longdesc = S("A grass block is dirt with a grass cover. Grass blocks are resourceful blocks which allow the growth of all sorts of plants. They can be turned into farmland with a hoe and turned into grass paths with a shovel. In light, the grass slowly spreads onto dirt nearby. Under an opaque block or a liquid, a grass block may turn back to dirt."), _doc_items_hidden = false, - tiles = {"default_grass.png", "default_dirt.png", {name="default_dirt.png^default_grass_side.png", tileable_vertical=false}}, + paramtype2 = "color", + tiles = {"mcl_core_grass_block_top.png", { name="default_dirt.png", color="white" }}, + overlay_tiles = {"mcl_core_grass_block_top.png", "", {name="mcl_core_grass_block_side_overlay.png", tileable_vertical=false}}, + palette = "mcl_core_palette_grass.png", + palette_index = 0, + color = "#5ac557", is_ground_content = true, stack_max = 64, groups = {handy=1,shovely=1,dirt=2,grass_block=1, grass_block_no_snow=1, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, spreading_dirt_type=1, enderman_takable=1, building_block=1}, @@ -332,31 +337,7 @@ minetest.register_node("mcl_core:dirt_with_grass", { _mcl_blast_resistance = 3, _mcl_hardness = 0.6, }) -mcl_core.register_snowed_node("mcl_core:dirt_with_grass_snow", "mcl_core:dirt_with_grass") - --- Grass Block variant for dry biomes -minetest.register_node("mcl_core:dirt_with_dry_grass", { - _doc_items_create_entry = false, - tiles = {"default_dry_grass.png", "default_dirt.png", {name="default_dirt.png^default_dry_grass_side.png", tileable_vertical=false}}, - is_ground_content = true, - stack_max = 64, - groups = {handy=1,shovely=1, dirt=2,grass_block=1, grass_block_no_snow=1, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, spreading_dirt_type=1, enderman_takable=1, building_block=1, not_in_creative_inventory=1}, - drop = 'mcl_core:dirt', - sounds = mcl_sounds.node_sound_dirt_defaults({ - footstep = {name="default_grass_footstep", gain=0.4}, - }), - on_construct = mcl_core.on_snowable_construct, - _mcl_snowed = "mcl_core:dirt_with_dry_grass_snow", - _mcl_grass_palette_index = 1, - _mcl_blast_resistance = 3, - _mcl_hardness = 0.6, -}) -mcl_core.register_snowed_node("mcl_core:dirt_with_dry_grass_snow", "mcl_core:dirt_with_dry_grass") - -if minetest.get_modpath("doc") then - doc.add_entry_alias("nodes", "mcl_core:dirt_with_grass", "nodes", "mcl_core:dirt_with_dry_grass") - doc.add_entry_alias("nodes", "mcl_core:dirt_with_grass", "nodes", "mcl_core:dirt_with_dry_grass_snow") -end +mcl_core.register_snowed_node("mcl_core:dirt_with_grass_snow", "mcl_core:dirt_with_grass", nil, nil, true) minetest.register_node("mcl_core:grass_path", { tiles = {"mcl_core_grass_path_top.png", "default_dirt.png", "mcl_core_grass_path_side.png"}, diff --git a/mods/ITEMS/mcl_core/textures/default_grass.png b/mods/ITEMS/mcl_core/textures/default_grass.png deleted file mode 100644 index dd57bb1ce169daf7c0464f2cb9fcab335b7d5f6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 428 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd7G?$phPQVgfdp969eo`c7&i8E|4C$JU|>*4 z_6YK2V5m}KU}$JzVEDzrz|io5fuYoZf#FpG1B2BJ1_tqhIlBUF7#JA%1AIbUwf!}8 zVhr@N&D7kL{{R1f>ek**3=9m6N#5=*Ed3cb0~r_?I14-?iy0XB_JS~@`|k;B85kJY zOFVsD*&p+8GiXS?JM}Myfq@~>)5S4_*4 z_6YK2V5m}KU}$JzVEDzrz|io5fuYoZf#FpG1B2BJ1_tqhIlBUF7#J8t1AIbU85kIJ zVhr@N&9wbBOe$?u?B)Oe|G&03y@i2+fw3gWFPOpM*^M+1C&}C0g)K2{M=b*b180Fp zWHAE+-vJP2%(~Xe$-uzCUgGKN%Kn&#n?XbB-Kl>u3=9mOo-U3d9M{(#j23NB5MVvv z%_7FTL7b_gfcwPb_=*1_ukf8auzJs4rAvK6s!hw5N|tX}#qzlI%FNPh4Qut4d#5to zx%b84L^zswJ)wB`Jv|saDBFsfi`23`Pcqmb!*Ux`u`!1_o9p z23AI9+6D$z1_rgt*6UF;Fdh=n1`3gQjl%Kq8bJUMsZIU#}JFtZzpW@ zI^rPEwqGWEiHE}Js)P+fha9=A6(^)`5IA`1+_7W-)|@l9$d*5FO?`u%Z@vL?5JE~p6R36#Z5c41h{&>-FNWOeFx z-)@mYs|Tj1l#+GsggM;S?anFa>N|euZPu-`|Gw<7UFfN_PT!w*?Vgp_ZUmJu|E;fB zpVeitRL98YWkRK0ThOb?dvDLS{wlVAgSq7aUMGf6SA|Z0uB@$l^zY-r9ag&o+|{2i xnDXn}*>vu$tG_L6o}X|;|D*l~aTYsU|?Wi@O1TaS?83{1OPGzrYHaa literal 0 HcmV?d00001 diff --git a/mods/ITEMS/mcl_core/textures/mcl_core_grass_block_top.png b/mods/ITEMS/mcl_core/textures/mcl_core_grass_block_top.png new file mode 100644 index 0000000000000000000000000000000000000000..7a3a22ffceb6e5f5db74db14f1df3d814446937c GIT binary patch literal 393 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4kiW$h6xih%orFL*pj^6T^JrS{AYOj`sfV;)`}OTO+M>pK}37{xqY978nDrv@4J z9aa#y<18Y^C3HfxXm;DPU%xN>eK70yf@*VDhbk3w0LnbUQlz+Uh^Ol0Ozz>{nIwO!YndqV1w*sKenGQR~-+ zv+^o^3f^*TWBax2xM#Ji1eY30ad< zvrf(0!hhp@X2ar?-mM1DY8$Qx&kbLcVl9&`<5L`Hw{+6aM7iLvn-$sJ_fEEO&0${s w-+YVDxxh_d8cyuFbSmfPrR5>at*7Ku4y`$+&nmE(fq{X+)78&qol`;+0JU1BPXGV_ literal 0 HcmV?d00001 diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 3727dfcf..22331dd0 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -919,7 +919,7 @@ local function register_biomes() -- Strata don't generate here. minetest.register_biome({ name = "MesaPlateauF_grasstop", - node_top = "mcl_core:dirt_with_dry_grass", + node_top = "mcl_core:dirt_with_grass", depth_top = 1, node_filler = "mcl_core:dirt", depth_filler = 1, @@ -985,7 +985,7 @@ local function register_biomes() -- Grass plateau minetest.register_biome({ name = "MesaPlateauFM_grasstop", - node_top = "mcl_core:dirt_with_dry_grass", + node_top = "mcl_core:dirt_with_grass", depth_top = 1, node_filler = "mcl_core:coarse_dirt", depth_filler = 2, @@ -1035,7 +1035,7 @@ local function register_biomes() -- Savanna minetest.register_biome({ name = "Savanna", - node_top = "mcl_core:dirt_with_dry_grass", + node_top = "mcl_core:dirt_with_grass", depth_top = 1, node_filler = "mcl_core:dirt", depth_filler = 2, @@ -1081,7 +1081,7 @@ local function register_biomes() -- Otherwise identical to Savanna minetest.register_biome({ name = "SavannaM", - node_top = "mcl_core:dirt_with_dry_grass", + node_top = "mcl_core:dirt_with_grass", depth_top = 1, node_filler = "mcl_core:coarse_dirt", depth_filler = 3, @@ -1514,7 +1514,7 @@ local function register_biomelike_ores() minetest.register_ore({ ore_type = "sheet", ore = "mcl_core:coarse_dirt", - wherein = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt"}, + wherein = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, column_height_max = 1, column_midpoint_factor = 0.0, y_min = mcl_vars.mg_overworld_min, @@ -1526,7 +1526,7 @@ local function register_biomelike_ores() minetest.register_ore({ ore_type = "blob", ore = "mcl_core:coarse_dirt", - wherein = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt"}, + wherein = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, clust_scarcity = 1500, clust_num_ores = 25, clust_size = 7, @@ -1537,7 +1537,7 @@ local function register_biomelike_ores() minetest.register_ore({ ore_type = "sheet", ore = "mcl_core:coarse_dirt", - wherein = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt"}, + wherein = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, column_height_max = 1, column_midpoint_factor = 0.0, y_min = mcl_vars.mg_overworld_min, @@ -1549,7 +1549,7 @@ local function register_biomelike_ores() minetest.register_ore({ ore_type = "blob", ore = "mcl_core:coarse_dirt", - wherein = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt"}, + wherein = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, clust_scarcity = 1800, clust_num_ores = 65, clust_size = 15, @@ -2251,7 +2251,7 @@ local function register_decorations() }) minetest.register_decoration({ deco_type = "schematic", - place_on = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt"}, + place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.015, @@ -2270,7 +2270,7 @@ local function register_decorations() }) minetest.register_decoration({ deco_type = "schematic", - place_on = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt"}, + place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt"}, sidelen = 16, noise_params = { offset = 0.008, @@ -2565,7 +2565,7 @@ local function register_decorations() for a=1, 7 do minetest.register_decoration({ deco_type = "schematic", - place_on = {"mcl_core:dirt_with_dry_grass", "mcl_core:dirt", "mcl_core:coarse_dirt"}, + place_on = {"mcl_core:dirt_with_grass", "mcl_core:dirt", "mcl_core:coarse_dirt"}, sidelen = 16, fill_ratio = 0.0002, biomes = {"Savanna", "SavannaM"}, @@ -2872,7 +2872,7 @@ local function register_decorations() num_spawn_by = 1, }) - local dry_index = minetest.registered_nodes["mcl_core:dirt_with_dry_grass"]._mcl_grass_palette_index + local dry_index = minetest.registered_nodes["mcl_core:dirt_with_grass"]._mcl_grass_palette_index -- Doubletall grass local register_doubletall_grass = function(offset, scale, biomes, param2) @@ -3435,7 +3435,7 @@ local function register_decorations() -- Dead bushes minetest.register_decoration({ deco_type = "simple", - place_on = {"group:sand", "mcl_core:podzol", "mcl_core:dirt", "mcl_core:dirt_with_dry_grass", "mcl_core:coarse_dirt", "group:hardened_clay"}, + place_on = {"group:sand", "mcl_core:podzol", "mcl_core:dirt", "mcl_core:dirt_with_grass", "mcl_core:coarse_dirt", "group:hardened_clay"}, sidelen = 16, noise_params = { offset = 0.0, @@ -3453,7 +3453,7 @@ local function register_decorations() }) minetest.register_decoration({ deco_type = "simple", - place_on = {"group:sand", "mcl_core:dirt", "mcl_core:dirt_with_dry_grass", "mcl_core:coarse_dirt"}, + place_on = {"group:sand", "mcl_core:dirt", "mcl_core:dirt_with_grass", "mcl_core:coarse_dirt"}, sidelen = 16, noise_params = { offset = 0.1,