From 3d08b568ad1da1e3259a66cb91fd1039781c75cb Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Tue, 26 Sep 2017 00:11:57 -0400 Subject: update castles modpack, boost_cart, homedecor, currency, farming redo, framed glass, gloopblocks, mesecons, moreblocks, pipeworks, signs_lib, technic, unified mesecons, and worldedit created a new tag for this release (this will be standard procedure from now on) --- farming/README.txt | 7 +- farming/barley.lua | 2 + farming/beanpole.lua | 2 +- farming/chili.lua | 88 ++++++++++ farming/cocoa.lua | 2 +- farming/cotton.lua | 43 ++++- farming/donut.lua | 35 +++- farming/farming.conf_example | 4 + farming/grapes.lua | 2 +- farming/grass.lua | 1 + farming/hoes.lua | 6 + farming/init.lua | 209 ++++++++++-------------- farming/intllib.lua | 45 +++++ farming/locale/de.po | 262 ++++++++++++++++++++++++++++++ farming/locale/pt.po | 258 +++++++++++++++++++++++++++++ farming/locale/template.pot | 258 +++++++++++++++++++++++++++++ farming/lucky_block.lua | 2 + farming/mapgen.lua | 25 ++- farming/textures/farming_chili_1.png | Bin 0 -> 113 bytes farming/textures/farming_chili_2.png | Bin 0 -> 107 bytes farming/textures/farming_chili_3.png | Bin 0 -> 137 bytes farming/textures/farming_chili_4.png | Bin 0 -> 144 bytes farming/textures/farming_chili_5.png | Bin 0 -> 154 bytes farming/textures/farming_chili_6.png | Bin 0 -> 157 bytes farming/textures/farming_chili_7.png | Bin 0 -> 169 bytes farming/textures/farming_chili_8.png | Bin 0 -> 169 bytes farming/textures/farming_chili_bowl.png | Bin 0 -> 183 bytes farming/textures/farming_chili_pepper.png | Bin 0 -> 194 bytes farming/textures/farming_cotton.png | Bin 166 -> 316 bytes farming/textures/farming_porridge.png | Bin 0 -> 193 bytes farming/textures/farming_string.png | Bin 0 -> 166 bytes farming/wheat.lua | 24 ++- 32 files changed, 1132 insertions(+), 143 deletions(-) create mode 100644 farming/chili.lua create mode 100644 farming/intllib.lua create mode 100644 farming/locale/de.po create mode 100644 farming/locale/pt.po create mode 100644 farming/locale/template.pot create mode 100644 farming/textures/farming_chili_1.png create mode 100644 farming/textures/farming_chili_2.png create mode 100644 farming/textures/farming_chili_3.png create mode 100644 farming/textures/farming_chili_4.png create mode 100644 farming/textures/farming_chili_5.png create mode 100644 farming/textures/farming_chili_6.png create mode 100644 farming/textures/farming_chili_7.png create mode 100644 farming/textures/farming_chili_8.png create mode 100644 farming/textures/farming_chili_bowl.png create mode 100644 farming/textures/farming_chili_pepper.png create mode 100644 farming/textures/farming_porridge.png create mode 100644 farming/textures/farming_string.png (limited to 'farming') diff --git a/farming/README.txt b/farming/README.txt index 00c2dda..2b3fa26 100644 --- a/farming/README.txt +++ b/farming/README.txt @@ -13,6 +13,8 @@ This mod works by adding your new plant to the {growing=1} group and numbering t Changelog: +1.28 - Added chili peppers and bowl of chili, optimized code and fixed a few bugs, added porridge +1.27 - Added meshoptions to api and wheat plants, added farming.rarity setting to spawn more/less crops on map, have separate cotton/string items (4x cotton = 1x wool, 2x cotton = 2x string) 1.26 - Added support for [toolranks] mod when using hoe's 1.25 - Added check for farming.conf setting file to disable specific crops globally (inside mod folder) or world specific (inside world folder) 1.24 - Added Hemp which can be crafted into fibre, paper, string, rope and oil. @@ -48,7 +50,7 @@ Changelog: 0.1 - Fixed growing bug 0.0 - Initial release -Lucky Blocks: 11 (plus 3 for default farming items) +Lucky Blocks: 16 License of media (textures): @@ -60,6 +62,9 @@ Created by PilzAdam (License: WTFPL): farming_soil_wet_side.png farming_string.png +Created by Napiophelios (CC BY-SA 3.0): + farming_cotton.png + Created by Calinou (License: CC BY-SA): farming_tool_bronzehoe.png farming_tool_steelhoe.png diff --git a/farming/barley.lua b/farming/barley.lua index b7bf530..8611ee5 100644 --- a/farming/barley.lua +++ b/farming/barley.lua @@ -37,6 +37,8 @@ local crop_def = { drawtype = "plantlike", tiles = {"farming_barley_1.png"}, paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, sunlight_propagates = true, walkable = false, buildable_to = true, diff --git a/farming/beanpole.lua b/farming/beanpole.lua index fd93383..8afead6 100644 --- a/farming/beanpole.lua +++ b/farming/beanpole.lua @@ -41,7 +41,7 @@ function place_beans(itemstack, placer, pointed_thing, plantname) minetest.sound_play("default_place_node", {pos = pt.under, gain = 1.0}) - if not minetest.setting_getbool("creative_mode") then + if not farming.is_creative(placer:get_player_name()) then itemstack:take_item() diff --git a/farming/chili.lua b/farming/chili.lua new file mode 100644 index 0000000..ec2a1a9 --- /dev/null +++ b/farming/chili.lua @@ -0,0 +1,88 @@ + +local S = farming.intllib + +-- chili pepper +minetest.register_craftitem("farming:chili_pepper", { + description = S("Chili Pepper"), + inventory_image = "farming_chili_pepper.png", + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1") + end, + on_use = minetest.item_eat(2), +}) + +-- bowl of chili +minetest.register_craftitem("farming:chili_bowl", { + description = S("Bowl of Chili"), + inventory_image = "farming_chili_bowl.png", + on_use = minetest.item_eat(8), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:chili_bowl", + recipe = {"farming:chili_pepper", "farming:barley", "farming:tomato", "farming:beans"} +}) + +-- chili can be used for red dye +minetest.register_craft({ + output = "dye:red", + recipe = { + {'farming:chili_pepper'}, + } +}) + +-- chili definition +local crop_def = { + drawtype = "plantlike", + tiles = {"farming_chili_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 4, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:chili_1", table.copy(crop_def)) + +-- stage 2 +crop_def.tiles = {"farming_chili_2.png"} +minetest.register_node("farming:chili_2", table.copy(crop_def)) + +-- stage 3 +crop_def.tiles = {"farming_chili_3.png"} +minetest.register_node("farming:chili_3", table.copy(crop_def)) + +-- stage 4 +crop_def.tiles = {"farming_chili_4.png"} +minetest.register_node("farming:chili_4", table.copy(crop_def)) + +-- stage 5 +crop_def.tiles = {"farming_chili_5.png"} +minetest.register_node("farming:chili_5", table.copy(crop_def)) + +-- stage 6 +crop_def.tiles = {"farming_chili_6.png"} +minetest.register_node("farming:chili_6", table.copy(crop_def)) + +-- stage 7 +crop_def.tiles = {"farming_chili_7.png"} +minetest.register_node("farming:chili_7", table.copy(crop_def)) + +-- stage 8 (final) +crop_def.tiles = {"farming_chili_8.png"} +crop_def.groups.growing = 0 +crop_def.drop = { + items = { + {items = {'farming:chili_pepper 3'}, rarity = 1}, + {items = {'farming:chili_pepper 2'}, rarity = 2}, + } +} +minetest.register_node("farming:chili_8", table.copy(crop_def)) diff --git a/farming/cocoa.lua b/farming/cocoa.lua index fad1733..3ee3532 100644 --- a/farming/cocoa.lua +++ b/farming/cocoa.lua @@ -36,7 +36,7 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname) minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) - if not minetest.setting_getbool("creative_mode") then + if not farming.is_creative(placer:get_player_name()) then itemstack:take_item() diff --git a/farming/cotton.lua b/farming/cotton.lua index eef6425..bf0412e 100644 --- a/farming/cotton.lua +++ b/farming/cotton.lua @@ -8,7 +8,7 @@ minetest.register_node("farming:seed_cotton", { inventory_image = "farming_cotton_seed.png", wield_image = "farming_cotton_seed.png", drawtype = "signlike", - groups = {seed = 1, snappy = 3, attached_node = 1}, + groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4}, paramtype = "light", paramtype2 = "wallmounted", walkable = false, @@ -24,19 +24,46 @@ minetest.register_node("farming:seed_cotton", { minetest.register_craftitem("farming:cotton", { description = S("Cotton"), inventory_image = "farming_cotton.png", + groups = {flammable = 4}, }) -minetest.register_alias("farming:string", "farming:cotton") +minetest.register_craftitem("farming:string", { + description = S("String"), + inventory_image = "farming_string.png", + groups = {flammable = 2}, +}) -- cotton to wool minetest.register_craft({ output = "wool:white", recipe = { - {"farming:string", "farming:string"}, - {"farming:string", "farming:string"}, + {"farming:cotton", "farming:cotton"}, + {"farming:cotton", "farming:cotton"}, } }) +-- cotton to string +minetest.register_craft({ + output = "farming:string 2", + recipe = { + {"farming:cotton"}, + {"farming:cotton"}, + } +}) + +-- can be used as fuel +minetest.register_craft({ + type = "fuel", + recipe = "farming:string", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:cotton", + burntime = 1, +}) + -- cotton definition local crop_def = { drawtype = "plantlike", @@ -48,7 +75,7 @@ local crop_def = { drop = "", selection_box = farming.select, groups = { - snappy = 3, flammable = 2, plant = 1, attached_node = 1, + snappy = 3, flammable = 4, plant = 1, attached_node = 1, not_in_creative_inventory = 1, growing = 1 }, sounds = default.node_sound_leaves_defaults() @@ -105,9 +132,9 @@ crop_def.tiles = {"farming_cotton_8.png"} crop_def.groups.growing = 0 crop_def.drop = { items = { - {items = {"farming:string"}, rarity = 1}, - {items = {"farming:string"}, rarity = 2}, - {items = {"farming:string"}, rarity = 3}, + {items = {"farming:cotton"}, rarity = 1}, + {items = {"farming:cotton"}, rarity = 2}, + {items = {"farming:cotton"}, rarity = 3}, {items = {"farming:seed_cotton"}, rarity = 1}, {items = {"farming:seed_cotton"}, rarity = 2}, {items = {"farming:seed_cotton"}, rarity = 3}, diff --git a/farming/donut.lua b/farming/donut.lua index 68aeb8e..be2e9b8 100644 --- a/farming/donut.lua +++ b/farming/donut.lua @@ -12,7 +12,7 @@ minetest.register_craft({ output = "farming:donut 3", recipe = { {'', 'farming:wheat', ''}, - {'farming:wheat', '', 'farming:wheat'}, + {'farming:wheat', 'farming:sugar', 'farming:wheat'}, {'', 'farming:wheat', ''}, } }) @@ -46,3 +46,36 @@ minetest.register_craft({ {'farming:donut'}, } }) + +-- Porridge Oats +minetest.register_craftitem("farming:porridge", { + description = S("Porridge"), + inventory_image = "farming_porridge.png", + on_use = minetest.item_eat(6), +}) + +minetest.after(0, function() + + if minetest.get_modpath("mobs") and mobs and mobs.mod == "redo" then + + minetest.register_craft({ + output = "farming:porridge", + type = "shapeless", + recipe = { + "farming:barley", "farming:barley", "farming:wheat", + "farming:wheat", "mobs:bucket_milk" + }, + replacements = {{"mobs:bucket_milk", "bucket:bucket_empty"}} + }) +else + minetest.register_craft({ + output = "farming:porridge", + type = "shapeless", + recipe = { + "farming:barley", "farming:barley", "farming:wheat", + "farming:wheat", "bucket:bucket_water" + }, + replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} + }) + end +end) diff --git a/farming/farming.conf_example b/farming/farming.conf_example index 696d007..be6e398 100644 --- a/farming/farming.conf_example +++ b/farming/farming.conf_example @@ -23,5 +23,9 @@ farming.rhubarb = true farming.beans = true farming.grapes = true farming.barley = true +farming.chili = true farming.hemp = true farming.donuts = true + +-- rarety of crops on map, default is 0.006 (higher number = more crops) +farming.rarety = 0.006 diff --git a/farming/grapes.lua b/farming/grapes.lua index 9070d0e..d443c33 100644 --- a/farming/grapes.lua +++ b/farming/grapes.lua @@ -36,7 +36,7 @@ function place_grapes(itemstack, placer, pointed_thing, plantname) minetest.sound_play("default_place_node", {pos = pt.under, gain = 1.0}) - if not minetest.setting_getbool("creative_mode") then + if not farming.is_creative(placer:get_player_name()) then itemstack:take_item() diff --git a/farming/grass.lua b/farming/grass.lua index aacb220..f6f777b 100644 --- a/farming/grass.lua +++ b/farming/grass.lua @@ -14,6 +14,7 @@ for i = 3, 5 do }) -- Override default dry grass and have it drop Barley Seeds + if minetest.registered_nodes["default:dry_grass_1"] then minetest.override_item("default:dry_grass_" .. i, { diff --git a/farming/hoes.lua b/farming/hoes.lua index dd7a11c..c883e22 100644 --- a/farming/hoes.lua +++ b/farming/hoes.lua @@ -130,6 +130,12 @@ farming.register_hoe(":farming:hoe_wood", { material = "group:wood" }) +minetest.register_craft({ + type = "fuel", + recipe = "farming:hoe_wood", + burntime = 5, +}) + farming.register_hoe(":farming:hoe_stone", { description = S("Stone Hoe"), inventory_image = "farming_tool_stonehoe.png", diff --git a/farming/init.lua b/farming/init.lua index 07e935c..3f026fb 100644 --- a/farming/init.lua +++ b/farming/init.lua @@ -1,5 +1,5 @@ --[[ - Farming Redo Mod 1.25 (6th May 2017) + Farming Redo Mod by TenPlus1 NEW growing routine by prestidigitator auto-refill by crabman77 @@ -8,53 +8,39 @@ farming = {} farming.mod = "redo" farming.path = minetest.get_modpath("farming") -farming.hoe_on_use = default.hoe_on_use farming.select = { type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5} } +local creative_mode_cache = minetest.setting_getbool("creative_mode") + +function farming.is_creative(name) + return creative_mode_cache or minetest.check_player_privs(name, {creative = true}) +end + + local statistics = dofile(farming.path.."/statistics.lua") -- Intllib - -local S -if minetest.get_modpath("intllib") then - S = intllib.Getter() -else - S = function(s) return s end -end +local S = dofile(farming.path.."/intllib.lua") farming.intllib = S --- Utility Functions +-- Utility Function local time_speed = tonumber(minetest.setting_get("time_speed")) or 72 local SECS_PER_CYCLE = (time_speed > 0 and 24 * 60 * 60 / time_speed) or 0 - local function clamp(x, min, max) return (x < min and min) or (x > max and max) or x end -local function in_range(x, min, max) - return min <= x and x <= max -end - ---- Tests the amount of day or night time between two times. - -- - -- @param t_game - -- The current time, as reported by mintest.get_gametime(). - -- @param t_day - -- The current time, as reported by mintest.get_timeofday(). - -- @param dt - -- The amount of elapsed time. - -- @param count_day - -- If true, count elapsed day time. Otherwise, count elapsed night time. - -- @return - -- The amount of day or night time that has elapsed. -local function day_or_night_time(t_game, t_day, dt, count_day) +-- return amount of day or night that has elapsed +-- dt is time elapsed, count_day if true counts day, otherwise night +local function day_or_night_time(dt, count_day) + local t_day = minetest.get_timeofday() local t1_day = t_day - dt / SECS_PER_CYCLE local t1_c, t2_c -- t1_c < t2_c and t2_c always in [0, 1) @@ -88,45 +74,13 @@ local function day_or_night_time(t_game, t_day, dt, count_day) return dt_c * SECS_PER_CYCLE end ---- Tests the amount of elapsed day time. - -- - -- @param dt - -- The amount of elapsed time. - -- @return - -- The amount of day time that has elapsed. - -- -local function day_time(dt) - return day_or_night_time(minetest.get_gametime(), minetest.get_timeofday(), dt, true) -end - ---- Tests the amount of elapsed night time. - -- - -- @param dt - -- The amount of elapsed time. - -- @return - -- The amount of night time that has elapsed. - -- -local function night_time(time_game, time_day, dt, count_day) - return day_or_night_time(minetest.get_gametime(), minetest.get_timeofday(), dt, false) -end - -- Growth Logic - local STAGE_LENGTH_AVG = 160.0 local STAGE_LENGTH_DEV = STAGE_LENGTH_AVG / 6 -local MIN_LIGHT = 13 -local MAX_LIGHT = 1000 ---- Determines plant name and stage from node. - -- - -- Separates node name on the last underscore (_). - -- - -- @param node - -- Node or position table, or node name. - -- @return - -- List (plant_name, stage), or nothing (nil) if node isn't loaded +-- return plant name and stage from node provided local function plant_name_stage(node) local name @@ -161,6 +115,7 @@ local function plant_name_stage(node) return name, 0 end + -- Map from node name to -- { plant_name = ..., name = ..., stage = n, stages_left = { node_name, ... } } @@ -254,6 +209,7 @@ local function reg_plant_stages(plant_name, stage, force_last) return stages end + register_plant_node = function(node) local plant_name, stage = plant_name_stage(node) @@ -267,6 +223,7 @@ register_plant_node = function(node) end end + local function set_growing(pos, stages_left) if not stages_left then @@ -291,14 +248,8 @@ local function set_growing(pos, stages_left) end end --- Detects a plant type node at the given position, starting --- or stopping the plant growth timer as appopriate - --- @param pos --- The node's position. --- @param node --- The cached node table if available, or nil. +-- detects a crop at given position, starting or stopping growth timer when needed function farming.handle_growth(pos, node) if not pos then @@ -312,6 +263,7 @@ function farming.handle_growth(pos, node) end end + minetest.after(0, function() for _, node_def in ipairs(minetest.registered_nodes) do @@ -319,11 +271,11 @@ minetest.after(0, function() end end) + local abm_func = farming.handle_growth -- Just in case a growing type or added node is missed (also catches existing -- nodes added to map before timers were incorporated). - minetest.register_abm({ nodenames = { "group:growing" }, interval = 300, @@ -331,9 +283,8 @@ minetest.register_abm({ action = abm_func }) --- Plant timer function. --- Grows plants under the right conditions. +-- Plant timer function that grows plants under the right conditions. function farming.plant_growth_timer(pos, elapsed, node_name) local stages = plant_stages[node_name] @@ -351,7 +302,6 @@ function farming.plant_growth_timer(pos, elapsed, node_name) if stages.plant_name == "farming:cocoa" then if not minetest.find_node_near(pos, 1, {"default:jungletree"}) then - return true end else @@ -363,19 +313,23 @@ function farming.plant_growth_timer(pos, elapsed, node_name) end local growth - local light_pos = {x = pos.x, y = pos.y + 1, z = pos.z} + local light_pos = {x = pos.x, y = pos.y, z = pos.z} -- was y + 1 local lambda = elapsed / STAGE_LENGTH_AVG if lambda < 0.1 then return true end + local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or 13 + local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or 15 + --print ("---", MIN_LIGHT, MAX_LIGHT) + if max_growth == 1 or lambda < 2.0 then local light = (minetest.get_node_light(light_pos) or 0) --print ("light level:", light) - if not in_range(light, MIN_LIGHT, MAX_LIGHT) then + if light < MIN_LIGHT or light > MAX_LIGHT then return true end @@ -383,8 +337,8 @@ function farming.plant_growth_timer(pos, elapsed, node_name) else local night_light = (minetest.get_node_light(light_pos, 0) or 0) local day_light = (minetest.get_node_light(light_pos, 0.5) or 0) - local night_growth = in_range(night_light, MIN_LIGHT, MAX_LIGHT) - local day_growth = in_range(day_light, MIN_LIGHT, MAX_LIGHT) + local night_growth = night_light >= MIN_LIGHT and night_light <= MAX_LIGHT + local day_growth = day_light >= MIN_LIGHT and day_light <= MAX_LIGHT if not night_growth then @@ -392,11 +346,11 @@ function farming.plant_growth_timer(pos, elapsed, node_name) return true end - lambda = day_time(elapsed) / STAGE_LENGTH_AVG + lambda = day_or_night_time(elapsed, true) / STAGE_LENGTH_AVG elseif not day_growth then - lambda = night_time(elapsed) / STAGE_LENGTH_AVG + lambda = day_or_night_time(elapsed, false) / STAGE_LENGTH_AVG end growth = statistics.poisson(lambda, max_growth) @@ -407,7 +361,10 @@ function farming.plant_growth_timer(pos, elapsed, node_name) end if minetest.registered_nodes[stages.stages_left[growth]] then - minetest.swap_node(pos, {name = stages.stages_left[growth]}) + + local p2 = minetest.registered_nodes[stages.stages_left[growth] ].place_param2 or 1 + + minetest.swap_node(pos, {name = stages.stages_left[growth], param2 = p2}) else return true end @@ -415,29 +372,8 @@ function farming.plant_growth_timer(pos, elapsed, node_name) return growth ~= max_growth end --- refill placed plant by crabman (26/08/2015) -local can_refill_plant = { - ["farming:blueberry_1"] = "farming:blueberries", - ["farming:carrot_1"] = "farming:carrot", - ["farming:coffee_1"] = "farming:coffee_beans", - ["farming:corn_1"] = "farming:corn", - ["farming:cotton_1"] = "farming:seed_cotton", - ["farming:cucumber_1"] = "farming:cucumber", - ["farming:melon_1"] = "farming:melon_slice", - ["farming:potato_1"] = "farming:potato", - ["farming:pumpkin_1"] = "farming:pumpkin_slice", - ["farming:raspberry_1"] = "farming:raspberries", - ["farming:rhubarb_1"] = "farming:rhubarb", - ["farming:tomato_1"] = "farming:tomato", - ["farming:wheat_1"] = "farming:seed_wheat", - ["farming:grapes_1"] = "farming:grapes", - ["farming:beans_1"] = "farming:beans", - ["farming:rhubarb_1"] = "farming:rhubarb", - ["farming:cocoa_1"] = "farming:cocoa_beans", - ["farming:barley_1"] = "farming:seed_barley", - ["farming:hemp_1"] = "farming:seed_hemp", -} +-- refill placed plant by crabman (26/08/2015) updated by TenPlus1 function farming.refill_plant(player, plantname, index) local inv = player:get_inventory() @@ -454,14 +390,14 @@ function farming.refill_plant(player, plantname, index) inv:set_stack("main", index, stack) stack:clear() inv:set_stack("main", i, stack) - --minetest.log("action", "farming: refilled stack("..plantname..") of " .. player:get_player_name() ) + return end end end --- Place Seeds on Soil +-- Place Seeds on Soil function farming.place_seed(itemstack, placer, pointed_thing, plantname) local pt = pointed_thing @@ -504,22 +440,25 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) -- if not protected then add node and remove 1 item from the itemstack if not minetest.is_protected(pt.above, placer:get_player_name()) then - minetest.set_node(pt.above, {name = plantname, param2 = 1}) + local p2 = minetest.registered_nodes[plantname].place_param2 or 1 + + minetest.set_node(pt.above, {name = plantname, param2 = p2}) minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) - if not minetest.setting_getbool("creative_mode") then + if not farming.is_creative(placer:get_player_name()) then + + local name = itemstack:get_name() itemstack:take_item() -- check for refill - if itemstack:get_count() == 0 - and can_refill_plant[plantname] then + if itemstack:get_count() == 0 then minetest.after(0.10, farming.refill_plant, placer, - can_refill_plant[plantname], + name, placer:get_wield_index() ) end @@ -529,26 +468,23 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname) end end --- Function to register plants (default farming compatibility) +-- Function to register plants (default farming compatibility) farming.register_plant = function(name, def) - local mname = name:split(":")[1] - local pname = name:split(":")[2] - - -- Check def table - if not def.description then - def.description = S("Seed") - end - - if not def.inventory_image then - def.inventory_image = "unknown_item.png" - end - if not def.steps then return nil end + local mname = name:split(":")[1] + local pname = name:split(":")[2] + + -- Check def + def.description = def.description or S("Seed") + def.inventory_image = def.inventory_image or "unknown_item.png" + def.minlight = def.minlight or 13 + def.maxlight = def.maxlight or 15 + -- Register seed minetest.register_node(":" .. mname .. ":seed_" .. pname, { @@ -563,6 +499,8 @@ farming.register_plant = function(name, def) walkable = false, sunlight_propagates = true, selection_box = farming.select, + place_param2 = def.place_param2 or nil, + next_plant = mname .. ":" .. pname .. "_1", on_place = function(itemstack, placer, pointed_thing) return farming.place_seed(itemstack, placer, @@ -592,7 +530,10 @@ farming.register_plant = function(name, def) } } - local g = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, growing = 1} + local g = { + snappy = 3, flammable = 2, plant = 1, growing = 1, + attached_node = 1, not_in_creative_inventory = 1, + } -- Last step doesn't need growing=1 so Abm never has to check these if i == def.steps then @@ -601,25 +542,35 @@ farming.register_plant = function(name, def) local node_name = mname .. ":" .. pname .. "_" .. i + local next_plant = nil + + if i < def.steps then + next_plant = mname .. ":" .. pname .. "_" .. (i + 1) + end + minetest.register_node(node_name, { drawtype = "plantlike", waving = 1, tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"}, paramtype = "light", + paramtype2 = def.paramtype2 or nil, + place_param2 = def.place_param2 or nil, walkable = false, buildable_to = true, drop = drop, selection_box = farming.select, groups = g, sounds = default.node_sound_leaves_defaults(), + minlight = def.minlight, + maxlight = def.maxlight, + next_plant = next_plant, }) register_plant_node(node_name) end -- Return info - local r = {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname} - return r + return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname} end @@ -641,8 +592,10 @@ farming.rhubarb = true farming.beans = true farming.grapes = true farming.barley = true +farming.chili = true farming.hemp = true farming.donuts = true +farming.rarety = 0.006 -- Load new global settings if found inside mod folder @@ -663,12 +616,16 @@ if input then end --- load crops +-- important items dofile(farming.path.."/soil.lua") dofile(farming.path.."/hoes.lua") dofile(farming.path.."/grass.lua") + +-- default crops dofile(farming.path.."/wheat.lua") dofile(farming.path.."/cotton.lua") + +-- additional crops and food (if enabled) if farming.carrot then dofile(farming.path.."/carrot.lua") end if farming.potato then dofile(farming.path.."/potato.lua") end if farming.tomato then dofile(farming.path.."/tomato.lua") end @@ -685,8 +642,10 @@ if farming.rhubarb then dofile(farming.path.."/rhubarb.lua") end if farming.beans then dofile(farming.path.."/beanpole.lua") end if farming.grapes then dofile(farming.path.."/grapes.lua") end if farming.barley then dofile(farming.path.."/barley.lua") end +if farming.chili then dofile(farming.path.."/chili.lua") end if farming.hemp then dofile(farming.path.."/hemp.lua") end if farming.donuts then dofile(farming.path.."/donut.lua") end + dofile(farming.path.."/mapgen.lua") dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility dofile(farming.path.."/lucky_block.lua") diff --git a/farming/intllib.lua b/farming/intllib.lua new file mode 100644 index 0000000..6669d72 --- /dev/null +++ b/farming/intllib.lua @@ -0,0 +1,45 @@ + +-- Fallback functions for when `intllib` is not installed. +-- Code released under Unlicense . + +-- Get the latest version of this file at: +-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua + +local function format(str, ...) + local args = { ... } + local function repl(escape, open, num, close) + if escape == "" then + local replacement = tostring(args[tonumber(num)]) + if open == "" then + replacement = replacement..close + end + return replacement + else + return "@"..open..num..close + end + end + return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl)) +end + +local gettext, ngettext +if minetest.get_modpath("intllib") then + if intllib.make_gettext_pair then + -- New method using gettext. + gettext, ngettext = intllib.make_gettext_pair() + else + -- Old method using text files. + gettext = intllib.Getter() + end +end + +-- Fill in missing functions. + +gettext = gettext or function(msgid, ...) + return format(msgid, ...) +end + +ngettext = ngettext or function(msgid, msgid_plural, n, ...) + return format(n==1 and msgid or msgid_plural, ...) +end + +return gettext, ngettext diff --git a/farming/locale/de.po b/farming/locale/de.po new file mode 100644 index 0000000..1db5d72 --- /dev/null +++ b/farming/locale/de.po @@ -0,0 +1,262 @@ +# German Translation for farming mod. +# Copyright (C) 2017 +# This file is distributed under the same license as the farming package. +# Xanthin. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: 1.27\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-31 HO:MI+ZONE\n" +"PO-Revision-Date: 2016-03-31 HO:MI+ZONE\n" +"Last-Translator: Xanthin\n" +"Language-Team: \n" +"Language: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "Gerstenkörner" + +#: barley.lua +msgid "Barley" +msgstr "Gerste" + +#: beanpole.lua +msgid "Green Beans" +msgstr "Grüne Bohnen" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "Bohnenstange (vor dem Pflanzen der Bohnen auf den\nAckerboden stellen)" + +#: blueberry.lua +msgid "Blueberries" +msgstr "Blaubeeren" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "Blaubeermuffin" + +#: carrot.lua +msgid "Carrot" +msgstr "Möhre" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "Goldene Möhre" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "Kakaobohne" + +#: cocoa.lua +msgid "Cookie" +msgstr "Keks" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "Tafel Zartbitterschokolade" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "Kaffeebohnen" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "Tasse (leer)" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "Kalte Tasse Kaffee" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "Heiße Tasse Kaffee" + +#: corn.lua +msgid "Corn" +msgstr "Mais" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Maiskolben" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "Flasche Ethanol" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "Baumwollsamen" + +#: cotton.lua +msgid "Cotton" +msgstr "Baumwolle" + +#: cucumber.lua +msgid "Cucumber" +msgstr "Gurke" + +#: donut.lua +msgid "Donut" +msgstr "Donut" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "Schokodonut" + +#: donut.lua +msgid "Apple Donut" +msgstr "Apfeldonut" + +#: grapes.lua +msgid "Grapes" +msgstr "Weintrauben" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen)" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "" + +#: ???? +msgid "Hoe" +msgstr "Hacke" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "Holzhacke" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "Steinhacke" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "Stahlhacke" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "Bronzehacke" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "Mesehacke" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "Diamanthacke" + +#: init.lua +msgid "Seed" +msgstr "Saatgut" + +#: melon.lua +msgid "Melon Slice" +msgstr "Melonenscheibe" + +#: melon.lua +msgid "Melon" +msgstr "Melone" + +#: potato.lua +msgid "Potato" +msgstr "Kartoffel" + +#: potato.lua +msgid "Baked Potato" +msgstr "Ofenkartoffel" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Kürbis" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "Kürbisscheibe" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "Kürbislaterne (Punch zum Ein- und Ausschalten)" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "Kürbisbrot" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "Kürbisteig" + +#: raspberry.lua +msgid "Raspberries" +msgstr "Himbeeren" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "Himbeersmoothie" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "Rhabarber" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "Rhabarberkuchen" + +#: soil.lua +msgid "Soil" +msgstr "Ackerboden" + +#: soil.lua +msgid "Wet Soil" +msgstr "Bewässerter Ackerboden" + +#: sugar.lua +msgid "Sugar" +msgstr "Zucker" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "Weizenkörner" + +#: wheat.lua +msgid "Wheat" +msgstr "Weizen" + +#: wheat.lua +msgid "Straw" +msgstr "Stroh" + +#: wheat.lua +msgid "Flour" +msgstr "Mehl" + +#: wheat.lua +msgid "Bread" +msgstr "Brot" diff --git a/farming/locale/pt.po b/farming/locale/pt.po new file mode 100644 index 0000000..bc4352f --- /dev/null +++ b/farming/locale/pt.po @@ -0,0 +1,258 @@ +# Portuguese Translation for farming mod. +# Copyright (C) 2017 +# This file is distributed under the same license as the farming package. +# BrunoMine , 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: 1.27\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-16 17:38-0300\n" +"PO-Revision-Date: 2017-08-17 17:01-0300\n" +"Last-Translator: BrunoMine \n" +"Language-Team: \n" +"Language: Portuguese\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Gtranslator 2.91.7\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "Sementes de Cevada" + +#: barley.lua +msgid "Barley" +msgstr "Cevada" + +#: beanpole.lua +msgid "Green Beans" +msgstr "Feijoes Verdes" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "Apoio de feijao (coloque no solo antes de plantar feijao)" + +#: blueberry.lua +msgid "Blueberries" +msgstr "Mirtilos" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "Muffin de Mirtilos" + +#: carrot.lua +msgid "Carrot" +msgstr "Cenoura" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "Cenoura Dourada" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "Amendoas de Cacau" + +#: cocoa.lua +msgid "Cookie" +msgstr "Cookie" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "Barra de Chocolate Preto" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "Grao de Cafe" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "Xicara (vazia)" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "Xicara de Cafe Frio" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "Xicara de Cafe Quente" + +#: corn.lua +msgid "Corn" +msgstr "Milho" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "Espiga de Milho" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "Garrafa de Etanol" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "Sementes de Algodao" + +#: cotton.lua +msgid "Cotton" +msgstr "Algodao" + +#: cucumber.lua +msgid "Cucumber" +msgstr "Pepino" + +#: donut.lua +msgid "Donut" +msgstr "Donut" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "Donut de Chocolate" + +#: donut.lua +msgid "Apple Donut" +msgstr "Donut de Maça" + +#: grapes.lua +msgid "Grapes" +msgstr "Uvas" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "Grade de Ripas (colocar no solo antes de plantar uvas)" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "Sementes de Canhamo" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "Folha de Canhamo" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "Garrafa de Oleo de Canhamo" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "Fibra de Canhamo" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "Corda de Canhamo" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "Enxada de Madeira" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "Enxada de Pedra" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "Enxada de Aço" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "Enxada de Bronze" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "Enxada de Mese" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "Enxada de Diamante" + +#: init.lua +msgid "Seed" +msgstr "Sementes" + +#: melon.lua +msgid "Melon Slice" +msgstr "Sementes de Melancia" + +#: melon.lua +msgid "Melon" +msgstr "Melancia" + +#: potato.lua +msgid "Potato" +msgstr "Batata" + +#: potato.lua +msgid "Baked Potato" +msgstr "Batata Cozida" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "Abobora" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "Pedaço de Abobora" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "Jack 'O Lantern (Socos para ligar e desligar)" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "Pao de Abobora" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "Massa de Abobora" + +#: raspberry.lua +msgid "Raspberries" +msgstr "Framboesa" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "Batida de Framboesa" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "Ruibarbo" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "Torta de Ruibarbo" + +#: soil.lua +msgid "Soil" +msgstr "Solo" + +#: soil.lua +msgid "Wet Soil" +msgstr "Solo Seco" + +#: sugar.lua +msgid "Sugar" +msgstr "Açucar" + +#: tomato.lua +msgid "Tomato" +msgstr "Tomate" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "Sementes de Trigo" + +#: wheat.lua +msgid "Wheat" +msgstr "Trigo" + +#: wheat.lua +msgid "Straw" +msgstr "Palha" + +#: wheat.lua +msgid "Flour" +msgstr "Farinha" + +#: wheat.lua +msgid "Bread" +msgstr "Pao" diff --git a/farming/locale/template.pot b/farming/locale/template.pot new file mode 100644 index 0000000..210d946 --- /dev/null +++ b/farming/locale/template.pot @@ -0,0 +1,258 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-08-16 17:38-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: barley.lua +msgid "Barley Seed" +msgstr "" + +#: barley.lua +msgid "Barley" +msgstr "" + +#: beanpole.lua +msgid "Green Beans" +msgstr "" + +#: beanpole.lua +msgid "Bean Pole (place on soil before planting beans)" +msgstr "" + +#: blueberry.lua +msgid "Blueberries" +msgstr "" + +#: blueberry.lua +msgid "Blueberry Muffin" +msgstr "" + +#: carrot.lua +msgid "Carrot" +msgstr "" + +#: carrot.lua +msgid "Golden Carrot" +msgstr "" + +#: cocoa.lua +msgid "Cocoa Beans" +msgstr "" + +#: cocoa.lua +msgid "Cookie" +msgstr "" + +#: cocoa.lua +msgid "Bar of Dark Chocolate" +msgstr "" + +#: coffee.lua +msgid "Coffee Beans" +msgstr "" + +#: coffee.lua +msgid "Drinking Cup (empty)" +msgstr "" + +#: coffee.lua +msgid "Cold Cup of Coffee" +msgstr "" + +#: coffee.lua +msgid "Hot Cup of Coffee" +msgstr "" + +#: corn.lua +msgid "Corn" +msgstr "" + +#: corn.lua +msgid "Corn on the Cob" +msgstr "" + +#: corn.lua +msgid "Bottle of Ethanol" +msgstr "" + +#: cotton.lua +msgid "Cotton Seed" +msgstr "" + +#: cotton.lua +msgid "Cotton" +msgstr "" + +#: cucumber.lua +msgid "Cucumber" +msgstr "" + +#: donut.lua +msgid "Donut" +msgstr "" + +#: donut.lua +msgid "Chocolate Donut" +msgstr "" + +#: donut.lua +msgid "Apple Donut" +msgstr "" + +#: grapes.lua +msgid "Grapes" +msgstr "" + +#: grapes.lua +msgid "Trellis (place on soil before planting grapes)" +msgstr "" + +#: hemp.lua +msgid "Hemp Seed" +msgstr "" + +#: hemp.lua +msgid "Hemp Leaf" +msgstr "" + +#: hemp.lua +msgid "Bottle of Hemp Oil" +msgstr "" + +#: hemp.lua +msgid "Hemp Fibre" +msgstr "" + +#: hemp.lua +msgid "Hemp Rope" +msgstr "" + +#: hoes.lua +msgid "Wooden Hoe" +msgstr "" + +#: hoes.lua +msgid "Stone Hoe" +msgstr "" + +#: hoes.lua +msgid "Steel Hoe" +msgstr "" + +#: hoes.lua +msgid "Bronze Hoe" +msgstr "" + +#: hoes.lua +msgid "Mese Hoe" +msgstr "" + +#: hoes.lua +msgid "Diamond Hoe" +msgstr "" + +#: init.lua +msgid "Seed" +msgstr "" + +#: melon.lua +msgid "Melon Slice" +msgstr "" + +#: melon.lua +msgid "Melon" +msgstr "" + +#: potato.lua +msgid "Potato" +msgstr "" + +#: potato.lua +msgid "Baked Potato" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin Slice" +msgstr "" + +#: pumpkin.lua +msgid "Jack 'O Lantern (punch to turn on and off)" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin Bread" +msgstr "" + +#: pumpkin.lua +msgid "Pumpkin Dough" +msgstr "" + +#: raspberry.lua +msgid "Raspberries" +msgstr "" + +#: raspberry.lua +msgid "Raspberry Smoothie" +msgstr "" + +#: rhubarb.lua +msgid "Rhubarb" +msgstr "" + +#: rhubarb.lua +msgid "Rhubarb Pie" +msgstr "" + +#: soil.lua +msgid "Soil" +msgstr "" + +#: soil.lua +msgid "Wet Soil" +msgstr "" + +#: sugar.lua +msgid "Sugar" +msgstr "" + +#: tomato.lua +msgid "Tomato" +msgstr "" + +#: wheat.lua +msgid "Wheat Seed" +msgstr "" + +#: wheat.lua +msgid "Wheat" +msgstr "" + +#: wheat.lua +msgid "Straw" +msgstr "" + +#: wheat.lua +msgid "Flour" +msgstr "" + +#: wheat.lua +msgid "Bread" +msgstr "" diff --git a/farming/lucky_block.lua b/farming/lucky_block.lua index 94d7d36..01b4c27 100644 --- a/farming/lucky_block.lua +++ b/farming/lucky_block.lua @@ -15,5 +15,7 @@ if minetest.get_modpath("lucky_block") then {"nod", "farming:melon", 0}, {"dro", {"farming:donut", "farming:donut_chocolate", "farming:donut_apple"}, 5}, {"dro", {"farming:hemp_leaf", "farming:hemp_fibre", "farming:seed_hemp"}, 5}, + {"nod", "fire:permanent_flame", 1}, + {"dro", {"farming:chili_pepper", "farming:chili_bowl"}, 5}, }) end diff --git a/farming/mapgen.lua b/farming/mapgen.lua index 090c193..929f181 100644 --- a/farming/mapgen.lua +++ b/farming/mapgen.lua @@ -12,7 +12,7 @@ local function register_plant(name, min, max, spawnby, num, enabled) sidelen = 16, noise_params = { offset = 0, - scale = 0.006, + scale = farming.rarety, -- 0.006, spread = {x = 100, y = 100, z = 100}, seed = 329, octaves = 3, @@ -60,7 +60,7 @@ minetest.register_decoration({ sidelen = 16, noise_params = { offset = 0, - scale = 0.06, + scale = farming.rarety, -- 0.06, spread = {x = 100, y = 100, z = 100}, seed = 420, octaves = 3, @@ -73,3 +73,24 @@ minetest.register_decoration({ num_spawn_by = 1, }) end + +if farming.chili then +minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass", "default:dirt_with_rainforest_litter"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = farming.rarety, -- 0.06, + spread = {x = 100, y = 100, z = 100}, + seed = 760, + octaves = 3, + persist = 0.6 + }, + y_min = 5, + y_max = 35, + decoration = {"farming:chili_8"}, + spawn_by = "group:tree", + num_spawn_by = 1, +}) +end diff --git a/farming/textures/farming_chili_1.png b/farming/textures/farming_chili_1.png new file mode 100644 index 0000000..aa11988 Binary files /dev/null and b/farming/textures/farming_chili_1.png differ diff --git a/farming/textures/farming_chili_2.png b/farming/textures/farming_chili_2.png new file mode 100644 index 0000000..ae34506 Binary files /dev/null and b/farming/textures/farming_chili_2.png differ diff --git a/farming/textures/farming_chili_3.png b/farming/textures/farming_chili_3.png new file mode 100644 index 0000000..5e1d901 Binary files /dev/null and b/farming/textures/farming_chili_3.png differ diff --git a/farming/textures/farming_chili_4.png b/farming/textures/farming_chili_4.png new file mode 100644 index 0000000..d97769b Binary files /dev/null and b/farming/textures/farming_chili_4.png differ diff --git a/farming/textures/farming_chili_5.png b/farming/textures/farming_chili_5.png new file mode 100644 index 0000000..dd4755d Binary files /dev/null and b/farming/textures/farming_chili_5.png differ diff --git a/farming/textures/farming_chili_6.png b/farming/textures/farming_chili_6.png new file mode 100644 index 0000000..4ee057b Binary files /dev/null and b/farming/textures/farming_chili_6.png differ diff --git a/farming/textures/farming_chili_7.png b/farming/textures/farming_chili_7.png new file mode 100644 index 0000000..5912c2e Binary files /dev/null and b/farming/textures/farming_chili_7.png differ diff --git a/farming/textures/farming_chili_8.png b/farming/textures/farming_chili_8.png new file mode 100644 index 0000000..976eb52 Binary files /dev/null and b/farming/textures/farming_chili_8.png differ diff --git a/farming/textures/farming_chili_bowl.png b/farming/textures/farming_chili_bowl.png new file mode 100644 index 0000000..6454ba3 Binary files /dev/null and b/farming/textures/farming_chili_bowl.png differ diff --git a/farming/textures/farming_chili_pepper.png b/farming/textures/farming_chili_pepper.png new file mode 100644 index 0000000..922cec4 Binary files /dev/null and b/farming/textures/farming_chili_pepper.png differ diff --git a/farming/textures/farming_cotton.png b/farming/textures/farming_cotton.png index e2bbfd7..8aa50e4 100644 Binary files a/farming/textures/farming_cotton.png and b/farming/textures/farming_cotton.png differ diff --git a/farming/textures/farming_porridge.png b/farming/textures/farming_porridge.png new file mode 100644 index 0000000..cd4466f Binary files /dev/null and b/farming/textures/farming_porridge.png differ diff --git a/farming/textures/farming_string.png b/farming/textures/farming_string.png new file mode 100644 index 0000000..e2bbfd7 Binary files /dev/null and b/farming/textures/farming_string.png differ diff --git a/farming/wheat.lua b/farming/wheat.lua index 65e5ce6..79988b6 100644 --- a/farming/wheat.lua +++ b/farming/wheat.lua @@ -8,7 +8,7 @@ minetest.register_node("farming:seed_wheat", { inventory_image = "farming_wheat_seed.png", wield_image = "farming_wheat_seed.png", drawtype = "signlike", - groups = {seed = 1, snappy = 3, attached_node = 1}, + groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4}, paramtype = "light", paramtype2 = "wallmounted", walkable = false, @@ -23,6 +23,7 @@ minetest.register_node("farming:seed_wheat", { minetest.register_craftitem("farming:wheat", { description = S("Wheat"), inventory_image = "farming_wheat.png", + groups = {flammable = 4}, }) -- straw @@ -30,7 +31,7 @@ minetest.register_node("farming:straw", { description = S("Straw"), tiles = {"farming_straw.png"}, is_ground_content = false, - groups = {snappy = 3, flammable = 4}, + groups = {snappy = 3, flammable = 4, fall_damage_add_percent = -30}, sounds = default.node_sound_leaves_defaults(), }) @@ -54,6 +55,7 @@ minetest.register_craft({ minetest.register_craftitem("farming:flour", { description = S("Flour"), inventory_image = "farming_flour.png", + groups = {flammable = 1}, }) minetest.register_craft({ @@ -67,6 +69,7 @@ minetest.register_craftitem("farming:bread", { description = S("Bread"), inventory_image = "farming_bread.png", on_use = minetest.item_eat(5), + groups = {flammable = 2}, }) minetest.register_craft({ @@ -81,13 +84,15 @@ local crop_def = { drawtype = "plantlike", tiles = {"farming_wheat_1.png"}, paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, sunlight_propagates = true, walkable = false, buildable_to = true, drop = "", selection_box = farming.select, groups = { - snappy = 3, flammable = 2, plant = 1, attached_node = 1, + snappy = 3, flammable = 4, plant = 1, attached_node = 1, not_in_creative_inventory = 1, growing = 1 }, sounds = default.node_sound_leaves_defaults() @@ -152,3 +157,16 @@ crop_def.drop = { } } minetest.register_node("farming:wheat_8", table.copy(crop_def)) + +-- fuels +minetest.register_craft({ + type = "fuel", + recipe = "farming:straw", + burntime = 3, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:wheat", + burntime = 1, +}) -- cgit v1.2.3