mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-25 10:52:25 +01:00
Add equivalence code for the snowy dirt blocks
This commit is contained in:
parent
a4eba91c1e
commit
6eed06f7fc
@ -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
|
||||
|
@ -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.",
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user