From 6002cd0af584c3e1a0bb06ef2d3b2c420f167f69 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 13 Dec 2019 14:28:24 +0100 Subject: [PATCH] Fix tallgrass, fern, bonemeal for new grass color --- mods/ITEMS/mcl_core/functions.lua | 2 ++ mods/ITEMS/mcl_core/nodes_base.lua | 1 - mods/ITEMS/mcl_dye/init.lua | 2 +- mods/ITEMS/mcl_flowers/init.lua | 10 +++++----- mods/MAPGEN/mcl_biomes/init.lua | 16 ++++++++-------- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index b4d7c6f0a..40440a425 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -1273,6 +1273,8 @@ mcl_core.register_snowed_node = function(itemstring_snowed, itemstring_clear, ti end if clear_colorization then def.paramtype2 = nil + def.palette = nil + def.palette_index = nil def.color = nil def.overlay_tiles = nil end diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index ca3505799..279917e73 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -336,7 +336,6 @@ minetest.register_node("mcl_core:dirt_with_grass", { return mcl_core.on_snowable_construct(pos) end, _mcl_snowed = "mcl_core:dirt_with_grass_snow", - _mcl_grass_palette_index = 0, _mcl_blast_resistance = 3, _mcl_hardness = 0.6, }) diff --git a/mods/ITEMS/mcl_dye/init.lua b/mods/ITEMS/mcl_dye/init.lua index 11a6f6570..30c493fff 100644 --- a/mods/ITEMS/mcl_dye/init.lua +++ b/mods/ITEMS/mcl_dye/init.lua @@ -255,7 +255,7 @@ mcl_dye.apply_bone_meal = function(pointed_thing) if math.random(1,100) <= 90 then -- 90% tall grass, 10% flower if math.random(1,100) <= 90 then - local col = minetest.registered_nodes[n2.name]._mcl_grass_palette_index + local col = n2.param2 minetest.add_node(pos, {name="mcl_flowers:tallgrass", param2=col}) else local flowers_table diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index c2708500f..667a74b64 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -17,7 +17,7 @@ local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos, local has_palette = minetest.registered_nodes[itemstack:get_name()].palette ~= nil local colorize if has_palette then - colorize = minetest.registered_nodes[soil_node.name]._mcl_grass_palette_index + colorize = soil_node.param2 end if not colorize then colorize = 0 @@ -226,8 +226,8 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im local top = { x = bottom.x, y = bottom.y + 1, z = bottom.z } local bottom_buildable = minetest.registered_nodes[minetest.get_node(bottom).name].buildable_to local top_buildable = minetest.registered_nodes[minetest.get_node(top).name].buildable_to - local floorname = minetest.get_node({x=bottom.x, y=bottom.y-1, z=bottom.z}).name - if not minetest.registered_nodes[floorname] then + local floor = minetest.get_node({x=bottom.x, y=bottom.y-1, z=bottom.z}) + if not minetest.registered_nodes[floor.name] then return itemstack end @@ -243,10 +243,10 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im -- * If not a flower, also allowed on podzol and coarse dirt -- * Only with light level >= 8 -- * Only if two enough space - if (floorname == "mcl_core:dirt" or minetest.get_item_group(floorname, "grass_block") == 1 or (not is_flower and (floorname == "mcl_core:coarse_dirt" or floorname == "mcl_core:podzol" or floorname == "mcl_core:podzol_snow"))) and bottom_buildable and top_buildable and light_ok then + if (floor.name == "mcl_core:dirt" or minetest.get_item_group(floor.name, "grass_block") == 1 or (not is_flower and (floor.name == "mcl_core:coarse_dirt" or floor.name == "mcl_core:podzol" or floor.name == "mcl_core:podzol_snow"))) and bottom_buildable and top_buildable and light_ok then local param2 if grass_color then - param2 = minetest.registered_nodes[floorname]._mcl_grass_palette_index + param2 = floor.param2 end -- Success! We can now place the flower minetest.sound_play(minetest.registered_nodes[itemstring].sounds.place, {pos = bottom, gain=1}) diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index 22331dd07..c306de2e5 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -2872,7 +2872,7 @@ local function register_decorations() num_spawn_by = 1, }) - local dry_index = minetest.registered_nodes["mcl_core:dirt_with_grass"]._mcl_grass_palette_index + local dry_grass_index = 1 -- Doubletall grass local register_doubletall_grass = function(offset, scale, biomes, param2) @@ -2905,7 +2905,7 @@ local function register_decorations() register_doubletall_grass(-0.01, 0.03, {"Taiga", "Forest", "FlowerForest", "BirchForest", "BirchForestM", "RoofedForest"}) register_doubletall_grass(-0.002, 0.03, {"Plains", "SunflowerPlains"}) - register_doubletall_grass(-0.0005, -0.03, {"Savanna", "SavannaM"}, dry_index) + register_doubletall_grass(-0.0005, -0.03, {"Savanna", "SavannaM"}, dry_grass_index) -- Large ferns local register_double_fern = function(offset, scale, biomes) @@ -3354,18 +3354,18 @@ local function register_decorations() register_grass_decoration("tallgrass", 0, 0.06, grass_forest) register_grass_decoration("tallgrass", 0.015, 0.045, grass_forest) register_grass_decoration("tallgrass", 0.03, 0.03, grass_forest) - register_grass_decoration("tallgrass", -0.03, 0.09, grass_mpf, dry_index) - register_grass_decoration("tallgrass", -0.015, 0.075, grass_mpf, dry_index) - register_grass_decoration("tallgrass", 0, 0.06, grass_mpf, dry_index) - register_grass_decoration("tallgrass", 0.01, 0.045, grass_mpf, dry_index) + register_grass_decoration("tallgrass", -0.03, 0.09, grass_mpf, dry_grass_index) + register_grass_decoration("tallgrass", -0.015, 0.075, grass_mpf, dry_grass_index) + register_grass_decoration("tallgrass", 0, 0.06, grass_mpf, dry_grass_index) + register_grass_decoration("tallgrass", 0.01, 0.045, grass_mpf, dry_grass_index) register_grass_decoration("tallgrass", 0.01, 0.05, grass_forest) register_grass_decoration("tallgrass", 0.03, 0.03, grass_plains) register_grass_decoration("tallgrass", 0.05, 0.01, grass_plains) register_grass_decoration("tallgrass", 0.07, -0.01, grass_plains) register_grass_decoration("tallgrass", 0.09, -0.03, grass_plains) - register_grass_decoration("tallgrass", 0.18, -0.03, grass_savanna, dry_index) + register_grass_decoration("tallgrass", 0.18, -0.03, grass_savanna, dry_grass_index) register_grass_decoration("tallgrass", 0.05, -0.03, grass_sparse) - register_grass_decoration("tallgrass", 0.05, 0.05, grass_mpfm, dry_index) + register_grass_decoration("tallgrass", 0.05, 0.05, grass_mpfm, dry_grass_index) local fern_minimal = { "Jungle", "JungleM", "JungleEdge", "JungleEdgeM", "Taiga", "MegaTaiga", "MegaSpruceTaiga", "ColdTaiga" } local fern_low = { "Jungle", "JungleM", "JungleEdge", "JungleEdgeM", "Taiga", "MegaTaiga", "MegaSpruceTaiga" }