Add equivalence code for the snowy dirt blocks

This commit is contained in:
Wuzzy 2017-04-01 06:51:55 +02:00
parent a4eba91c1e
commit 6eed06f7fc
6 changed files with 16 additions and 12 deletions

@ -261,14 +261,17 @@ function mcl_core.generate_tree(pos, trunk, leaves, typearbre)
for dz=0,1 do for dz=0,1 do
pos.z = pos.z + dz pos.z = pos.z + dz
--> 0 --> 0
if minetest.get_node(pos).name == "mcl_core:dirt_with_grass" local name = minetest.get_node(pos).name
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 return
end end
pos.x = pos.x+1 pos.x = pos.x+1
--> 1 --> 1
if minetest.get_node(pos).name == "mcl_core:dirt_with_grass" if name == "mcl_core:dirt_with_grass"
or minetest.get_node(pos).name == "mcl_core:dirt" then else or name == "mcl_core:dirt_with_grass_snow"
or name == "mcl_core:dirt" then else
return return
end end
pos.x = pos.x-1 pos.x = pos.x-1

@ -375,7 +375,7 @@ minetest.register_node("mcl_core:dirt_with_grass", {
_mcl_hardness = 0.6, _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", { minetest.register_node("mcl_core:dirt_with_grass_snow", {
description = "Snowy Grass Block", description = "Snowy Grass Block",
_doc_items_create_entry = false, _doc_items_create_entry = false,
@ -428,6 +428,7 @@ minetest.register_node("mcl_core:mycelium", {
_mcl_hardness = 0.6, _mcl_hardness = 0.6,
}) })
-- NOTE: This block is to be considered equivalent to mycelium
minetest.register_node("mcl_core:mycelium_snow", { minetest.register_node("mcl_core:mycelium_snow", {
description = "Snowy Mycelium", description = "Snowy Mycelium",
_doc_items_create_entry = false, _doc_items_create_entry = false,
@ -455,6 +456,7 @@ minetest.register_node("mcl_core:podzol", {
_mcl_hardness = 0.6, _mcl_hardness = 0.6,
}) })
-- NOTE: This block is to be considered equivalent to podzol
minetest.register_node("mcl_core:podzol_snow", { minetest.register_node("mcl_core:podzol_snow", {
description = "Snowy Podzol", description = "Snowy Podzol",
_doc_items_create_entry = false, _doc_items_create_entry = false,
@ -463,12 +465,11 @@ minetest.register_node("mcl_core:podzol_snow", {
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=3, soil=1, soil_sapling=2, soil_sugarcane=1, building_block=1, not_in_creative_inventory=1}, 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', drop = 'mcl_core:dirt',
sounds = mcl_sounds.node_sound_dirt_defaults(), sounds = mcl_sounds.node_sound_snow_defaults(),
_mcl_blast_resistance = 2.5, _mcl_blast_resistance = 2.5,
_mcl_hardness = 0.6, _mcl_hardness = 0.6,
}) })
minetest.register_node("mcl_core:dirt", { minetest.register_node("mcl_core:dirt", {
description = "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.", _doc_items_longdesc = "Dirt acts as a soil for a few plants. When in light, it will turn into a grass block eventually.",

@ -158,7 +158,7 @@ mcl_dye.apply_bone_meal = function(pointed_thing)
-- Cocoa: Advance by 1 stage -- Cocoa: Advance by 1 stage
mcl_cocoas.grow(pos) mcl_cocoas.grow(pos)
return true 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 -- Grass Block: Generate tall grass and random flowers all over the place
for i = -2, 3, 1 do for i = -2, 3, 1 do
for j = -3, 2, 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) n = minetest.get_node(pos)
n2 = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) 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 if math.random(0,5) > 3 then
minetest.add_node(pos, {name=plant_tab[math.random(1, #plant_tab)]}) minetest.add_node(pos, {name=plant_tab[math.random(1, #plant_tab)]})
else else

@ -310,7 +310,7 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
local floor = minetest.get_node(floorpos) local floor = minetest.get_node(floorpos)
local block = minetest.get_node(blockpos) local block = minetest.get_node(blockpos)
local soilgroup = minetest.get_item_group(floor.name, "soil") 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) table.remove(neighbors, n)
end end
end end

@ -42,7 +42,7 @@ local on_place = function(itemstack, placer, pointed_thing)
if light and light <= 12 then if light and light <= 12 then
light_ok = true light_ok = true
end 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 (light_ok and (soil_def.groups and soil_def.groups.solid and soil_def.groups.opaque)) then
local idef = itemstack:get_definition() local idef = itemstack:get_definition()
local success = minetest.item_place_node(itemstack, placer, pointed_thing) local success = minetest.item_place_node(itemstack, placer, pointed_thing)

@ -166,7 +166,7 @@ local make_grass_path = function(itemstack, placer, pointed_thing)
end end
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) local above = table.copy(pointed_thing.under)
above.y = above.y + 1 above.y = above.y + 1
if minetest.get_node(above).name == "air" then if minetest.get_node(above).name == "air" then