From 6eed06f7fc01deaf35235d1971bde5858ff4d91d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 1 Apr 2017 06:51:55 +0200 Subject: [PATCH] Add equivalence code for the snowy dirt blocks --- mods/ITEMS/mcl_core/functions.lua | 11 +++++++---- mods/ITEMS/mcl_core/nodes.lua | 7 ++++--- mods/ITEMS/mcl_dye/init.lua | 4 ++-- mods/ITEMS/mcl_farming/shared_functions.lua | 2 +- mods/ITEMS/mcl_mushrooms/small.lua | 2 +- mods/ITEMS/mcl_tools/init.lua | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index 831168cb6..d852df19f 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -261,14 +261,17 @@ function mcl_core.generate_tree(pos, trunk, leaves, typearbre) for dz=0,1 do pos.z = pos.z + dz --> 0 - if minetest.get_node(pos).name == "mcl_core:dirt_with_grass" - or minetest.get_node(pos).name == "mcl_core:dirt" then else + local name = minetest.get_node(pos).name + if name == "mcl_core:dirt_with_grass" + or name == "mcl_core:dirt_with_grass_snow" + or name == "mcl_core:dirt" then else return end pos.x = pos.x+1 --> 1 - if minetest.get_node(pos).name == "mcl_core:dirt_with_grass" - or minetest.get_node(pos).name == "mcl_core:dirt" then else + if name == "mcl_core:dirt_with_grass" + or name == "mcl_core:dirt_with_grass_snow" + or name == "mcl_core:dirt" then else return end pos.x = pos.x-1 diff --git a/mods/ITEMS/mcl_core/nodes.lua b/mods/ITEMS/mcl_core/nodes.lua index 6c37f72fd..28a434b5b 100644 --- a/mods/ITEMS/mcl_core/nodes.lua +++ b/mods/ITEMS/mcl_core/nodes.lua @@ -375,7 +375,7 @@ minetest.register_node("mcl_core:dirt_with_grass", { _mcl_hardness = 0.6, }) - +-- NOTE: This block is to be considered equivalent to the grass block minetest.register_node("mcl_core:dirt_with_grass_snow", { description = "Snowy Grass Block", _doc_items_create_entry = false, @@ -428,6 +428,7 @@ minetest.register_node("mcl_core:mycelium", { _mcl_hardness = 0.6, }) +-- NOTE: This block is to be considered equivalent to mycelium minetest.register_node("mcl_core:mycelium_snow", { description = "Snowy Mycelium", _doc_items_create_entry = false, @@ -455,6 +456,7 @@ minetest.register_node("mcl_core:podzol", { _mcl_hardness = 0.6, }) +-- NOTE: This block is to be considered equivalent to podzol minetest.register_node("mcl_core:podzol_snow", { description = "Snowy Podzol", _doc_items_create_entry = false, @@ -463,12 +465,11 @@ minetest.register_node("mcl_core:podzol_snow", { stack_max = 64, groups = {handy=1,shovely=3, soil=1, soil_sapling=2, soil_sugarcane=1, building_block=1, not_in_creative_inventory=1}, drop = 'mcl_core:dirt', - sounds = mcl_sounds.node_sound_dirt_defaults(), + sounds = mcl_sounds.node_sound_snow_defaults(), _mcl_blast_resistance = 2.5, _mcl_hardness = 0.6, }) - minetest.register_node("mcl_core:dirt", { description = "Dirt", _doc_items_longdesc = "Dirt acts as a soil for a few plants. When in light, it will turn into a grass block eventually.", diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index 886cc18e9..a02b7f0a2 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -158,7 +158,7 @@ mcl_dye.apply_bone_meal = function(pointed_thing) -- Cocoa: Advance by 1 stage mcl_cocoas.grow(pos) return true - elseif n.name == "mcl_core:dirt_with_grass" then + elseif n.name == "mcl_core:dirt_with_grass" or n.name == "mcl_core:dirt_with_grass_snow" then -- Grass Block: Generate tall grass and random flowers all over the place for i = -2, 3, 1 do for j = -3, 2, 1 do @@ -167,7 +167,7 @@ mcl_dye.apply_bone_meal = function(pointed_thing) n = minetest.get_node(pos) n2 = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) - if n.name ~= "" and n.name == "air" and n2.name == "mcl_core:dirt_with_grass" then + if n.name ~= "" and n.name == "air" and (n2.name == "mcl_core:dirt_with_grass" or n2.name == "mcl_core:dirt_with_grass_snow") then if math.random(0,5) > 3 then minetest.add_node(pos, {name=plant_tab[math.random(1, #plant_tab)]}) else diff --git a/mods/ITEMS/mcl_farming/shared_functions.lua b/mods/ITEMS/mcl_farming/shared_functions.lua index 12e661950..cb88b17c0 100644 --- a/mods/ITEMS/mcl_farming/shared_functions.lua +++ b/mods/ITEMS/mcl_farming/shared_functions.lua @@ -310,7 +310,7 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s local floor = minetest.get_node(floorpos) local block = minetest.get_node(blockpos) local soilgroup = minetest.get_item_group(floor.name, "soil") - if not ((floor.name=="mcl_core:dirt_with_grass" or floor.name=="mcl_core:dirt" or soilgroup == 2 or soilgroup == 3) and block.name == "air") then + if not ((floor.name=="mcl_core:dirt_with_grass" or floor.name=="mcl_core:dirt_with_grass_snow" or floor.name=="mcl_core:dirt" or soilgroup == 2 or soilgroup == 3) and block.name == "air") then table.remove(neighbors, n) end end diff --git a/mods/ITEMS/mcl_mushrooms/small.lua b/mods/ITEMS/mcl_mushrooms/small.lua index 4becfd2d6..bb49bd392 100644 --- a/mods/ITEMS/mcl_mushrooms/small.lua +++ b/mods/ITEMS/mcl_mushrooms/small.lua @@ -42,7 +42,7 @@ local on_place = function(itemstack, placer, pointed_thing) if light and light <= 12 then light_ok = true end - if (soil_node.name == "mcl_core:podzol" or soil_node.name == "mcl_core:mycelium") or + if (soil_node.name == "mcl_core:podzol" or soil_node.name == "mcl_core:podzol_snow" or soil_node.name == "mcl_core:mycelium" or soil_node == "mcl_core:mycelium_snow") or (light_ok and (soil_def.groups and soil_def.groups.solid and soil_def.groups.opaque)) then local idef = itemstack:get_definition() local success = minetest.item_place_node(itemstack, placer, pointed_thing) diff --git a/mods/ITEMS/mcl_tools/init.lua b/mods/ITEMS/mcl_tools/init.lua index 0697baf09..dfa6a5a4f 100644 --- a/mods/ITEMS/mcl_tools/init.lua +++ b/mods/ITEMS/mcl_tools/init.lua @@ -166,7 +166,7 @@ local make_grass_path = function(itemstack, placer, pointed_thing) end end - if node.name == "mcl_core:dirt_with_grass" and pointed_thing.above.y == pointed_thing.under.y then + if (node.name == "mcl_core:dirt_with_grass" or node.name == "mcl_core:dirt_with_grass_snow") and pointed_thing.above.y == pointed_thing.under.y then local above = table.copy(pointed_thing.under) above.y = above.y + 1 if minetest.get_node(above).name == "air" then