forked from VoxeLibre/VoxeLibre
Compare commits
2 Commits
grass_pale
...
master
Author | SHA1 | Date |
---|---|---|
|
d83c6fe906 | |
|
61ee14b1a6 |
|
@ -226,7 +226,7 @@ if mcl_weather.allow_abm then
|
||||||
}
|
}
|
||||||
for a=1, #around do
|
for a=1, #around do
|
||||||
local apos = vector.add(pos, around[a])
|
local apos = vector.add(pos, around[a])
|
||||||
if mcl_weather.is_outdoor(apos) then
|
if mcl_weather.is_outdoor(apos) and mcl_weather.has_rain(apos) then
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
minetest.sound_play("fire_extinguish_flame", {pos = pos, max_hear_distance = 8, gain = 0.1}, true)
|
minetest.sound_play("fire_extinguish_flame", {pos = pos, max_hear_distance = 8, gain = 0.1}, true)
|
||||||
return
|
return
|
||||||
|
@ -244,7 +244,7 @@ if mcl_weather.allow_abm then
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
-- Rain is equivalent to a water bottle
|
-- Rain is equivalent to a water bottle
|
||||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) and mcl_weather.has_rain(pos) then
|
||||||
if node.name == "mcl_cauldrons:cauldron" then
|
if node.name == "mcl_cauldrons:cauldron" then
|
||||||
minetest.set_node(pos, {name="mcl_cauldrons:cauldron_1"})
|
minetest.set_node(pos, {name="mcl_cauldrons:cauldron_1"})
|
||||||
elseif node.name == "mcl_cauldrons:cauldron_1" then
|
elseif node.name == "mcl_cauldrons:cauldron_1" then
|
||||||
|
@ -267,7 +267,7 @@ if mcl_weather.allow_abm then
|
||||||
interval = 22.0,
|
interval = 22.0,
|
||||||
chance = 3,
|
chance = 3,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) and mcl_weather.has_rain(pos) then
|
||||||
if node.name == "mcl_farming:soil" then
|
if node.name == "mcl_farming:soil" then
|
||||||
minetest.set_node(pos, {name="mcl_farming:soil_wet"})
|
minetest.set_node(pos, {name="mcl_farming:soil_wet"})
|
||||||
end
|
end
|
||||||
|
|
|
@ -1511,7 +1511,7 @@ end
|
||||||
--
|
--
|
||||||
-- The snowable nodes also MUST have _mcl_snowed defined to contain the name
|
-- The snowable nodes also MUST have _mcl_snowed defined to contain the name
|
||||||
-- of the snowed node.
|
-- of the snowed node.
|
||||||
function mcl_core.register_snowed_node(itemstring_snowed, itemstring_clear, tiles, sounds, clear_colorization, desc, grass_palette)
|
function mcl_core.register_snowed_node(itemstring_snowed, itemstring_clear, tiles, sounds, clear_colorization, desc)
|
||||||
local def = table.copy(minetest.registered_nodes[itemstring_clear])
|
local def = table.copy(minetest.registered_nodes[itemstring_clear])
|
||||||
local create_doc_alias
|
local create_doc_alias
|
||||||
if def.description then
|
if def.description then
|
||||||
|
@ -1525,7 +1525,6 @@ function mcl_core.register_snowed_node(itemstring_snowed, itemstring_clear, tile
|
||||||
def._doc_items_usagehelp = nil
|
def._doc_items_usagehelp = nil
|
||||||
def._doc_items_create_entry = false
|
def._doc_items_create_entry = false
|
||||||
def.groups.not_in_creative_inventory = 1
|
def.groups.not_in_creative_inventory = 1
|
||||||
def.groups.grass_palette = grass_palette
|
|
||||||
if def.groups.grass_block == 1 then
|
if def.groups.grass_block == 1 then
|
||||||
def.groups.grass_block_no_snow = nil
|
def.groups.grass_block_no_snow = nil
|
||||||
def.groups.grass_block_snow = 1
|
def.groups.grass_block_snow = 1
|
||||||
|
|
|
@ -380,7 +380,7 @@ minetest.register_node("mcl_core:dirt_with_grass", {
|
||||||
handy = 1, shovely = 1, dirt = 2, grass_block = 1, grass_block_no_snow = 1,
|
handy = 1, shovely = 1, dirt = 2, grass_block = 1, grass_block_no_snow = 1,
|
||||||
soil = 1, soil_sapling = 2, soil_sugarcane = 1, cultivatable = 2,
|
soil = 1, soil_sapling = 2, soil_sugarcane = 1, cultivatable = 2,
|
||||||
spreading_dirt_type = 1, enderman_takable = 1, building_block = 1,
|
spreading_dirt_type = 1, enderman_takable = 1, building_block = 1,
|
||||||
compostability = 30, path_creation_possible = 1, grass_palette = 1
|
compostability = 30, path_creation_possible=1
|
||||||
},
|
},
|
||||||
drop = "mcl_core:dirt",
|
drop = "mcl_core:dirt",
|
||||||
sounds = mcl_sounds.node_sound_dirt_defaults({
|
sounds = mcl_sounds.node_sound_dirt_defaults({
|
||||||
|
@ -401,7 +401,7 @@ minetest.register_node("mcl_core:dirt_with_grass", {
|
||||||
_mcl_hardness = 0.6,
|
_mcl_hardness = 0.6,
|
||||||
_mcl_silk_touch_drop = true,
|
_mcl_silk_touch_drop = true,
|
||||||
})
|
})
|
||||||
mcl_core.register_snowed_node("mcl_core:dirt_with_grass_snow", "mcl_core:dirt_with_grass", nil, nil, true, S("Dirt with Snow"), 1)
|
mcl_core.register_snowed_node("mcl_core:dirt_with_grass_snow", "mcl_core:dirt_with_grass", nil, nil, true, S("Dirt with Snow"))
|
||||||
|
|
||||||
minetest.register_node("mcl_core:grass_path", {
|
minetest.register_node("mcl_core:grass_path", {
|
||||||
tiles = {"mcl_core_grass_path_top.png", "default_dirt.png", "mcl_core_grass_path_side.png"},
|
tiles = {"mcl_core_grass_path_top.png", "default_dirt.png", "mcl_core_grass_path_side.png"},
|
||||||
|
|
|
@ -84,7 +84,7 @@ minetest.register_node("mcl_core:reeds", {
|
||||||
stack_max = 64,
|
stack_max = 64,
|
||||||
groups = {
|
groups = {
|
||||||
dig_immediate = 3, craftitem = 1, deco_block = 1, dig_by_piston = 1,
|
dig_immediate = 3, craftitem = 1, deco_block = 1, dig_by_piston = 1,
|
||||||
plant = 1, non_mycelium_plant = 1, compostability = 50, grass_palette = 1
|
plant = 1, non_mycelium_plant = 1, compostability = 50
|
||||||
},
|
},
|
||||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||||
node_placement_prediction = "",
|
node_placement_prediction = "",
|
||||||
|
|
|
@ -75,13 +75,11 @@ function mcl_flowerpots.register_potted_flower(name, def)
|
||||||
use_texture_alpha = "clip",
|
use_texture_alpha = "clip",
|
||||||
visual_scale = 0.5,
|
visual_scale = 0.5,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = def.paramtype2,
|
|
||||||
palette = def.palette,
|
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
selection_box = pot_box,
|
selection_box = pot_box,
|
||||||
collision_box = pot_box,
|
collision_box = pot_box,
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
groups = { dig_immediate = 3, attached_node = 1, dig_by_piston = 1, not_in_creative_inventory = 1, flower_pot = 2, grass_palette = def.grass_palette_group },
|
groups = { dig_immediate = 3, attached_node = 1, dig_by_piston = 1, not_in_creative_inventory = 1, flower_pot = 2 },
|
||||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||||
on_rightclick = function(pos, item, clicker)
|
on_rightclick = function(pos, item, clicker)
|
||||||
local player_name = clicker:get_player_name()
|
local player_name = clicker:get_player_name()
|
||||||
|
|
|
@ -156,7 +156,7 @@ local def_tallgrass = {
|
||||||
handy = 1, shearsy = 1, attached_node = 1, deco_block = 1,
|
handy = 1, shearsy = 1, attached_node = 1, deco_block = 1,
|
||||||
plant = 1, place_flowerlike = 2, non_mycelium_plant = 1,
|
plant = 1, place_flowerlike = 2, non_mycelium_plant = 1,
|
||||||
flammable = 3, fire_encouragement = 60, fire_flammability = 100,
|
flammable = 3, fire_encouragement = 60, fire_flammability = 100,
|
||||||
dig_by_water = 1, destroy_by_lava_flow = 1, compostability = 30, grass_palette = 1
|
dig_by_water = 1, destroy_by_lava_flow = 1, compostability = 30
|
||||||
},
|
},
|
||||||
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
sounds = mcl_sounds.node_sound_leaves_defaults(),
|
||||||
drop = wheat_seed_drop,
|
drop = wheat_seed_drop,
|
||||||
|
@ -190,7 +190,6 @@ if has_mcl_flowerpots then
|
||||||
name = "fern",
|
name = "fern",
|
||||||
desc = S("Fern"),
|
desc = S("Fern"),
|
||||||
image = "mcl_flowers_fern_inv.png",
|
image = "mcl_flowers_fern_inv.png",
|
||||||
grass_palette_group = 1
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -207,7 +206,7 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
|
||||||
attached_node = 1, deco_block = 1,
|
attached_node = 1, deco_block = 1,
|
||||||
dig_by_water = 1, destroy_by_lava_flow = 1, dig_by_piston = 1,
|
dig_by_water = 1, destroy_by_lava_flow = 1, dig_by_piston = 1,
|
||||||
flammable = 2, fire_encouragement = 60, fire_flammability = 100,
|
flammable = 2, fire_encouragement = 60, fire_flammability = 100,
|
||||||
plant = 1, double_plant = 1, non_mycelium_plant = 1, compostability = 65, grass_palette = nil
|
plant = 1, double_plant = 1, non_mycelium_plant = 1, compostability = 65
|
||||||
}
|
}
|
||||||
if name == "double_grass" then
|
if name == "double_grass" then
|
||||||
bottom_groups.compostability = 50
|
bottom_groups.compostability = 50
|
||||||
|
@ -224,7 +223,6 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
|
||||||
if grass_color then
|
if grass_color then
|
||||||
paramtype2 = "color"
|
paramtype2 = "color"
|
||||||
palette = "mcl_core_palette_grass.png"
|
palette = "mcl_core_palette_grass.png"
|
||||||
bottom_groups.grass_palette = 1
|
|
||||||
end
|
end
|
||||||
if longdesc == nil then
|
if longdesc == nil then
|
||||||
bottom_groups.not_in_creative_inventory = 1
|
bottom_groups.not_in_creative_inventory = 1
|
||||||
|
|
|
@ -345,13 +345,15 @@ local function world_structure(vm, data, data2, emin, emax, area, minp, maxp, bl
|
||||||
return lvm_used, lvm_used, deco, ores
|
return lvm_used, lvm_used, deco, ores
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local affected_grass_blocks = {"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass", "mcl_flowers:double_grass", "mcl_flowers:double_grass_top", "mcl_flowers:fern", "mcl_flowers:double_fern", "mcl_flowers:double_fern_top", "mcl_core:reeds", "mcl_core:dirt_with_grass_snow"}
|
||||||
|
|
||||||
local function block_fixes_grass(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
|
local function block_fixes_grass(vm, data, data2, emin, emax, area, minp, maxp, blockseed)
|
||||||
local biomemap = minetest.get_mapgen_object("biomemap")
|
local biomemap = minetest.get_mapgen_object("biomemap")
|
||||||
local lvm_used = false
|
local lvm_used = false
|
||||||
local pr = PseudoRandom(blockseed)
|
local pr = PseudoRandom(blockseed)
|
||||||
if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then
|
if minp.y <= mcl_vars.mg_overworld_max and maxp.y >= mcl_vars.mg_overworld_min then
|
||||||
-- Set param2 (=color) of nodes which use the grass colour palette.
|
-- Set param2 (=color) of nodes which use the grass colour palette.
|
||||||
lvm_used = set_grass_palette(minp,maxp,data2,area,biomemap,{"group:grass_palette"})
|
lvm_used = set_grass_palette(minp,maxp,data2,area,biomemap,affected_grass_blocks)
|
||||||
end
|
end
|
||||||
return lvm_used
|
return lvm_used
|
||||||
end
|
end
|
||||||
|
@ -422,7 +424,7 @@ end, 100, true)
|
||||||
minetest.register_lbm({
|
minetest.register_lbm({
|
||||||
label = "Fix grass palette indexes", -- This LBM fixes any incorrect grass palette indexes.
|
label = "Fix grass palette indexes", -- This LBM fixes any incorrect grass palette indexes.
|
||||||
name = "mcl_mapgen_core:fix_grass_palette_indexes",
|
name = "mcl_mapgen_core:fix_grass_palette_indexes",
|
||||||
nodenames = {"group:grass_palette"},
|
nodenames = affected_grass_blocks,
|
||||||
run_at_every_load = false,
|
run_at_every_load = false,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
local grass_palette_index = mcl_util.get_palette_indexes_from_pos(pos).grass_palette_index
|
local grass_palette_index = mcl_util.get_palette_indexes_from_pos(pos).grass_palette_index
|
||||||
|
|
Loading…
Reference in New Issue