From ade2a1a6a2ca5295859956e33c17840c47039329 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Wed, 20 Mar 2024 22:18:47 +0100 Subject: [PATCH 1/2] Add clovers and four-leaf clovers --- mods/ITEMS/mcl_flowers/init.lua | 30 ++++++++++++++ .../mcl_flowers/models/mcl_clover_3leaf.obj | 38 ++++++++++++++++++ .../mcl_flowers/models/mcl_clover_4leaf.obj | 32 +++++++++++++++ textures/mcl_flowers_clover.png | Bin 0 -> 137 bytes textures/mcl_flowers_clover_inv.png | Bin 0 -> 191 bytes textures/mcl_flowers_fourleaf_clover.png | Bin 0 -> 199 bytes textures/mcl_flowers_fourleaf_clover_inv.png | Bin 0 -> 189 bytes 7 files changed, 100 insertions(+) create mode 100644 mods/ITEMS/mcl_flowers/models/mcl_clover_3leaf.obj create mode 100644 mods/ITEMS/mcl_flowers/models/mcl_clover_4leaf.obj create mode 100644 textures/mcl_flowers_clover.png create mode 100644 textures/mcl_flowers_clover_inv.png create mode 100644 textures/mcl_flowers_fourleaf_clover.png create mode 100644 textures/mcl_flowers_fourleaf_clover_inv.png diff --git a/mods/ITEMS/mcl_flowers/init.lua b/mods/ITEMS/mcl_flowers/init.lua index 75e133322..d7aa750df 100644 --- a/mods/ITEMS/mcl_flowers/init.lua +++ b/mods/ITEMS/mcl_flowers/init.lua @@ -183,6 +183,36 @@ def_fern.groups.compostability = 65 minetest.register_node("mcl_flowers:fern", def_fern) + +--- Clover --- +-- Similar deal as fern, we can copy a lot from tall grass +local def_clover = table.copy(def_tallgrass) +def_clover.description = S("Clover") +def_clover._doc_items_longdesc = S("Clovers are small plants which occur naturally in plains and other temperate biomes. They can be picked up and planted again.") +def_clover.drawtype = "mesh" +def_clover.mesh = "mcl_clover_3leaf.obj" +def_clover.tiles = { "mcl_flowers_clover.png" } +def_clover.inventory_image = "mcl_flowers_clover_inv.png" +def_clover.wield_image = "mcl_flowers_clover_inv.png" +def_clover.drop = nil +def_clover.selection_box = { + type = "fixed", + fixed = { -4/16, -0.5, -4/16, 4/16, 0, 4/16 }, +} +def_clover.groups.compostability = 30 + +minetest.register_node("mcl_flowers:clover", def_clover) + +local def_4l_clover = table.copy(def_clover) +def_4l_clover.description = S("Four-leaf Clover") +def_4l_clover._doc_items_longdesc = S("Clovers are small plants which occur naturally in plains and other temperate biomes. They can be picked up and planted again.") +def_4l_clover.mesh = "mcl_clover_4leaf.obj" +def_4l_clover.tiles = { "mcl_flowers_fourleaf_clover.png" } +def_4l_clover.inventory_image = "mcl_flowers_fourleaf_clover_inv.png" +def_4l_clover.wield_image = "mcl_flowers_fourleaf_clover_inv.png" + +minetest.register_node("mcl_flowers:fourleaf_clover", def_4l_clover) + if has_mcl_flowerpots then mcl_flowerpots.register_potted_flower("mcl_flowers:fern", { name = "fern", diff --git a/mods/ITEMS/mcl_flowers/models/mcl_clover_3leaf.obj b/mods/ITEMS/mcl_flowers/models/mcl_clover_3leaf.obj new file mode 100644 index 000000000..57c0d5a3a --- /dev/null +++ b/mods/ITEMS/mcl_flowers/models/mcl_clover_3leaf.obj @@ -0,0 +1,38 @@ +# Blender 3.6.7 +# www.blender.org +mtllib mcl_clover_3leaf.mtl +o Plane +v 0.000000 -0.280000 0.000000 +v 0.000000 -0.280000 0.000000 +v -0.250000 -0.280000 -0.250000 +v 0.250000 -0.280000 -0.250000 +v 0.035355 -0.500000 0.035355 +v 0.035355 -0.300000 0.035355 +v -0.035355 -0.500000 -0.035355 +v -0.035355 -0.300000 -0.035355 +v 0.035355 -0.500000 -0.035355 +v 0.035355 -0.300000 -0.035355 +v -0.035355 -0.500000 0.035355 +v -0.035355 -0.300000 0.035355 +v -0.091506 -0.280000 0.341506 +v -0.341506 -0.280000 -0.091506 +v 0.000000 -0.280000 0.000000 +v 0.341506 -0.280000 -0.091506 +v 0.091506 -0.280000 0.341506 +vn -0.0000 1.0000 -0.0000 +vn -0.7071 -0.0000 0.7071 +vn 0.7071 -0.0000 0.7071 +vt 0.500000 0.437500 +vt 1.000000 0.937500 +vt 0.000000 0.937500 +vt 0.437500 0.062500 +vt 0.562500 0.062500 +vt 0.562500 0.437500 +vt 0.437500 0.437500 +s 0 +usemtl Material.001 +f 2/1/1 4/2/1 3/3/1 +f 5/4/2 6/5/2 8/6/2 7/7/2 +f 9/4/3 10/5/3 12/6/3 11/7/3 +f 1/1/1 14/2/1 13/3/1 +f 15/1/1 17/2/1 16/3/1 diff --git a/mods/ITEMS/mcl_flowers/models/mcl_clover_4leaf.obj b/mods/ITEMS/mcl_flowers/models/mcl_clover_4leaf.obj new file mode 100644 index 000000000..3662f5f99 --- /dev/null +++ b/mods/ITEMS/mcl_flowers/models/mcl_clover_4leaf.obj @@ -0,0 +1,32 @@ +# Blender 3.6.7 +# www.blender.org +mtllib mcl_clover_4leaf.mtl +o Plane +v -0.250000 -0.280000 0.250000 +v 0.250000 -0.280000 0.250000 +v -0.250000 -0.280000 -0.250000 +v 0.250000 -0.280000 -0.250000 +v 0.035355 -0.500000 0.035355 +v 0.035355 -0.300000 0.035355 +v -0.035355 -0.500000 -0.035355 +v -0.035355 -0.300000 -0.035355 +v 0.035355 -0.500000 -0.035355 +v 0.035355 -0.300000 -0.035355 +v -0.035355 -0.500000 0.035355 +v -0.035355 -0.300000 0.035355 +vn -0.0000 1.0000 -0.0000 +vn -0.7071 -0.0000 0.7071 +vn 0.7071 -0.0000 0.7071 +vt 0.000000 0.125000 +vt 0.875000 0.125000 +vt 0.875000 1.000000 +vt 0.000000 1.000000 +vt 0.875000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 0.375000 +vt 0.875000 0.375000 +s 0 +usemtl Material.001 +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 5/5/2 6/6/2 8/7/2 7/8/2 +f 9/5/3 10/6/3 12/7/3 11/8/3 diff --git a/textures/mcl_flowers_clover.png b/textures/mcl_flowers_clover.png new file mode 100644 index 0000000000000000000000000000000000000000..cdfc928d34b1ccb04190e2326f19382b1a35190f GIT binary patch literal 137 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s70z6$DLo9le6Be*$tUU9J z|Im&f6^@yCm;Q?u-#Q?1#O;}IDu>VEWud_jq!M!`@it_toMebu$IvObRPwICCKF|8 pr)_DgBpA511TwSTVn||OSpTsj$W^;Kih+TF!PC{xWt~$(696OQEU^Fp literal 0 HcmV?d00001 diff --git a/textures/mcl_flowers_clover_inv.png b/textures/mcl_flowers_clover_inv.png new file mode 100644 index 0000000000000000000000000000000000000000..033211b224eea900ef21ca9fed038c29796b0b25 GIT binary patch literal 191 zcmV;w06_nVP)fB2CU6pU|C=S*9c>iYyeCnNe19@1xSowz#%I_ z4+~^*48uU0iBXI*K+*jT(}e6Q5RDuz7~z3zI&u`EM|e*^2IWba{+G#bqnH%{apXmqJ{w!>O5AFQ6DgC=fw3HZ>ToAT=6c z>M_y-dSGIWIzk3uiv^+#z?PY?rapWI5DTbg004qnl#8Hk8@vDj002ovPDHLkV1lhR BMhpM| literal 0 HcmV?d00001 diff --git a/textures/mcl_flowers_fourleaf_clover_inv.png b/textures/mcl_flowers_fourleaf_clover_inv.png new file mode 100644 index 0000000000000000000000000000000000000000..1fe32362fa84ce0e45768c4f3f5101b52ca53f93 GIT binary patch literal 189 zcmV;u07CzXP) Date: Wed, 20 Mar 2024 22:29:03 +0100 Subject: [PATCH 2/2] Clovers now generate Also added a way to alter flower rarity --- mods/MAPGEN/mcl_biomes/init.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mods/MAPGEN/mcl_biomes/init.lua b/mods/MAPGEN/mcl_biomes/init.lua index d42720d26..adcf1940c 100644 --- a/mods/MAPGEN/mcl_biomes/init.lua +++ b/mods/MAPGEN/mcl_biomes/init.lua @@ -5589,7 +5589,7 @@ local function register_decorations() num_spawn_by = 1, }) end - local function register_flower(name, biomes, seed, is_in_flower_forest) + local function register_flower(name, biomes, seed, is_in_flower_forest, custom_rarity_mod) if is_in_flower_forest == nil then is_in_flower_forest = true end @@ -5599,7 +5599,7 @@ local function register_decorations() place_on = {"group:grass_block_no_snow", "mcl_core:dirt"}, sidelen = 16, noise_params = { - offset = 0.0008, + offset = 0.0008 + (custom_rarity_mod or 0), scale = 0.006, spread = {x = 100, y = 100, z = 100}, seed = seed, @@ -5651,6 +5651,9 @@ local function register_decorations() register_flower("lily_of_the_valley", nil, 325) register_flower("cornflower", flower_biomes2, 486) + + register_flower("clover", flower_biomes1, 3, false, 0.04) + register_flower("fourleaf_clover", flower_biomes1, 13, false, -0.002) end -- Decorations in non-Overworld dimensions