diff --git a/mods/ITEMS/mcl_farming/textures/farming_wheat_1.png b/mods/ITEMS/mcl_farming/textures/farming_wheat_1.png deleted file mode 100644 index 68537f39a..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/farming_wheat_1.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/farming_wheat_2.png b/mods/ITEMS/mcl_farming/textures/farming_wheat_2.png deleted file mode 100644 index 4d721efbd..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/farming_wheat_2.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/farming_wheat_3.png b/mods/ITEMS/mcl_farming/textures/farming_wheat_3.png deleted file mode 100644 index c42e37965..000000000 Binary files a/mods/ITEMS/mcl_farming/textures/farming_wheat_3.png and /dev/null differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_0.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_0.png new file mode 100644 index 000000000..ecea9bfa9 Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_0.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_1.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_1.png new file mode 100644 index 000000000..be0e8e0b6 Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_1.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_2.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_2.png new file mode 100644 index 000000000..b97287910 Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_2.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_3.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_3.png new file mode 100644 index 000000000..85e7e8a15 Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_3.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_4.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_4.png new file mode 100644 index 000000000..736983a2a Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_4.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_5.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_5.png new file mode 100644 index 000000000..7aec173b9 Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_5.png differ diff --git a/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_6.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_6.png new file mode 100644 index 000000000..972b3136b Binary files /dev/null and b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_6.png differ diff --git a/mods/ITEMS/mcl_farming/textures/farming_wheat.png b/mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_7.png similarity index 100% rename from mods/ITEMS/mcl_farming/textures/farming_wheat.png rename to mods/ITEMS/mcl_farming/textures/mcl_farming_wheat_stage_7.png diff --git a/mods/ITEMS/mcl_farming/wheat.lua b/mods/ITEMS/mcl_farming/wheat.lua index 5f98bea52..0537a8022 100644 --- a/mods/ITEMS/mcl_farming/wheat.lua +++ b/mods/ITEMS/mcl_farming/wheat.lua @@ -10,78 +10,52 @@ minetest.register_craftitem("mcl_farming:wheat_seeds", { end }) -minetest.register_node("mcl_farming:wheat_1", { - description = "Premature Wheat Plant (First Stage)", - _doc_items_entry_name = "Premature Wheat Plant", - _doc_items_longdesc = "Premature wheat plants grow on farmland under sunlight in 4 stages. On hydrated farmland, they grow faster. They can be harvested at any time but will only yield a profit when mature.", - paramtype = "light", - paramtype2 = "meshoptions", - place_param2 = 3, - sunlight_propagates = true, - walkable = false, - drawtype = "plantlike", - drop = "mcl_farming:wheat_seeds", - tiles = {"farming_wheat_1.png"}, - inventory_image = "farming_wheat_1.png", - wield_image = "farming_wheat_1.png", - selection_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.125, 0.5} - }, - }, - groups = {dig_immediate=3, not_in_creative_inventory=1, dig_by_water=1, dig_by_piston=1}, - sounds = mcl_sounds.node_sound_leaves_defaults(), - _mcl_blast_resistance = 0, -}) +local sel_heights = { + -5/16, + -2/16, + 0, + 3/16, + 5/16, + 6/16, + 7/16, +} -minetest.register_node("mcl_farming:wheat_2", { - description = "Premature Wheat Plant (Second Stage)", - _doc_items_create_entry = false, - sunlight_propagates = true, - paramtype = "light", - paramtype2 = "meshoptions", - place_param2 = 3, - walkable = false, - drawtype = "plantlike", - drop = "mcl_farming:wheat_seeds", - tiles = {"farming_wheat_2.png"}, - inventory_image = "farming_wheat_2.png", - wield_image = "farming_wheat_2.png", - selection_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5} - }, - }, - groups = {dig_immediate=3, not_in_creative_inventory=1, dig_by_water=1, dig_by_piston=1}, - sounds = mcl_sounds.node_sound_leaves_defaults(), - _mcl_blast_resistance = 0, -}) +for i=1,7 do + local create, name, longdesc + if i == 1 then + create = true + name = "Premature Wheat Plant" + longdesc = "Premature wheat plants grow on farmland under sunlight in 8 stages. On hydrated farmland, they grow faster. They can be harvested at any time but will only yield a profit when mature." + else + create = false + end -minetest.register_node("mcl_farming:wheat_3", { - description = "Premature Wheat Plant (Third Stage)", - _doc_items_create_entry = false, - sunlight_propagates = true, - paramtype = "light", - paramtype2 = "meshoptions", - place_param2 = 3, - walkable = false, - drawtype = "plantlike", - drop = "mcl_farming:wheat_seeds", - tiles = {"farming_wheat_3.png"}, - inventory_image = "farming_wheat_3.png", - wield_image = "farming_wheat_3.png", - selection_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.25, 0.5} + minetest.register_node("mcl_farming:wheat_"..i, { + description = string.format("Premature Wheat Plant (Stage %d)", i), + _doc_items_create_entry = create, + _doc_items_entry_name = name, + _doc_items_longdesc = longdesc, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, + sunlight_propagates = true, + walkable = false, + drawtype = "plantlike", + drop = "mcl_farming:wheat_seeds", + tiles = {"mcl_farming_wheat_stage_"..(i-1)..".png"}, + inventory_image = "mcl_farming_wheat_stage_"..(i-1)..".png", + wield_image = "mcl_farming_wheat_stage_"..(i-1)..".png", + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, sel_heights[i], 0.5} + }, }, - }, - groups = {dig_immediate=3, not_in_creative_inventory=1, dig_by_water=1, dig_by_piston=1}, - sounds = mcl_sounds.node_sound_leaves_defaults(), - _mcl_blast_resistance = 0, -}) + groups = {dig_immediate=3, not_in_creative_inventory=1, dig_by_water=1, dig_by_piston=1}, + sounds = mcl_sounds.node_sound_leaves_defaults(), + _mcl_blast_resistance = 0, + }) +end minetest.register_node("mcl_farming:wheat", { description = "Mature Wheat Plant", @@ -92,9 +66,9 @@ minetest.register_node("mcl_farming:wheat", { place_param2 = 3, walkable = false, drawtype = "plantlike", - tiles = {"farming_wheat.png"}, - inventory_image = "farming_wheat.png", - wield_image = "farming_wheat.png", + tiles = {"mcl_farming_wheat_stage_7.png"}, + inventory_image = "mcl_farming_wheat_stage_7.png", + wield_image = "mcl_farming_wheat_stage_7.png", drop = { max_items = 4, items = { @@ -104,18 +78,12 @@ minetest.register_node("mcl_farming:wheat", { { items = {'mcl_farming:wheat_item'} } } }, - selection_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.35, 0.5} - }, - }, groups = {dig_immediate=3, not_in_creative_inventory=1, dig_by_water=1, dig_by_piston=1}, sounds = mcl_sounds.node_sound_leaves_defaults(), _mcl_blast_resistance = 0, }) -mcl_farming:add_plant("plant_wheat", "mcl_farming:wheat", {"mcl_farming:wheat_1", "mcl_farming:wheat_2", "mcl_farming:wheat_3"}, 50, 20) +mcl_farming:add_plant("plant_wheat", "mcl_farming:wheat", {"mcl_farming:wheat_1", "mcl_farming:wheat_2", "mcl_farming:wheat_3", "mcl_farming:wheat_4", "mcl_farming:wheat_5", "mcl_farming:wheat_6", "mcl_farming:wheat_7"}, 50, 20) minetest.register_craftitem("mcl_farming:wheat_item", { description = "Wheat", @@ -190,7 +158,7 @@ minetest.register_craft({ }) if minetest.get_modpath("doc") then - for i=2,3 do + for i=2,7 do doc.add_entry_alias("nodes", "mcl_farming:wheat_1", "nodes", "mcl_farming:wheat_"..i) end end