Add grass palette nodes in a special group

This commit adds any nodes which make use of a grass palette to a `grass_palette` group, to avoid having to create a list of said nodes every time.
This commit is contained in:
FossFanatic 2023-02-24 13:52:04 +00:00 committed by Gitea
parent 22e7200ea0
commit e82ff4781a
3 changed files with 5 additions and 4 deletions

View File

@ -1511,7 +1511,7 @@ end
--
-- The snowable nodes also MUST have _mcl_snowed defined to contain the name
-- of the snowed node.
function mcl_core.register_snowed_node(itemstring_snowed, itemstring_clear, tiles, sounds, clear_colorization, desc)
function mcl_core.register_snowed_node(itemstring_snowed, itemstring_clear, tiles, sounds, clear_colorization, desc, grass_palette)
local def = table.copy(minetest.registered_nodes[itemstring_clear])
local create_doc_alias
if def.description then
@ -1525,6 +1525,7 @@ function mcl_core.register_snowed_node(itemstring_snowed, itemstring_clear, tile
def._doc_items_usagehelp = nil
def._doc_items_create_entry = false
def.groups.not_in_creative_inventory = 1
def.groups.grass_palette = grass_palette
if def.groups.grass_block == 1 then
def.groups.grass_block_no_snow = nil
def.groups.grass_block_snow = 1

View File

@ -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,
soil = 1, soil_sapling = 2, soil_sugarcane = 1, cultivatable = 2,
spreading_dirt_type = 1, enderman_takable = 1, building_block = 1,
compostability = 30, path_creation_possible=1
compostability = 30, path_creation_possible = 1, grass_palette = 1
},
drop = "mcl_core:dirt",
sounds = mcl_sounds.node_sound_dirt_defaults({
@ -401,7 +401,7 @@ minetest.register_node("mcl_core:dirt_with_grass", {
_mcl_hardness = 0.6,
_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"))
mcl_core.register_snowed_node("mcl_core:dirt_with_grass_snow", "mcl_core:dirt_with_grass", nil, nil, true, S("Dirt with Snow"), 1)
minetest.register_node("mcl_core:grass_path", {
tiles = {"mcl_core_grass_path_top.png", "default_dirt.png", "mcl_core_grass_path_side.png"},

View File

@ -84,7 +84,7 @@ minetest.register_node("mcl_core:reeds", {
stack_max = 64,
groups = {
dig_immediate = 3, craftitem = 1, deco_block = 1, dig_by_piston = 1,
plant = 1, non_mycelium_plant = 1, compostability = 50
plant = 1, non_mycelium_plant = 1, compostability = 50, grass_palette = 1
},
sounds = mcl_sounds.node_sound_leaves_defaults(),
node_placement_prediction = "",