From bd7d9afd434b06ce577aacfe44d45a4eb9b19cf6 Mon Sep 17 00:00:00 2001 From: sys4-fr Date: Thu, 2 Mar 2017 16:28:24 +0100 Subject: [PATCH] Add Teosinte plant (Ancestor of corn) --- README.md | 1 + init.lua | 48 ++++++++++++++++++++++++++++-- mapgen.lua | 36 ++++++++++++++++++++-- textures/moreflowers_teosinte.png | Bin 0 -> 267 bytes 4 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 textures/moreflowers_teosinte.png diff --git a/README.md b/README.md index f4f626b..6414abb 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Optional Dependencies: For now this mod add: - Wild carrot: spawn into biomes grassland, deciduous_forest and coniferous_forest. +- Teosinte: spawn into biome rainforest. - Bunch of flowers: If farming mod is loaded then you can craft a bunch of flowers with any items from the flower group and a string of cotton. diff --git a/init.lua b/init.lua index c1eb936..134633f 100644 --- a/init.lua +++ b/init.lua @@ -30,7 +30,36 @@ local function add_simple_flower(name, desc, box, f_groups) }) end -moreflowers.datas = { +local function add_tall_flower(name, desc, box, f_groups) + f_groups.snappy = 3 + f_groups.flower = 1 + f_groups.flora = 1 + f_groups.attached_node = 1 + + minetest.register_node("moreflowers:" .. name, { + description = desc, + drawtype = "plantlike", + waving = 1, + tiles = {"moreflowers_"..name..".png"}, + inventory_image = "moreflowers_"..name..".png", + wield_image = "moreflowers_"..name..".png", + sunlight_propagates = true, + paramtype = "light", + walkable = false, + buildable_to = true, + stack_max = 99, + visual_scale = 1.3, + wield_scale = {x=1, y=1.5, z=1}, + groups = f_groups, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = box + } + }) +end + +moreflowers.datas_simple = { { "wild_carrot", "Wild Carrot", @@ -38,11 +67,23 @@ moreflowers.datas = { {flammable = 1} }, } +moreflowers.datas_tall = { + { + "teosinte", + "Teosinte", + {-0.5, -0.5, -0.5, 0.5, 1.2, 0.5}, + {flammable = 1} + }, +} -for _,item in pairs(moreflowers.datas) do +for _,item in pairs(moreflowers.datas_simple) do add_simple_flower(unpack(item)) end +for _,item in pairs(moreflowers.datas_tall) do + add_tall_flower(unpack(item)) +end + -- Plant spread TODO ? -- Bunch of flowers @@ -102,7 +143,8 @@ if minetest.get_modpath("bonemeal") and bonemeal then } local flowers = { "flowers:dandelion_white", "flowers:dandelion_yellow", "flowers:geranium", - "flowers:rose", "flowers:tulip", "flowers:viola", "moreflowers:wild_carrot" + "flowers:rose", "flowers:tulip", "flowers:viola", "moreflowers:wild_carrot", + "moreflowers:teosinte", } local dirt_with_grass_deco = { diff --git a/mapgen.lua b/mapgen.lua index 1707c7b..64cf722 100644 --- a/mapgen.lua +++ b/mapgen.lua @@ -18,7 +18,7 @@ local function register_mgv6_flower(name) }) end -local function register_flower(seed, name) +--[[local function register_flower(seed, name, biomes_list) minetest.register_decoration({ deco_type = "simple", place_on = {"default:dirt_with_grass"}, @@ -37,13 +37,43 @@ local function register_flower(seed, name) decoration = "moreflowers:" .. name, }) end - +--]] function moreflowers.register_mgv6_decorations() register_mgv6_flower("wild_carrot") end function moreflowers.register_decorations() - register_flower(368, "wild_carrot") +-- register_flower(368, "wild_carrot") + minetest.register_decoration( + { + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.015, + scale = 0.025, + spread = {x = 200, y = 200, z = 200}, + seed = 368, + octaves = 3, + persist = 0.6 + }, + biomes = {"grassland", "deciduous_forest", "coniferous_forest"}, + y_min = 1, + y_max = 31000, + decoration = "moreflowers:wild_carrot", + }) + + minetest.register_decoration( + { + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + fill_ratio = 0.001, + biomes = {"rainforest"}, + decoration = "moreflowers:teosinte", + height = 1, + }) + end -- detect mapgen diff --git a/textures/moreflowers_teosinte.png b/textures/moreflowers_teosinte.png new file mode 100644 index 0000000000000000000000000000000000000000..611601f349e41e5525060e956dab2eb7dc349fb6 GIT binary patch literal 267 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!aez;Vs{;drkRy{yG_z(Ni&++@ zZ7rKerGQ5po9krOkcsR@%a|e;a{26FPu;Frd`5iM8NZX4ZB^oG*?`&^OM?7@862M7 zNCR@(JY5_^Brd!9G7245;OG_+$)5A?|JK7<=6pL_S~%uNUHtq&Qf0&S^3NTI1M971 z=RaI(HQnZ>KzG}xWoL3y)*D_ZGbwh}mRhMTt-K~{USrbdohP5ITV{}al6meKF}dD{ zmPOb6-CCMM7O}q#+3bDooO!>P=XAD*b$lL^e!u%MeaYheF+sOpaLYNcYQ|ST{sVLo NgQu&X%Q~loCIHoAVFmyI literal 0 HcmV?d00001