diff --git a/mods/README.md b/mods/README.md index 4633239..158776e 100644 --- a/mods/README.md +++ b/mods/README.md @@ -5,28 +5,31 @@ For information check [../README.md](../README.md) ## Content -* api -* beds -* bucket -* bones -* boats -* creative -* default -* doors -* farming -* fire -* give_initial_stuff -* stairs -* carts -* dye -* flowers -* screwdriver -* tnt -* xpanes -* sfinv -* vessels -* walls -* wool +| mod name | origin or work | version | info | +| ------------------ | --------------------------------------------------- | -------- | --- | +| api | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | [api](../game_api.md) | +| beds | https://codeberg.org/minenux/minetest-mod-beds | https://codeberg.org/minenux/minetest-mod-beds/commit/7b6fae96d5e273dad9a373e63eb958145c9bfbef | [beds/README.md](beds/README.md) | +| boats | https://codeberg.org/minenux/minetest-mod-boats | https://codeberg.org/minenux/minetest-mod-boats/commit/3832de08f705d5d2e7b5a971760e5fad1653305f | [boats/README.md](boats/README.md) | +| bucket | https://codeberg.org/minenux/minetest-mod-bucket.git | https://codeberg.org/minenux/minetest-mod-bucket/commit/1d9f32295aba3ef2a86be302050f34c1766e93d5 | [bucket/README.md](bucket/README.md) | +| bones | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| carts | https://codeberg.org/minenux/minetest-mod-carts | https://codeberg.org/minenux/minetest-mod-carts/commit/dcbca916cffdcec281f0129ef350db2686bda933 | [carts/README.md](carts/README.md) | +| creative | https://codeberg.org/minenux/minetest-mod-creative | https://codeberg.org/minenux/minetest-mod-creative/commit/ca09e773701f834fec7de18bf13598b3323778db | [creative/README.md](creative/README.md) | +| default | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| doors | https://codeberg.org/minenux/minetest-mod-doors | https://codeberg.org/minenux/minetest-mod-doors/commit/a89ab0454deb4933b6e4971c57055c40b7938e5b | [doors/README.md](doors/README.md) | +| dye | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| farming | https://codeberg.org/minenux/minetest-mod-farming | https://codeberg.org/minenux/minetest-mod-farming/commit/10de84d12d24a87f3aa9abef73f87c6cebb2614c | [farming/README.md](farming/README.md) | +| fire | https://codeberg.org/minenux/minetest-mod-fire | https://codeberg.org/minenux/minetest-mod-fire/commit/4e5f7ad55314bd9b126fb133cfc5a32fa58b20d2 | [fire/README.md](fire/README.md) | +| flowers | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| give_initial_stuff | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| killme | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| sfinv | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| stairs | https://codeberg.org/minenux/minetest-mod-stairs | https://codeberg.org/minenux/minetest-mod-stairs/commit/c3a5af6c452daca599d226df694df1b75f15c110 | [stairs/README.md](stairs/README.md) | +| screwdriver | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| tnt | https://codeberg.org/minenux/minetest-mod-tnt | https://codeberg.org/minenux/minetest-mod-tnt/commit/8195861f905a90b53cd52348deb34df41a053027 | [tnt/README.md](tnt/README.md) | +| vessels | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| walls | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | +| wool | https://codeberg.org/minenux/minetest-mod-wool | https://codeberg.org/minenux/minetest-mod-wool/commit/de642a08e80bfd7a4a1e5629e50458a609dbda3a | [wool/README.md](wool/README.md) | +| xpanes | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | | The default mod provides sethome and player_api call ones, binoculars from v5 are just separate privilegies for zoom, butterflies and fireflies from v5 can be set diff --git a/mods/beds/Changelog.txt b/mods/beds/Changelog.txt new file mode 100644 index 0000000..c9d005c --- /dev/null +++ b/mods/beds/Changelog.txt @@ -0,0 +1,26 @@ +1.0.1 beta +---------- +- Add backwards compatibility with PilzAdam's beds mod +- Fix placement +- Fix small bugs +- Prevent possible crash + +1.1 +--- +- Add fancy bed model (based on jp's model) +- Add API to register beds +- Allow players always to detach from bed (by donat-b) +- If more than 50% of players want sleep they can skip the night +- Don't show sleep dialog in singleplayer + +1.1.1 +----- +- Prevent possbile crash by trying to reposition leaving players + +1.2 +--- +- Updated to use default bed functions +- Texture check to fix beds using old api +- 'bed_sleep_divide' setting added [1 for all, 2 for half, 3 for third] +- Add POVA support +- Add pink fancy bed and blue simple bed diff --git a/mods/beds/README.md b/mods/beds/README.md new file mode 100644 index 0000000..64f0790 --- /dev/null +++ b/mods/beds/README.md @@ -0,0 +1,96 @@ +minetest mod Beds +========================= + +This mod improves beds which allows sleep, featured to (auto) skip the night. + +Information +----------- + +This mod is named `beds` to sleep, by rightclick the bed. It featured +in singleplayer mode that the night gets skipped immediately. If playing +in multiplayer you get shown how many other players are in bed too, +if all players are sleeping the night gets skipped. + +![screenshot.jpg](screenshot.jpg) + +Tech information +---------------- + +This mod sustitute default one, you must disable the default of minetest +game if present or override it. + +#### Features + +* Night Skypping: + +This mod auto featured night skip in singleplayer, in multiplayer it skipped +if more than a set percentage (default 50%) of the players are lying +in bed and use this option. Check configuration section for more info. + +* Controlled respawning: + +If you have slept in bed (not just lying in it) your respawn point +is set to the beds location and you will respawn there after +death. Check configuration section for more info. + +* More beds: + +It features two more beds, the "Blue Simple Bed" like the "Simple Bed" +but in blue, and the "Pink Fancy Bed" like the "Fancy Bed" but in pink. + +#### Dependencies + +* default +* player_api (for newer engines) + +Optional dependences: + +* intllib (only for older engines) +* pova (optional) + +The pova mod are not xplicit set as optional depends, due the circular depends bug, +its detected and used. + +#### Configuration + +| Configuration | type | default | place file | Notes about | +| --------------------- | ----- | ------- | ------------ | ----------------------------------------- | +| enable_bed_respawn | bool | true | minetest.conf | Enable respawn point set to last sleep bed | +| enable_bed_night_skip | bool | false | minetest.conf | You can disable the night skip feature | +| bed_sleep_divide | int | 2 | minetest.conf | Division of players needed to skip night | + +#### Nodes + +Crafting are same as original default mod, but colored uses a white plus the other color. + +| Node name | Description name | +| ----------------------- | --------------------- | +| beds:bed | Simple bed | +| beds:bed_blue | Simple bed blue | +| beds:fancy_bed | Fancy shaped bed | +| beds:fancy_bed_pink | Fancy shaped bed pink | + +#### Nodes and Aliasing + +| mod name : node name | new mod name : new node | +| --------------------------- | ----------------------- | +| beds:bed_top_red | beds:bed_top | +| beds:bed_bottom_red | beds:bed_bottom | + +License +------ + +### Authors of source code + +Originally by BlockMen (MIT) +Various Minetest developers and contributors (MIT) + +### Authors of media (textures) + +BlockMen (CC BY-SA 3.0) + All textures unless otherwise noted + +JP (WTFPL) + All models unless otherwise noted + +Check [license.txt](license.txt) diff --git a/mods/beds/README.txt b/mods/beds/README.txt deleted file mode 100644 index cda6ebd..0000000 --- a/mods/beds/README.txt +++ /dev/null @@ -1,26 +0,0 @@ -Minetest Game mod: beds -======================= -See license.txt for license information. - -Authors of source code ----------------------- -Originally by BlockMen (MIT) -Various Minetest developers and contributors (MIT) - -Authors of media (textures) ---------------------------- -BlockMen (CC BY-SA 3.0) - -This mod adds a bed to Minetest which allows to skip the night. -To sleep, rightclick the bed. If playing in singleplayer mode the night gets skipped -immediately. If playing multiplayer you get shown how many other players are in bed too, -if all players are sleeping the night gets skipped. The night skip can be forced if more -than 50% of the players are lying in bed and use this option. - -Another feature is a controlled respawning. If you have slept in bed (not just lying in -it) your respawn point is set to the beds location and you will respawn there after -death. -You can disable the respawn at beds by setting "enable_bed_respawn = false" in -minetest.conf. -You can disable the night skip feature by setting "enable_bed_night_skip = false" in -minetest.conf or by using the /set command in-game. diff --git a/mods/beds/api.lua b/mods/beds/api.lua index 9349545..dde678e 100644 --- a/mods/beds/api.lua +++ b/mods/beds/api.lua @@ -1,61 +1,62 @@ -local reverse = true - -local function destruct_bed(pos, n) - local node = minetest.get_node(pos) - local other - - if n == 2 then - local dir = minetest.facedir_to_dir(node.param2) - other = vector.subtract(pos, dir) - elseif n == 1 then - local dir = minetest.facedir_to_dir(node.param2) - other = vector.add(pos, dir) - end - - if reverse then - reverse = not reverse - minetest.remove_node(other) - minetest.check_for_falling(other) - else - reverse = not reverse - end -end - function beds.register_bed(name, def) - minetest.register_node(name .. "_bottom", { + + local new_tiles + local new_mesh = "beds_simple_bed.obj" + + -- old api texture check + if def.tiles and def.tiles.bottom then + + new_tiles = "beds_simple_bed.png" -- default + + -- check for fancy bed + if def.nodebox and def.nodebox.bottom and #def.nodebox.bottom > 3 then + new_tiles = "beds_fancy_bed.png" + new_mesh = "beds_fancy_bed.obj" + end + end + + -- register bed node + minetest.register_node(name, { description = def.description, inventory_image = def.inventory_image, wield_image = def.wield_image, - drawtype = "nodebox", - tiles = def.tiles.bottom, + drawtype = "mesh", + mesh = def.mesh or new_mesh, + tiles = new_tiles or def.tiles, paramtype = "light", paramtype2 = "facedir", - is_ground_content = false, stack_max = 1, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1}, - sounds = def.sounds or default.node_sound_wood_defaults(), - node_box = { - type = "fixed", - fixed = def.nodebox.bottom, + groups = { + choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1, + fall_damage_add_percent = -40, bouncy = 85 }, + sounds = default.node_sound_wood_defaults(), selection_box = { type = "fixed", - fixed = def.selectionbox, + fixed = def.selectionbox + }, + collision_box = { + type = "fixed", + fixed = def.collisionbox }, on_place = function(itemstack, placer, pointed_thing) + local under = pointed_thing.under local node = minetest.get_node(under) local udef = minetest.registered_nodes[node.name] - if udef and udef.on_rightclick and - not (placer and placer:is_player() and - placer:get_player_control().sneak) then + + if udef and udef.on_rightclick + and not (placer and placer:is_player() + and placer:get_player_control().sneak) then + return udef.on_rightclick(under, node, placer, itemstack, pointed_thing) or itemstack end local pos + if udef and udef.buildable_to then pos = under else @@ -64,13 +65,16 @@ function beds.register_bed(name, def) local player_name = placer and placer:get_player_name() or "" - if minetest.is_protected(pos, player_name) and - not minetest.check_player_privs(player_name, "protection_bypass") then + if minetest.is_protected(pos, player_name) + and not minetest.check_player_privs(player_name, "protection_bypass") then + minetest.record_protection_violation(pos, player_name) + return itemstack end local node_def = minetest.registered_nodes[minetest.get_node(pos).name] + if not node_def or not node_def.buildable_to then return itemstack end @@ -79,91 +83,46 @@ function beds.register_bed(name, def) minetest.dir_to_facedir(placer:get_look_dir()) or 0 local botpos = vector.add(pos, minetest.facedir_to_dir(dir)) - if minetest.is_protected(botpos, player_name) and - not minetest.check_player_privs(player_name, "protection_bypass") then + if minetest.is_protected(botpos, player_name) + and not minetest.check_player_privs(player_name, "protection_bypass") then + minetest.record_protection_violation(botpos, player_name) + return itemstack end local botdef = minetest.registered_nodes[minetest.get_node(botpos).name] + if not botdef or not botdef.buildable_to then return itemstack end - minetest.set_node(pos, {name = name .. "_bottom", param2 = dir}) - minetest.set_node(botpos, {name = name .. "_top", param2 = dir}) + minetest.set_node(pos, {name = name, param2 = dir}) - if not (creative and creative.is_enabled_for - and creative.is_enabled_for(player_name)) then + if not beds.is_creative(player_name) then itemstack:take_item() end + return itemstack end, - on_destruct = function(pos) - destruct_bed(pos, 1) - end, - - on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + on_rightclick = function(pos, node, clicker) beds.on_rightclick(pos, clicker) - return itemstack end, - on_rotate = function(pos, node, user, mode, new_param2) - local dir = minetest.facedir_to_dir(node.param2) - local p = vector.add(pos, dir) - local node2 = minetest.get_node_or_nil(p) - if not node2 or not minetest.get_item_group(node2.name, "bed") == 2 or - not node.param2 == node2.param2 then - return false - end - if minetest.is_protected(p, user:get_player_name()) then - minetest.record_protection_violation(p, user:get_player_name()) - return false - end - if mode ~= screwdriver.ROTATE_FACE then - return false - end - local newp = vector.add(pos, minetest.facedir_to_dir(new_param2)) - local node3 = minetest.get_node_or_nil(newp) - local node_def = node3 and minetest.registered_nodes[node3.name] - if not node_def or not node_def.buildable_to then - return false - end - if minetest.is_protected(newp, user:get_player_name()) then - minetest.record_protection_violation(newp, user:get_player_name()) - return false - end - node.param2 = new_param2 - -- do not remove_node here - it will trigger destroy_bed() - minetest.set_node(p, {name = "air"}) - minetest.set_node(pos, node) - minetest.set_node(newp, {name = name .. "_top", param2 = new_param2}) - return true - end, - }) - - minetest.register_node(name .. "_top", { - drawtype = "nodebox", - tiles = def.tiles.top, - paramtype = "light", - paramtype2 = "facedir", - is_ground_content = false, - pointable = false, - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2}, - sounds = def.sounds or default.node_sound_wood_defaults(), - drop = name .. "_bottom", - node_box = { - type = "fixed", - fixed = def.nodebox.top, - }, on_destruct = function(pos) - destruct_bed(pos, 2) + beds.remove_spawns_at(pos) end, + + can_dig = function(pos, player) + return beds.can_dig(pos) + end }) - minetest.register_alias(name, name .. "_bottom") + minetest.register_alias(name .. "_bottom", name) + minetest.register_alias(name .. "_top", "air") + -- register recipe minetest.register_craft({ output = name, recipe = def.recipe diff --git a/mods/beds/beds.lua b/mods/beds/beds.lua index bb2fd5d..f544839 100644 --- a/mods/beds/beds.lua +++ b/mods/beds/beds.lua @@ -1,87 +1,65 @@ +local S = beds.get_translator + -- Fancy shaped bed beds.register_bed("beds:fancy_bed", { - description = "Fancy Bed", + description = S("Fancy Bed"), inventory_image = "beds_bed_fancy.png", wield_image = "beds_bed_fancy.png", - tiles = { - bottom = { - "beds_bed_top1.png", - "default_wood.png", - "beds_bed_side1.png", - "beds_bed_side1.png^[transformFX", - "default_wood.png", - "beds_bed_foot.png", - }, - top = { - "beds_bed_top2.png", - "default_wood.png", - "beds_bed_side2.png", - "beds_bed_side2.png^[transformFX", - "beds_bed_head.png", - "default_wood.png", - } - }, - nodebox = { - bottom = { - {-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375}, - {0.375, -0.5, -0.5, 0.5, -0.065, -0.4375}, - {-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375}, - {-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5}, - {0.4375, -0.375, -0.5, 0.5, -0.125, 0.5}, - {-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5}, - }, - top = { - {-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5}, - {0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5}, - {-0.5, 0, 0.4375, 0.5, 0.125, 0.5}, - {-0.5, -0.375, 0.4375, 0.5, -0.125, 0.5}, - {-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5}, - {0.4375, -0.375, -0.5, 0.5, -0.125, 0.5}, - {-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375}, - } - }, - selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5}, + tiles = {"beds_fancy_bed.png", "default_wood.png"}, + mesh = "beds_fancy_bed.obj", + selectionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5}, + collisionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5}, recipe = { {"", "", "group:stick"}, - {"wool:red", "wool:red", "wool:white"}, - {"group:wood", "group:wood", "group:wood"}, - }, + {"wool:white", "wool:white", "wool:white"}, + {"group:wood", "group:wood", "group:wood"} + } +}) + +beds.register_bed("beds:fancy_bed_pink", { + description = S("Pink Fancy Bed"), + inventory_image = "beds_bed_fancy_pink.png", + wield_image = "beds_bed_fancy_pink.png", + tiles = {"beds_fancy_bed_pink.png", "default_wood.png"}, + mesh = "beds_fancy_bed.obj", + selectionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5}, + collisionbox = {-0.5, -0.5, -0.5, 0.5, -0.06, 1.5}, + recipe = { + {"", "", "group:stick"}, + {"wool:pink", "wool:pink", "wool:white"}, + {"group:wood", "group:wood", "group:wood"} + } }) -- Simple shaped bed beds.register_bed("beds:bed", { - description = "Simple Bed", + description = S("Simple Bed"), inventory_image = "beds_bed.png", wield_image = "beds_bed.png", - tiles = { - bottom = { - "beds_bed_top_bottom.png^[transformR90", - "default_wood.png", - "beds_bed_side_bottom_r.png", - "beds_bed_side_bottom_r.png^[transformfx", - "beds_transparent.png", - "beds_bed_side_bottom.png" - }, - top = { - "beds_bed_top_top.png^[transformR90", - "default_wood.png", - "beds_bed_side_top_r.png", - "beds_bed_side_top_r.png^[transformfx", - "beds_bed_side_top.png", - "beds_transparent.png", - } - }, - nodebox = { - bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5}, - top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5}, - }, + tiles = {"beds_simple_bed.png"}, + mesh = "beds_simple_bed.obj", selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5}, + collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5}, recipe = { - {"wool:red", "wool:red", "wool:white"}, + {"wool:white", "wool:white", "wool:white"}, {"group:wood", "group:wood", "group:wood"} - }, + } +}) + +beds.register_bed("beds:bed_blue", { + description = S("Blue Simple Bed"), + inventory_image = "beds_bed_blue.png", + wield_image = "beds_bed_blue.png", + tiles = {"beds_simple_bed_blue.png"}, + mesh = "beds_simple_bed.obj", + selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5}, + collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5}, + recipe = { + {"wool:blue", "wool:blue", "wool:white"}, + {"group:wood", "group:wood", "group:wood"} + } }) -- Aliases for PilzAdam's beds mod @@ -93,12 +71,12 @@ minetest.register_alias("beds:bed_top_red", "beds:bed_top") minetest.register_craft({ type = "fuel", - recipe = "beds:fancy_bed_bottom", - burntime = 13, + recipe = "beds:fancy_bed", + burntime = 13 }) minetest.register_craft({ type = "fuel", - recipe = "beds:bed_bottom", - burntime = 12, + recipe = "beds:bed", + burntime = 12 }) diff --git a/mods/beds/depends.txt b/mods/beds/depends.txt index 470ec30..dda4be0 100644 --- a/mods/beds/depends.txt +++ b/mods/beds/depends.txt @@ -1,2 +1,4 @@ default wool +pova? +intllib? diff --git a/mods/beds/description.txt b/mods/beds/description.txt new file mode 100644 index 0000000..64c8604 --- /dev/null +++ b/mods/beds/description.txt @@ -0,0 +1 @@ +beds which allows sleep, featured to (auto) skip the night. diff --git a/mods/beds/functions.lua b/mods/beds/functions.lua index 78df9a1..6e21bfc 100644 --- a/mods/beds/functions.lua +++ b/mods/beds/functions.lua @@ -1,7 +1,11 @@ +local S = beds.get_translator +local is_50 = beds.is_50 +local is_54 = beds.is_54 +local is_pova = minetest.get_modpath("pova") local pi = math.pi -local player_in_bed = 0 local is_sp = minetest.is_singleplayer() local enable_respawn = minetest.settings:get_bool("enable_bed_respawn") + if enable_respawn == nil then enable_respawn = true end @@ -9,34 +13,49 @@ end -- Helper functions local function get_look_yaw(pos) - local n = minetest.get_node(pos) - if n.param2 == 1 then - return pi / 2, n.param2 - elseif n.param2 == 3 then - return -pi / 2, n.param2 - elseif n.param2 == 0 then - return pi, n.param2 + + local rotation = minetest.get_node(pos).param2 + + if rotation > 3 then + rotation = rotation % 4 -- Mask colorfacedir values + end + + if rotation == 1 then + return pi / 2, rotation + elseif rotation == 3 then + return -pi / 2, rotation + elseif rotation == 0 then + return pi, rotation else - return 0, n.param2 + return 0, rotation end end + local function is_night_skip_enabled() + local enable_night_skip = minetest.settings:get_bool("enable_bed_night_skip") + if enable_night_skip == nil then enable_night_skip = true end + return enable_night_skip end + local function check_in_beds(players) + local in_bed = beds.player + if not players then players = minetest.get_connected_players() end for n, player in ipairs(players) do + local name = player:get_player_name() + if not in_bed[name] then return false end @@ -45,7 +64,9 @@ local function check_in_beds(players) return #players > 0 end + local function lay_down(player, pos, bed_pos, state, skip) + local name = player:get_player_name() local hud_flags = player:hud_get_flags() @@ -55,61 +76,156 @@ local function lay_down(player, pos, bed_pos, state, skip) -- stand up if state ~= nil and not state then - local p = beds.pos[name] or nil - if beds.player[name] ~= nil then - beds.player[name] = nil - player_in_bed = player_in_bed - 1 + + if not beds.player[name] then + return false -- player not in bed, do nothing end + + beds.bed_position[name] = nil + -- skip here to prevent sending player specific changes (used for leaving players) if skip then return end - if p then - player:setpos(p) - end + + player:set_pos(beds.pos[name]) -- physics, eye_offset, etc + local physics_override = beds.player[name].physics_override + + beds.player[name] = nil + + if is_pova then + pova.del_override(name, "force") + pova.do_override(player) + else + player:set_physics_override({ + speed = physics_override.speed, + jump = physics_override.jump, + gravity = physics_override.gravity + }) + end + player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}) player:set_look_horizontal(math.random(1, 180) / 100) - default.player_attached[name] = false - player:set_physics_override(1, 1, 1) - hud_flags.wielditem = true - default.player_set_animation(player, "stand" , 30) - -- lay down - else - beds.player[name] = 1 + if beds.is_50 then + player_api.player_attached[name] = false + player_api.set_animation(player, "stand" , 30) + else + default.player_attached[name] = false + default.player_set_animation(player, "stand" , 30) + end + + hud_flags.wielditem = true + + else -- lay down + + -- Check if bed is occupied + for _, other_pos in pairs(beds.bed_position) do + + if vector.distance(bed_pos, other_pos) < 0.1 then + + minetest.chat_send_player(name, S("This bed is already occupied!")) + + return false + end + end + + if beds.is_54 then + -- Check if player is moving + if vector.length(player:get_velocity()) > 0.001 then + minetest.chat_send_player(name, + S("You have to stop moving before going to bed!")) + return false + end + end + + -- Check if player is attached to an object + if player:get_attach() then + return false + end + + if beds.player[name] then + -- player already in bed, do nothing + return false + end + beds.pos[name] = pos - player_in_bed = player_in_bed + 1 + beds.bed_position[name] = bed_pos + beds.player[name] = {physics_override = player:get_physics_override()} -- physics, eye_offset, etc player:set_eye_offset({x = 0, y = -13, z = 0}, {x = 0, y = 0, z = 0}) + local yaw, param2 = get_look_yaw(bed_pos) + player:set_look_horizontal(yaw) + local dir = minetest.facedir_to_dir(param2) - local p = {x = bed_pos.x + dir.x / 2, y = bed_pos.y, z = bed_pos.z + dir.z / 2} - player:set_physics_override(0, 0, 0) - player:setpos(p) - default.player_attached[name] = true + + -- p.y is just above the nodebox height of the 'Simple Bed' (the highest bed), + -- to avoid sinking down through the bed. + local p = { + x = bed_pos.x + dir.x / 2, + y = bed_pos.y + 0.07, + z = bed_pos.z + dir.z / 2 + } + + if is_pova then + pova.add_override(name, "force", {speed = 0, jump = 0, gravity = 0}) + pova.do_override(player) + else + player:set_physics_override({speed = 0, jump = 0, gravity = 0}) + end + + player:set_pos(p) + + if beds.is_50 then + player_api.player_attached[name] = true + player_api.set_animation(player, "lay" , 0) + else + + default.player_attached[name] = true + default.player_set_animation(player, "lay" , 0) + end + hud_flags.wielditem = false - default.player_set_animation(player, "lay" , 0) end player:hud_set_flags(hud_flags) end + +local function get_player_in_bed_count() + + local c = 0 + + for _, _ in pairs(beds.player) do + c = c + 1 + end + + return c +end + + local function update_formspecs(finished) + local ges = #minetest.get_connected_players() - local form_n + local player_in_bed = get_player_in_bed_count() local is_majority = (ges / 2) < player_in_bed + local form_n + local esc = minetest.formspec_escape if finished then - form_n = beds.formspec .. "label[2.7,11; Good morning.]" + form_n = beds.formspec .. "label[2.7,9;" .. esc(S("Good morning.")) .. "]" else - form_n = beds.formspec .. "label[2.2,11;" .. tostring(player_in_bed) .. - " of " .. tostring(ges) .. " players are in bed]" + form_n = beds.formspec .. "label[2.2,9;" .. + esc(S("@1 of @2 players are in bed", player_in_bed, ges)) .. "]" + if is_majority and is_night_skip_enabled() then - form_n = form_n .. "button_exit[2,8;4,0.75;force;Force night skip]" + form_n = form_n .. "button_exit[2,6;4,0.75;force;" .. + esc(S("Force night skip")) .. "]" end end @@ -118,36 +234,46 @@ local function update_formspecs(finished) end end - -- Public functions function beds.kick_players() + for name, _ in pairs(beds.player) do + local player = minetest.get_player_by_name(name) + lay_down(player, nil, nil, false) end end + function beds.skip_night() minetest.set_timeofday(0.23) end + function beds.on_rightclick(pos, player) + local name = player:get_player_name() - local ppos = player:getpos() + local ppos = player:get_pos() local tod = minetest.get_timeofday() if tod > 0.2 and tod < 0.805 then + if beds.player[name] then lay_down(player, nil, nil, false) end - minetest.chat_send_player(name, "You can only sleep at night.") + + minetest.chat_send_player(name, S("You can only sleep at night.")) + return end -- move to bed if not beds.player[name] then + lay_down(player, ppos, pos) + beds.set_spawns() -- save respawn positions when entering bed else lay_down(player, nil, nil, false) @@ -159,10 +285,13 @@ function beds.on_rightclick(pos, player) -- skip the night and let all players stand up if check_in_beds() then + minetest.after(2, function() + if not is_sp then update_formspecs(is_night_skip_enabled()) end + if is_night_skip_enabled() then beds.skip_night() beds.kick_players() @@ -172,27 +301,56 @@ function beds.on_rightclick(pos, player) end +function beds.can_dig(bed_pos) + + -- Check all players in bed which one is at the expected position + for _, player_bed_pos in pairs(beds.bed_position) do + + if vector.equals(bed_pos, player_bed_pos) then + return false + end + end + + return true +end + -- Callbacks + -- Only register respawn callback if respawn enabled if enable_respawn then + -- respawn player at bed if enabled and valid position is found minetest.register_on_respawnplayer(function(player) + + if not player then return end + local name = player:get_player_name() local pos = beds.spawn[name] + if pos then - player:setpos(pos) + player:set_pos(pos) return true end end) end + minetest.register_on_leaveplayer(function(player) + + if not player then return end + local name = player:get_player_name() + lay_down(player, nil, nil, false, true) + beds.player[name] = nil + if check_in_beds() then + minetest.after(2, function() + update_formspecs(is_night_skip_enabled()) + if is_night_skip_enabled() then beds.skip_night() beds.kick_players() @@ -201,20 +359,54 @@ minetest.register_on_leaveplayer(function(player) end end) + +minetest.register_on_dieplayer(function(player) + + if not player then return end + + local name = player:get_player_name() + local in_bed = beds.player + local pos = player:get_pos() + local yaw = get_look_yaw(pos) + + if in_bed[name] then + lay_down(player, nil, pos, false) + player:set_look_horizontal(yaw) + player:set_pos(pos) + end +end) + + +local div = tonumber(minetest.settings:get("bed_sleep_divide")) or 2 + minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname ~= "beds_form" then return end + + -- Because "Force night skip" button is a button_exit, it will set fields.quit + -- and lay_down call will change value of player_in_bed, so it must be taken + -- earlier. + local last_player_in_bed = get_player_in_bed_count() + if fields.quit or fields.leave then lay_down(player, nil, nil, false) update_formspecs(false) end if fields.force then - update_formspecs(is_night_skip_enabled()) - if is_night_skip_enabled() then + + -- check if enough players are sleeping to skip night (was half) + local is_majority = ( + #minetest.get_connected_players() / div) < last_player_in_bed + + if is_majority and is_night_skip_enabled() then + update_formspecs(true) beds.skip_night() beds.kick_players() + else + update_formspecs(false) end end end) diff --git a/mods/beds/init.lua b/mods/beds/init.lua index 8b25890..41a64e3 100644 --- a/mods/beds/init.lua +++ b/mods/beds/init.lua @@ -1,17 +1,62 @@ -beds = {} -beds.player = {} -beds.pos = {} -beds.spawn = {} +local is_50 = nil +local is_53 = minetest.has_feature("object_step_has_moveresult") +local is_54 = minetest.has_feature("direct_velocity_on_players") -beds.formspec = "size[8,15;true]" .. - "bgcolor[#080808BB; true]" .. - "button_exit[2,12;4,0.75;leave;Leave Bed]" + -- Load support for MT game translation. +local S +if minetest.get_translator ~= nil then + S = minetest.get_translator("beds") -- 5.x translation function + is_50 = true +else + if minetest.get_modpath("intllib") then + dofile(minetest.get_modpath("intllib") .. "/init.lua") + if intllib.make_gettext_pair then + gettext, ngettext = intllib.make_gettext_pair() -- new gettext method + else + gettext = intllib.Getter() -- old text file method + end + S = gettext + else -- boilerplate function for 0.4 + S = function(str, ...) + local args = {...} + return str:gsub("@%d+", function(match) + return args[tonumber(match:sub(2))] + end) + end + end +end + +beds = { + player = {}, + bed_position = {}, + pos = {}, + spawn = {}, + get_translator = S, + formspec = "size[8,11;true]" + .. "no_prepend[]" + .. "bgcolor[#080808BB;true]" + .. "button_exit[2,10;4,0.75;leave;" .. minetest.formspec_escape(S("Leave Bed")) .. "]" +} +beds.is_50 = is_50 +beds.is_53 = is_53 +beds.is_54 = is_54 local modpath = minetest.get_modpath("beds") +-- check for minetest 5.x/0.4 compatibility +function beds.is_creative(name) + if is_53 then + return minetest.is_creative_enabled(name) + else + return creative.is_enabled_for(name) or minetest.settings:get_bool("creative_mode") + end +end -- Load files dofile(modpath .. "/functions.lua") dofile(modpath .. "/api.lua") dofile(modpath .. "/beds.lua") dofile(modpath .. "/spawns.lua") + + +print("[MOD] Beds loaded") diff --git a/mods/beds/license.txt b/mods/beds/license.txt index 0494b36..f3c517f 100644 --- a/mods/beds/license.txt +++ b/mods/beds/license.txt @@ -30,6 +30,7 @@ Licenses of media (textures) Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) Copyright (C) 2014-2016 BlockMen +Copyright (C) 2018 TumeniNodes You are free to: Share — copy and redistribute the material in any medium or format. diff --git a/mods/beds/locale/beds.de.tr b/mods/beds/locale/beds.de.tr new file mode 100644 index 0000000..3f2c959 --- /dev/null +++ b/mods/beds/locale/beds.de.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Schickes Bett +Simple Bed=Schlichtes Bett +This bed is already occupied!=Dieses Bett ist bereits belegt! +You have to stop moving before going to bed!=Sie müssen stehen bleiben, bevor Sie zu Bett gehen können! +Good morning.=Guten Morgen. +@1 of @2 players are in bed=@1 von @2 Spielern sind im Bett +Force night skip=Überspringen der Nacht erzwingen +You can only sleep at night.=Sie können nur nachts schlafen. +Leave Bed=Bett verlassen diff --git a/mods/beds/locale/beds.es.tr b/mods/beds/locale/beds.es.tr new file mode 100644 index 0000000..8ef0db7 --- /dev/null +++ b/mods/beds/locale/beds.es.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Cama de lujo +Simple Bed=Cama sencilla +This bed is already occupied!=Esta cama esta ocupada +You have to stop moving before going to bed!=Deja de moverte o no podras acostarte +Good morning.=Buenos días. +@1 of @2 players are in bed=@1 de @2 jugadores están durmiendo +Force night skip=Forzar hacer de dia +You can only sleep at night.=Sólo puedes dormir por la noche. +Leave Bed=Levantarse diff --git a/mods/beds/locale/beds.fr.tr b/mods/beds/locale/beds.fr.tr new file mode 100644 index 0000000..e1f8e56 --- /dev/null +++ b/mods/beds/locale/beds.fr.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Lit chic +Simple Bed=Lit simple +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.=Bonjour. +@1 of @2 players are in bed=@1 joueur(s) sur @2 sont au lit +Force night skip=Forcer le passage de la nuit +You can only sleep at night.=Vous ne pouvez dormir que la nuit. +Leave Bed=Se lever du lit diff --git a/mods/beds/locale/beds.id.tr b/mods/beds/locale/beds.id.tr new file mode 100644 index 0000000..7bcbb5d --- /dev/null +++ b/mods/beds/locale/beds.id.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Ranjang Mewah +Simple Bed=Ranjang Sederhana +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.=Selamat pagi. +@1 of @2 players are in bed=@1 dari @2 pemain sedang tidur +Force night skip=Paksa lewati malam +You can only sleep at night.=Anda hanya dapat tidur pada waktu malam. +Leave Bed=Tinggalkan Ranjang diff --git a/mods/beds/locale/beds.it.tr b/mods/beds/locale/beds.it.tr new file mode 100644 index 0000000..8f4e14e --- /dev/null +++ b/mods/beds/locale/beds.it.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Letto decorato +Simple Bed=Letto semplice +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.= +@1 of @2 players are in bed= +Force night skip= +You can only sleep at night.= +Leave Bed=Alzati dal letto diff --git a/mods/beds/locale/beds.jbo.tr b/mods/beds/locale/beds.jbo.tr new file mode 100644 index 0000000..a72f686 --- /dev/null +++ b/mods/beds/locale/beds.jbo.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=lo selja'i ckana +Simple Bed=lo sampu ckana +This bed is already occupied!=.i lo ti ckana cu canlu +You have to stop moving before going to bed!=lo nu do cando cu sarcu lo nu do sipna +Good morning.=.i .uise'inai cerni +@1 of @2 players are in bed=.i @1 cmima be lu'i @2 le pilno cu vreta lo ckana +Force night skip=bapli le nu co'u nicte +You can only sleep at night.=.i steci le ka nicte kei fa le ka do kakne le ka sipna ca pa ckaji be ce'u +Leave Bed=cliva lo ckana diff --git a/mods/beds/locale/beds.ms.tr b/mods/beds/locale/beds.ms.tr new file mode 100644 index 0000000..4d4310a --- /dev/null +++ b/mods/beds/locale/beds.ms.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Katil Beragam +Simple Bed=Katil Biasa +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.=Selamat pagi. +@1 of @2 players are in bed=@1 daripada @2 pemain sedang tidur +Force night skip=Paksa langkau malam +You can only sleep at night.=Anda hanya boleh tidur pada waktu malam. +Leave Bed=Bangun diff --git a/mods/beds/locale/beds.pt_BR.tr b/mods/beds/locale/beds.pt_BR.tr new file mode 100644 index 0000000..47fb1b9 --- /dev/null +++ b/mods/beds/locale/beds.pt_BR.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Cama Bonita +Simple Bed=Cama Simples +This bed is already occupied!=Esta cama já está ocupada! +You have to stop moving before going to bed!=Você precisa parar de se mover antes de ir para cama! +Good morning.=Bom dia. +@1 of @2 players are in bed=@1 de @2 jogadores estão na cama +Force night skip=Forçar o amanhecer +You can only sleep at night.=Você só pode dormir à noite +Leave Bed=Sair da Cama diff --git a/mods/beds/locale/beds.ru.tr b/mods/beds/locale/beds.ru.tr new file mode 100644 index 0000000..ac5bd2e --- /dev/null +++ b/mods/beds/locale/beds.ru.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Детализированная Кровать +Simple Bed=Обычная Кровать +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.=Доброе утро. +@1 of @2 players are in bed=@1 из @2 игроков в кровати +Force night skip=Пропустить ночь +You can only sleep at night.=Вы можете спать только ночью. +Leave Bed=Встать с кровати diff --git a/mods/beds/locale/beds.se.tr b/mods/beds/locale/beds.se.tr new file mode 100644 index 0000000..b4d52ba --- /dev/null +++ b/mods/beds/locale/beds.se.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Fin säng +Simple Bed=Enkel Säng +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.= God morgon. +@1 of @2 players are in bed=@1 av @2 spelar försöker sover. +Force night skip=Tvinga över natten +You can only sleep at night.=Du kan bara sova på natten. +Leave Bed=Lämna Säng diff --git a/mods/beds/locale/beds.sk.tr b/mods/beds/locale/beds.sk.tr new file mode 100644 index 0000000..37f39dd --- /dev/null +++ b/mods/beds/locale/beds.sk.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=Pekná posteľ +Simple Bed=Jednoduchá posteľ +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.=Dobré ráno. +@1 of @2 players are in bed=@1 z @2 hráčov sú v posteli +Force night skip=Nútene preskočiť noc +You can only sleep at night.=Môžeš spať len v noci. +Leave Bed=Opusti posteľ diff --git a/mods/beds/locale/beds.zh_CN.tr b/mods/beds/locale/beds.zh_CN.tr new file mode 100644 index 0000000..6a06e09 --- /dev/null +++ b/mods/beds/locale/beds.zh_CN.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=花式床 +Simple Bed=简易床 +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.=早安! +@1 of @2 players are in bed=@2位玩家中的@1位在床上 +Force night skip=强制跳过夜晚 +You can only sleep at night.=你只能在晚上睡觉。 +Leave Bed=离开床 diff --git a/mods/beds/locale/beds.zh_TW.tr b/mods/beds/locale/beds.zh_TW.tr new file mode 100644 index 0000000..b19b481 --- /dev/null +++ b/mods/beds/locale/beds.zh_TW.tr @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed=花式床 +Simple Bed=簡易床 +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.=早安! +@1 of @2 players are in bed=@2位玩家中的@1位在床上 +Force night skip=強制跳過夜晚 +You can only sleep at night.=你只能在晚上睡覺。 +Leave Bed=離開床 diff --git a/mods/beds/locale/template.txt b/mods/beds/locale/template.txt new file mode 100644 index 0000000..a965787 --- /dev/null +++ b/mods/beds/locale/template.txt @@ -0,0 +1,10 @@ +# textdomain: beds +Fancy Bed= +Simple Bed= +This bed is already occupied!= +You have to stop moving before going to bed!= +Good morning.= +@1 of @2 players are in bed= +Force night skip= +You can only sleep at night.= +Leave Bed= diff --git a/mods/beds/mod.conf b/mods/beds/mod.conf new file mode 100644 index 0000000..ae353fb --- /dev/null +++ b/mods/beds/mod.conf @@ -0,0 +1,4 @@ +name = beds +description = beds which allows sleep, featured to (auto) skip the night. +depends = default, wool +optional_depends = player_api, pova, intllib diff --git a/mods/beds/models/beds_fancy_bed.obj b/mods/beds/models/beds_fancy_bed.obj new file mode 100644 index 0000000..285be20 --- /dev/null +++ b/mods/beds/models/beds_fancy_bed.obj @@ -0,0 +1,160 @@ +# Blender v2.69 (sub 0) OBJ File: '' +# www.blender.org +mtllib fancy_bed.mtl +o mattress_Mattress_nodebox-6_none.001_fancy_bed.png.001 +v 0.437500 -0.312500 -0.437501 +v 0.437500 -0.062500 -0.437501 +v 0.437500 -0.062500 1.437499 +v 0.437500 -0.312500 1.437499 +v -0.437500 -0.312500 -0.437501 +v -0.437500 -0.312500 1.437499 +v -0.437500 -0.062500 1.437499 +v -0.437500 -0.062500 -0.437501 +v 0.437500 -0.176793 -0.437501 +v -0.437500 -0.176793 -0.437501 +vt 0.000171 0.499972 +vt 0.000161 0.000182 +vt 0.999791 0.000253 +vt 0.999873 0.500022 +vt 0.749576 0.000208 +vt 0.749876 0.499854 +vt 0.999848 0.999750 +vt 0.000152 0.999750 +vt 0.749276 0.130648 +vt 0.000112 0.130648 +g mattress_Mattress_nodebox-6_none.001_fancy_bed.png.001_none.001_fancy_bed.png.001 +usemtl none.001_fancy_bed.png.001 +s off +f 1/1 2/2 3/3 4/4 +f 5/2 6/3 7/4 8/1 +f 4/5 3/2 7/1 6/6 +f 1/1 4/4 6/7 5/8 +f 2/1 8/2 7/3 3/4 +f 8/2 2/5 9/9 10/10 +o wood_structure_Wood_structure_nodebox-4.001_none.002 +v 0.374999 -0.375000 1.437499 +v 0.374999 -0.125000 1.437499 +v 0.374999 -0.125000 1.499999 +v 0.374999 -0.375000 1.499999 +v -0.374999 -0.375000 1.437499 +v -0.374999 -0.375000 1.499999 +v -0.374999 -0.125000 1.499999 +v -0.374999 -0.125000 1.437499 +v -0.375000 -0.500000 1.437499 +v -0.375000 0.187500 1.437499 +v -0.375000 0.187500 1.499999 +v -0.375000 -0.500000 1.499999 +v -0.500000 -0.500000 1.437499 +v -0.500000 -0.500000 1.499999 +v -0.500000 0.187500 1.499999 +v -0.500000 0.187500 1.437499 +v -0.437500 -0.375000 -0.437501 +v -0.437500 -0.125000 -0.437501 +v -0.437500 -0.125000 1.437498 +v -0.437500 -0.375000 1.437498 +v -0.500000 -0.375000 -0.437501 +v -0.500000 -0.375000 1.437498 +v -0.500000 -0.125000 1.437498 +v -0.500000 -0.125000 -0.437501 +v 0.375001 -0.000000 1.437499 +v 0.375001 0.125000 1.437499 +v 0.375001 0.125000 1.499999 +v 0.375001 -0.000000 1.499999 +v -0.375001 -0.000000 1.437499 +v -0.375001 -0.000000 1.499999 +v -0.375001 0.125000 1.499999 +v -0.375001 0.125000 1.437499 +v 0.500000 -0.500000 1.437499 +v 0.500000 0.187500 1.437499 +v 0.500000 0.187500 1.499999 +v 0.500000 -0.500000 1.499999 +v 0.375000 -0.500000 1.437499 +v 0.375000 -0.500000 1.499999 +v 0.375000 0.187500 1.499999 +v 0.375000 0.187500 1.437499 +v 0.500000 -0.375000 -0.437501 +v 0.500000 -0.125000 -0.437501 +v 0.500000 -0.125000 1.437499 +v 0.500000 -0.375000 1.437499 +v 0.437500 -0.375000 -0.437501 +v 0.437500 -0.375000 1.437499 +v 0.437500 -0.125000 1.437499 +v 0.437500 -0.125000 -0.437501 +v -0.375000 -0.500000 -0.500000 +v -0.375000 -0.065000 -0.500000 +v -0.375000 -0.065000 -0.437500 +v -0.375000 -0.500000 -0.437500 +v -0.500000 -0.500000 -0.500000 +v -0.500000 -0.500000 -0.437500 +v -0.500000 -0.065000 -0.437500 +v -0.500000 -0.065000 -0.500000 +v 0.375006 -0.375000 -0.500000 +v 0.375006 -0.125000 -0.500000 +v 0.375006 -0.125000 -0.437500 +v 0.375006 -0.375000 -0.437500 +v -0.375006 -0.375000 -0.500000 +v -0.375006 -0.375000 -0.437500 +v -0.375006 -0.125000 -0.437500 +v -0.375006 -0.125000 -0.500000 +v 0.500000 -0.500000 -0.500000 +v 0.500000 -0.065000 -0.500000 +v 0.500000 -0.065000 -0.437500 +v 0.500000 -0.500000 -0.437500 +v 0.375000 -0.500000 -0.500000 +v 0.375000 -0.500000 -0.437500 +v 0.375000 -0.065000 -0.437500 +v 0.375000 -0.065000 -0.500000 +vt 0.377610 0.378205 +vt 0.622484 0.378175 +vt 0.622515 0.623120 +vt 0.377671 0.623151 +g wood_structure_Wood_structure_nodebox-4.001_none.002_none.002 +usemtl none.002 +s off +f 59/11 60/12 61/13 62/14 +f 63/14 64/11 65/12 66/13 +f 59/11 63/14 66/13 60/12 +f 62/14 61/13 65/12 64/11 +f 59/11 62/14 64/13 63/12 +f 60/12 66/11 65/14 61/13 +f 67/11 71/12 74/13 68/14 +f 70/14 69/11 73/12 72/13 +f 67/11 70/12 72/13 71/14 +f 68/11 74/12 73/13 69/14 +f 75/11 76/12 77/13 78/14 +f 79/14 80/11 81/12 82/13 +f 75/14 79/11 82/12 76/13 +f 78/11 77/12 81/13 80/14 +f 75/11 78/12 80/13 79/14 +f 76/11 82/12 81/13 77/14 +g wood_structure_Wood_structure_nodebox-4.001_none.002_none.003 +usemtl none.003 +f 15/11 16/12 17/13 18/14 +f 11/13 15/14 18/11 12/12 +f 14/14 13/11 17/12 16/13 +f 11/14 14/11 16/12 15/13 +f 12/11 18/12 17/13 13/14 +f 19/11 20/12 21/13 22/14 +f 23/14 24/11 25/12 26/13 +f 19/14 23/11 26/12 20/13 +f 22/11 21/12 25/13 24/14 +f 19/11 22/12 24/13 23/14 +f 20/11 26/12 25/13 21/14 +f 27/14 28/11 29/12 30/13 +f 31/11 32/12 33/13 34/14 +f 27/11 30/12 32/13 31/14 +f 28/14 34/11 33/12 29/13 +f 35/11 39/12 42/13 36/14 +f 38/14 37/11 41/12 40/13 +f 35/14 38/11 40/12 39/13 +f 36/11 42/12 41/13 37/14 +f 43/11 44/12 45/13 46/14 +f 47/14 48/11 49/12 50/13 +f 43/14 47/11 50/12 44/13 +f 46/11 45/12 49/13 48/14 +f 43/11 46/12 48/13 47/14 +f 44/11 50/12 49/13 45/14 +f 51/14 52/11 53/12 54/13 +f 55/13 56/14 57/11 58/12 +f 51/11 54/12 56/13 55/14 +f 52/14 58/11 57/12 53/13 diff --git a/mods/beds/models/beds_simple_bed.obj b/mods/beds/models/beds_simple_bed.obj new file mode 100644 index 0000000..21ecfb4 --- /dev/null +++ b/mods/beds/models/beds_simple_bed.obj @@ -0,0 +1,32 @@ +# Blender v2.69 (sub 0) OBJ File: '' +# www.blender.org +mtllib simple_bed.mtl +o Simple_Bed +v 0.500000 -0.500000 -0.500000 +v 0.500000 0.060000 -0.500000 +v 0.500000 0.060000 1.500000 +v 0.500000 -0.500000 1.500000 +v -0.500000 -0.500000 -0.500000 +v -0.500000 -0.500000 1.500000 +v -0.500000 0.060000 1.500000 +v -0.500000 0.060000 -0.500000 +vt 0.000112 0.780442 +vt 0.000110 0.999969 +vt 0.780324 0.999889 +vt 0.780377 0.780471 +vt 0.780636 0.390284 +vt 0.999906 0.780382 +vt 0.999906 0.390284 +vt 0.780636 0.000047 +vt 0.999906 0.000094 +vt 0.390235 0.780320 +vt 0.390235 0.000071 +vt 0.000142 0.000142 +usemtl none.002 +s off +f 1/1 2/2 3/3 4/4 +f 5/1 6/4 7/3 8/2 +f 1/5 5/4 8/6 2/7 +f 4/8 3/9 7/7 6/5 +f 1/8 4/4 6/10 5/11 +f 2/11 8/12 7/1 3/10 diff --git a/mods/beds/screenshot.jpg b/mods/beds/screenshot.jpg new file mode 100644 index 0000000..a523878 Binary files /dev/null and b/mods/beds/screenshot.jpg differ diff --git a/mods/beds/settingtypes.txt b/mods/beds/settingtypes.txt new file mode 100644 index 0000000..d1b31a7 --- /dev/null +++ b/mods/beds/settingtypes.txt @@ -0,0 +1,5 @@ +enable_bed_respawn (Enable bed respawn) bool true + +enable_bed_night_skip (Enable night skip) bool true + +bed_sleep_divide (Division of players needed to skip night) float 2 diff --git a/mods/beds/spawns.lua b/mods/beds/spawns.lua index 6b1f404..dc8ae78 100644 --- a/mods/beds/spawns.lua +++ b/mods/beds/spawns.lua @@ -3,30 +3,44 @@ local org_file = world_path .. "/beds_spawns" local file = world_path .. "/beds_spawns" local bkwd = false + -- check for PA's beds mod spawns local cf = io.open(world_path .. "/beds_player_spawns", "r") + if cf ~= nil then io.close(cf) file = world_path .. "/beds_player_spawns" bkwd = true end + function beds.read_spawns() + local spawns = beds.spawn local input = io.open(file, "r") + if input and not bkwd then + repeat + local x = input:read("*n") + if x == nil then break end + local y = input:read("*n") local z = input:read("*n") local name = input:read("*l") + spawns[name:sub(2)] = {x = x, y = y, z = z} + until input:read(0) == nil + io.close(input) + elseif input and bkwd then + beds.spawn = minetest.deserialize(input:read("*all")) input:close() beds.save_spawns() @@ -35,29 +49,53 @@ function beds.read_spawns() end end + beds.read_spawns() + function beds.save_spawns() + if not beds.spawn then return end + local data = {} local output = io.open(org_file, "w") + for k, v in pairs(beds.spawn) do table.insert(data, string.format("%.1f %.1f %.1f %s\n", v.x, v.y, v.z, k)) end + output:write(table.concat(data)) io.close(output) end + function beds.set_spawns() + for name,_ in pairs(beds.player) do + local player = minetest.get_player_by_name(name) - local p = player:getpos() + local p = player:get_pos() + -- but don't change spawn location if borrowing a bed if not minetest.is_protected(p, name) then beds.spawn[name] = p end end + + beds.save_spawns() +end + + +function beds.remove_spawns_at(pos) + + for name, p in pairs(beds.spawn) do + + if vector.equals(vector.round(p), pos) then + beds.spawn[name] = nil + end + end + beds.save_spawns() end diff --git a/mods/beds/textures/beds_bed.png b/mods/beds/textures/beds_bed.png index 5c0054c..5111a91 100644 Binary files a/mods/beds/textures/beds_bed.png and b/mods/beds/textures/beds_bed.png differ diff --git a/mods/beds/textures/beds_bed_blue.png b/mods/beds/textures/beds_bed_blue.png new file mode 100644 index 0000000..e16f5dd Binary files /dev/null and b/mods/beds/textures/beds_bed_blue.png differ diff --git a/mods/beds/textures/beds_bed_fancy.png b/mods/beds/textures/beds_bed_fancy.png index 4f9e8a7..d43e6ec 100644 Binary files a/mods/beds/textures/beds_bed_fancy.png and b/mods/beds/textures/beds_bed_fancy.png differ diff --git a/mods/beds/textures/beds_bed_fancy_pink.png b/mods/beds/textures/beds_bed_fancy_pink.png new file mode 100644 index 0000000..8eab3be Binary files /dev/null and b/mods/beds/textures/beds_bed_fancy_pink.png differ diff --git a/mods/beds/textures/beds_bed_foot.png b/mods/beds/textures/beds_bed_foot.png deleted file mode 100644 index 74d84c8..0000000 Binary files a/mods/beds/textures/beds_bed_foot.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_head.png b/mods/beds/textures/beds_bed_head.png deleted file mode 100644 index 763f5e1..0000000 Binary files a/mods/beds/textures/beds_bed_head.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_side1.png b/mods/beds/textures/beds_bed_side1.png deleted file mode 100644 index 1ed8158..0000000 Binary files a/mods/beds/textures/beds_bed_side1.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_side2.png b/mods/beds/textures/beds_bed_side2.png deleted file mode 100644 index 9d1384d..0000000 Binary files a/mods/beds/textures/beds_bed_side2.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_side_bottom.png b/mods/beds/textures/beds_bed_side_bottom.png deleted file mode 100644 index 99ff309..0000000 Binary files a/mods/beds/textures/beds_bed_side_bottom.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_side_bottom_r.png b/mods/beds/textures/beds_bed_side_bottom_r.png deleted file mode 100644 index 6f870e8..0000000 Binary files a/mods/beds/textures/beds_bed_side_bottom_r.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_side_top.png b/mods/beds/textures/beds_bed_side_top.png deleted file mode 100644 index b2807c5..0000000 Binary files a/mods/beds/textures/beds_bed_side_top.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_side_top_r.png b/mods/beds/textures/beds_bed_side_top_r.png deleted file mode 100644 index 429ad7d..0000000 Binary files a/mods/beds/textures/beds_bed_side_top_r.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_top1.png b/mods/beds/textures/beds_bed_top1.png deleted file mode 100644 index b6fcc2c..0000000 Binary files a/mods/beds/textures/beds_bed_top1.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_top2.png b/mods/beds/textures/beds_bed_top2.png deleted file mode 100644 index 2fe5bf2..0000000 Binary files a/mods/beds/textures/beds_bed_top2.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_top_bottom.png b/mods/beds/textures/beds_bed_top_bottom.png deleted file mode 100644 index 9b78be6..0000000 Binary files a/mods/beds/textures/beds_bed_top_bottom.png and /dev/null differ diff --git a/mods/beds/textures/beds_bed_top_top.png b/mods/beds/textures/beds_bed_top_top.png deleted file mode 100644 index e877c80..0000000 Binary files a/mods/beds/textures/beds_bed_top_top.png and /dev/null differ diff --git a/mods/beds/textures/beds_fancy_bed.png b/mods/beds/textures/beds_fancy_bed.png new file mode 100644 index 0000000..11ea830 Binary files /dev/null and b/mods/beds/textures/beds_fancy_bed.png differ diff --git a/mods/beds/textures/beds_fancy_bed_pink.png b/mods/beds/textures/beds_fancy_bed_pink.png new file mode 100644 index 0000000..cf7a69e Binary files /dev/null and b/mods/beds/textures/beds_fancy_bed_pink.png differ diff --git a/mods/beds/textures/beds_simple_bed.png b/mods/beds/textures/beds_simple_bed.png new file mode 100644 index 0000000..93922ec Binary files /dev/null and b/mods/beds/textures/beds_simple_bed.png differ diff --git a/mods/beds/textures/beds_simple_bed_blue.png b/mods/beds/textures/beds_simple_bed_blue.png new file mode 100644 index 0000000..a94db8c Binary files /dev/null and b/mods/beds/textures/beds_simple_bed_blue.png differ diff --git a/mods/beds/textures/beds_transparent.png b/mods/beds/textures/beds_transparent.png deleted file mode 100644 index 2dc0e3d..0000000 Binary files a/mods/beds/textures/beds_transparent.png and /dev/null differ diff --git a/mods/boats/README.md b/mods/boats/README.md new file mode 100644 index 0000000..466c5bc --- /dev/null +++ b/mods/boats/README.md @@ -0,0 +1,77 @@ +minetest mod boats +========================== + +Boats improved for better performance and more realistic.. + +Information +----------- + +This mod is named `boats`, it features work from original mod, +code changed to make it turn **quicker, better performance agains lag**, +and if you hit the shore too hard the boat is destroyed and drops 3 wood + +![screenshot.png](screenshot.png) + +#### Additions by TenPlus1 + +changed by TenPlus1 to add some new features +- boat is destroyed when crashing at speed (drops 3 wood) +- boats drop after 10 seconds if no driver +- boats can be damaged by mobs attacking player +- Improve physics of boat by implementing drag force (thanks gnag65) +- nil player check functions by misterskullz + +Technical informaton +-------------------- + +When crafted you can use by putting and right click on, +then control with your directional keys: + +#### Dependencies + +* default +* mesecons (optional) + +#### Crafting + +W = any thing from wood group + +``` + +W W +WWW +``` +#### nodes + +| Name | node | notes | +| ------------ | --------------- | ----- | +| Boat | boats:boat | it destroyed when crash at speed | + +#### Controls (by default if not changed) + +| Default key assigned | Action | +| -------------------- | -------------------------------------- | +| Right mouse button | Enter or exit boat when pointing at boat. | +| Forward | Speed up. Slow down when moving backwards. | +| Forward + backward | Enable cruise mode: accelerate to maximum speed without needing to hold. | +| Backward | Slow down. Speed up when moving backwards. Disable cruise mode. | +| Left | Turn to the left. Turn to the right when moving backwards. | +| Right | Turn to the right. Turn to the left when moving backwards. | + +Licence +------ + +**Source code** + +Modifications by TenPlus1 +Originally by PilzAdam (MIT) +Various Minetest developers and contributors (MIT) + +**Media (textures and model)** + +Textures: Zeg9 (CC BY-SA 3.0) +original Model thetoon and Zeg9 (CC BY-SA 3.0), +modified by PavelS(SokolovPavel) (CC BY-SA 3.0), +modified by sofar (CC BY-SA 3.0) + +Check [lisence.txt](lisence.txt) diff --git a/mods/boats/README.txt b/mods/boats/README.txt deleted file mode 100644 index 59631d9..0000000 --- a/mods/boats/README.txt +++ /dev/null @@ -1,15 +0,0 @@ -Minetest Game mod: boats -======================== -See license.txt for license information. - -Authors of source code ----------------------- -Originally by PilzAdam (MIT) -Various Minetest developers and contributors (MIT) - -Authors of media (textures and model) -------------------------------------- -Textures: Zeg9 (CC BY-SA 3.0) -Model: thetoon and Zeg9 (CC BY-SA 3.0), - modified by PavelS(SokolovPavel) (CC BY-SA 3.0), - modified by sofar (CC BY-SA 3.0) diff --git a/mods/boats/depends.txt b/mods/boats/depends.txt index 4ad96d5..c19dbe3 100644 --- a/mods/boats/depends.txt +++ b/mods/boats/depends.txt @@ -1 +1,3 @@ default +player_api? +creative? diff --git a/mods/boats/init.lua b/mods/boats/init.lua index ce67e91..0b3b6cf 100644 --- a/mods/boats/init.lua +++ b/mods/boats/init.lua @@ -1,3 +1,32 @@ +-- boats/init.lua + +-- translation support and 5.x version check +local S, is_50, is_53 +if minetest.get_translator ~= nil then + S = minetest.get_translator("boats") -- 5.x translation function + is_50 = true + is_53 = false +else + if minetest.get_modpath("intllib") then + dofile(minetest.get_modpath("intllib") .. "/init.lua") + if intllib.make_gettext_pair then + gettext, ngettext = intllib.make_gettext_pair() -- new gettext method + else + gettext = intllib.Getter() -- old text file method + end + S = gettext + else -- boilerplate function + S = function(str, ...) + local args = {...} + return str:gsub("@%d+", function(match) + return args[tonumber(match:sub(2))] + end) + end + end +end +-- check for minetest 5.x compatibility +is_53 = minetest.has_feature("direct_velocity_on_players") or minetest.has_feature("is_creative_enabled") of false + -- -- Helper functions -- @@ -8,15 +37,6 @@ local function is_water(pos) end -local function get_sign(i) - if i == 0 then - return 0 - else - return i / math.abs(i) - end -end - - local function get_velocity(v, yaw, y) local x = -math.sin(yaw) * v local z = math.cos(yaw) * v @@ -28,23 +48,34 @@ local function get_v(v) return math.sqrt(v.x ^ 2 + v.z ^ 2) end +local function is_creative_enabled(name) + if is_53 then + return minetest.is_creative_enabled(name) + else + return creative.is_enabled_for(name) or minetest.settings:get_bool("creative_mode") + end +end + -- -- Boat entity -- local boat = { - physical = true, - -- Warning: Do not change the position of the collisionbox top surface, - -- lowering it causes the boat to fall through the world if underwater - collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, - visual = "mesh", - mesh = "boats_boat.obj", - textures = {"default_wood.png"}, + initial_properties = { + physical = true, + -- Warning: Do not change the position of the collisionbox top surface, + -- lowering it causes the boat to fall through the world if underwater + collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5}, + visual = "mesh", + mesh = "boats_boat.obj", + textures = {"default_wood.png"} + }, driver = nil, v = 0, last_v = 0, - removed = false + removed = false, + auto = false } @@ -53,39 +84,58 @@ function boat.on_rightclick(self, clicker) return end local name = clicker:get_player_name() - if self.driver and clicker == self.driver then - self.driver = nil + if self.driver and name == self.driver then + -- Cleanup happens in boat.on_detach_child clicker:set_detach() - default.player_attached[name] = false - default.player_set_animation(clicker, "stand" , 30) - local pos = clicker:getpos() + if is_50 then + player_api.set_animation(clicker, "stand", 30) + else + default.player_set_animation(clicker, "stand", 30) + end + local pos = clicker:get_pos() pos = {x = pos.x, y = pos.y + 0.2, z = pos.z} minetest.after(0.1, function() - clicker:setpos(pos) + clicker:set_pos(pos) end) elseif not self.driver then - local attach = clicker:get_attach() - if attach and attach:get_luaentity() then - local luaentity = attach:get_luaentity() - if luaentity.driver then - luaentity.driver = nil - end - clicker:set_detach() - end - self.driver = clicker clicker:set_attach(self.object, "", - {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0}) - default.player_attached[name] = true + {x = 0.5, y = 1, z = -3}, {x = 0, y = 0, z = 0}) + + self.driver = name + if is_50 then + player_api.player_attached[name] = true + else + default.player_attached[name] = true + end + minetest.after(0.2, function() - default.player_set_animation(clicker, "sit" , 30) + if is_50 then + player_api.set_animation(clicker, "sit", 30) + else + default.player_set_animation(clicker, "sit", 30) + end end) - clicker:set_look_horizontal(self.object:getyaw()) + clicker:set_look_horizontal(self.object:get_yaw()) + end +end + + +-- If driver leaves server while driving boat +function boat.on_detach_child(self, child) + if child and child:get_player_name() == self.driver then + if is_50 then + player_api.player_attached[child:get_player_name()] = false + else + default.player_attached[child:get_player_name()] = false + end + self.driver = nil + self.auto = false end end function boat.on_activate(self, staticdata, dtime_s) - self.object:set_armor_groups({immortal = 1}) + self.object:set_armor_groups({fleshy = 100}) if staticdata then self.v = tonumber(staticdata) end @@ -102,21 +152,26 @@ function boat.on_punch(self, puncher) if not puncher or not puncher:is_player() or self.removed then return end - if self.driver and puncher == self.driver then + + local name = puncher:get_player_name() + if self.driver and name == self.driver then self.driver = nil puncher:set_detach() - default.player_attached[puncher:get_player_name()] = false + if is_50 then + player_api.player_attached[name] = false + else + default.player_attached[name] = false + end end if not self.driver then self.removed = true local inv = puncher:get_inventory() - if not (creative and creative.is_enabled_for - and creative.is_enabled_for(puncher:get_player_name())) + if not is_creative_enabled(name) or not inv:contains_item("main", "boats:boat") then local leftover = inv:add_item("main", "boats:boat") -- if no room in inventory add a replacement boat to the world if not leftover:is_empty() then - minetest.add_item(self.object:getpos(), leftover) + minetest.add_item(self.object:get_pos(), leftover) end end -- delay remove to ensure player is detached @@ -128,46 +183,73 @@ end function boat.on_step(self, dtime) - self.v = get_v(self.object:getvelocity()) * get_sign(self.v) - if self.driver then - local ctrl = self.driver:get_player_control() - local yaw = self.object:getyaw() - if ctrl.up then - self.v = self.v + 0.1 - elseif ctrl.down then - self.v = self.v - 0.1 - end - if ctrl.left then - if self.v < 0 then - self.object:setyaw(yaw - (1 + dtime) * 0.03) - else - self.object:setyaw(yaw + (1 + dtime) * 0.03) - end - elseif ctrl.right then - if self.v < 0 then - self.object:setyaw(yaw + (1 + dtime) * 0.03) - else - self.object:setyaw(yaw - (1 + dtime) * 0.03) - end - end - end - local velo = self.object:getvelocity() - if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then - self.object:setpos(self.object:getpos()) + + -- after 10 seconds remove boat and drop as item if not boarded + self.count = (self.count or 0) + dtime + + if self.count > 10 then + minetest.add_item(self.object:get_pos(), "boats:boat") + self.object:remove() return end - local s = get_sign(self.v) - self.v = self.v - 0.02 * s - if s ~= get_sign(self.v) then - self.object:setvelocity({x = 0, y = 0, z = 0}) - self.v = 0 - return - end - if math.abs(self.v) > 5 then - self.v = 5 * get_sign(self.v) - end - local p = self.object:getpos() + self.v = get_v(self.object:get_velocity()) * math.sign(self.v) + if self.driver then + self.count = 0 -- reset 10 second drop counter + local driver_objref = minetest.get_player_by_name(self.driver) + if driver_objref then + local ctrl = driver_objref:get_player_control() + if ctrl.up and ctrl.down then + if not self.auto then + self.auto = true + minetest.chat_send_player(self.driver, S("Boat cruise mode on")) + end + elseif ctrl.down then + self.v = self.v - dtime * 2.0 + if self.auto then + self.auto = false + minetest.chat_send_player(self.driver, S("Boat cruise mode off")) + end + elseif ctrl.up or self.auto then + self.v = self.v + dtime * 2.0 + end + if ctrl.left then + if self.v < -0.001 then + self.object:set_yaw(self.object:get_yaw() - dtime * 0.9) + else + self.object:set_yaw(self.object:get_yaw() + dtime * 0.9) + end + elseif ctrl.right then + if self.v < -0.001 then + self.object:set_yaw(self.object:get_yaw() + dtime * 0.9) + else + self.object:set_yaw(self.object:get_yaw() - dtime * 0.9) + end + end + else + -- If driver leaves server while driving 'driver' is present + -- but driver objectref is nil. Reset boat properties. + self.driver = nil + self.auto = false + end + end + local velo = self.object:get_velocity() + if not self.driver and + self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then + self.object:set_pos(self.object:get_pos()) + return + end + -- We need to preserve velocity sign to properly apply drag force + -- while moving backward + local drag = dtime * math.sign(self.v) * (0.01 + 0.0796 * self.v * self.v) + -- If drag is larger than velocity, then stop horizontal movement + if math.abs(self.v) <= math.abs(drag) then + self.v = 0 + else + self.v = self.v - drag + end + + local p = self.object:get_pos() p.y = p.y - 0.5 local new_velo local new_acce = {x = 0, y = 0, z = 0} @@ -179,13 +261,13 @@ function boat.on_step(self, dtime) else new_acce = {x = 0, y = -9.8, z = 0} end - new_velo = get_velocity(self.v, self.object:getyaw(), - self.object:getvelocity().y) - self.object:setpos(self.object:getpos()) + new_velo = get_velocity(self.v, self.object:get_yaw(), + self.object:get_velocity().y) + self.object:set_pos(self.object:get_pos()) else p.y = p.y + 1 if is_water(p) then - local y = self.object:getvelocity().y + local y = self.object:get_velocity().y if y >= 5 then y = 5 elseif y < 0 then @@ -193,24 +275,48 @@ function boat.on_step(self, dtime) else new_acce = {x = 0, y = 5, z = 0} end - new_velo = get_velocity(self.v, self.object:getyaw(), y) - self.object:setpos(self.object:getpos()) + new_velo = get_velocity(self.v, self.object:get_yaw(), y) + self.object:set_pos(self.object:get_pos()) else new_acce = {x = 0, y = 0, z = 0} - if math.abs(self.object:getvelocity().y) < 1 then - local pos = self.object:getpos() + if math.abs(self.object:get_velocity().y) < 1 then + local pos = self.object:get_pos() pos.y = math.floor(pos.y) + 0.5 - self.object:setpos(pos) - new_velo = get_velocity(self.v, self.object:getyaw(), 0) + self.object:set_pos(pos) + new_velo = get_velocity(self.v, self.object:get_yaw(), 0) else - new_velo = get_velocity(self.v, self.object:getyaw(), - self.object:getvelocity().y) - self.object:setpos(self.object:getpos()) + new_velo = get_velocity(self.v, self.object:get_yaw(), + self.object:get_velocity().y) + self.object:set_pos(self.object:get_pos()) end end end - self.object:setvelocity(new_velo) - self.object:setacceleration(new_acce) + self.object:set_velocity(new_velo) + self.object:set_acceleration(new_acce) + + -- if boat comes to sudden stop then destroy boat and drop 3x wood + if (self.v2 or 0) - self.v >= 3 then + + if self.driver then +--print ("Crash! with driver", self.v2 - self.v) + local driver_objref = minetest.get_player_by_name(self.driver) + default.player_attached[self.driver] = false + driver_objref:set_detach() + if is_50 then + player_api.set_animation(driver_objref, "stand" , 30) + else + default.player_set_animation(driver_objref, "stand" , 30) + end + else +--print ("Crash! no driver") + end + + minetest.add_item(self.object:get_pos(), "default:wood 3") + self.object:remove() + return + end + + self.v2 = self.v end @@ -218,7 +324,7 @@ minetest.register_entity("boats:boat", boat) minetest.register_craftitem("boats:boat", { - description = "Boat", + description = S("Boat"), inventory_image = "boats_inventory.png", wield_image = "boats_wield.png", wield_scale = {x = 2, y = 2, z = 1}, @@ -246,11 +352,10 @@ minetest.register_craftitem("boats:boat", { boat = minetest.add_entity(pointed_thing.under, "boats:boat") if boat then if placer then - boat:setyaw(placer:get_look_horizontal()) + boat:set_yaw(placer:get_look_horizontal()) end local player_name = placer and placer:get_player_name() or "" - if not (creative and creative.is_enabled_for and - creative.is_enabled_for(player_name)) then + if not is_creative_enabled(player_name) then itemstack:take_item() end end @@ -273,3 +378,6 @@ minetest.register_craft({ recipe = "boats:boat", burntime = 20, }) + + +print ("[MOD] Boats loaded") diff --git a/mods/boats/license.txt b/mods/boats/license.txt index d4afe75..ca0a991 100644 --- a/mods/boats/license.txt +++ b/mods/boats/license.txt @@ -33,6 +33,7 @@ Copyright (C) 2012-2016 Zeg9 Copyright (C) 2012-2016 thetoon Copyright (C) 2012-2016 PavelS(SokolovPavel) Copyright (C) 2016 sofar (sofar@foo-projects.org) +Copyright (C) 2019 Bartosz (gang65@poczta.onet.pl) You are free to: Share — copy and redistribute the material in any medium or format. diff --git a/mods/boats/mod.conf b/mods/boats/mod.conf new file mode 100644 index 0000000..2d78e7b --- /dev/null +++ b/mods/boats/mod.conf @@ -0,0 +1,2 @@ +name = boats +depends = default, player_api, creative diff --git a/mods/boats/screenshot.png b/mods/boats/screenshot.png new file mode 100644 index 0000000..9c2dc3f Binary files /dev/null and b/mods/boats/screenshot.png differ diff --git a/mods/bucket/README.md b/mods/bucket/README.md new file mode 100644 index 0000000..840ee99 --- /dev/null +++ b/mods/bucket/README.md @@ -0,0 +1,56 @@ +minetest mod Bucket +========================= + +This mod is just bucket, but compatible with any engine + +Information +----------- + +This mod must be named `bucket` it permits to handle liquids +in a tool named bucket. + +![screenshot.png](screenshot.png) + +Tech information +---------------- + +This mod sustitute default one, you must disable the default of minetest +game if present or override it. + +#### Dependencies + +* default + +Optional dependences: + +* intllib +* dungeon_loot + +#### Nodes + +It does not provide any new node. + +#### Items tools + +| Node name | Description name | +| ----------------------- | --------------------- | +| bucket:bucket_empty | Empty Bucket | +| bucket:bucket_water | Water Bucket | +| bucket:bucket_river_water | River Water Bucket | +| bucket:bucket_lava | Lava Bucket | + +License +------- + +#### Authors of source code + +Kahrl (LGPLv2.1+) +celeron55, Perttu Ahola (LGPLv2.1+) +Various Minetest developers and contributors (LGPLv2.1+) + +#### Authors of media (textures) + +ElementW (CC BY-SA 3.0) + +Check [license.txt](license.txt) + diff --git a/mods/bucket/README.txt b/mods/bucket/README.txt index 45e0ec5..840ee99 100644 --- a/mods/bucket/README.txt +++ b/mods/bucket/README.txt @@ -1,13 +1,56 @@ -Minetest Game mod: bucket +minetest mod Bucket ========================= -See license.txt for license information. -Authors of source code ----------------------- -Kahrl (LGPL 2.1) -celeron55, Perttu Ahola (LGPL 2.1) -Various Minetest developers and contributors (LGPL 2.1) +This mod is just bucket, but compatible with any engine + +Information +----------- + +This mod must be named `bucket` it permits to handle liquids +in a tool named bucket. + +![screenshot.png](screenshot.png) + +Tech information +---------------- + +This mod sustitute default one, you must disable the default of minetest +game if present or override it. + +#### Dependencies + +* default + +Optional dependences: + +* intllib +* dungeon_loot + +#### Nodes + +It does not provide any new node. + +#### Items tools + +| Node name | Description name | +| ----------------------- | --------------------- | +| bucket:bucket_empty | Empty Bucket | +| bucket:bucket_water | Water Bucket | +| bucket:bucket_river_water | River Water Bucket | +| bucket:bucket_lava | Lava Bucket | + +License +------- + +#### Authors of source code + +Kahrl (LGPLv2.1+) +celeron55, Perttu Ahola (LGPLv2.1+) +Various Minetest developers and contributors (LGPLv2.1+) + +#### Authors of media (textures) -Authors of media (textures) ---------------------------- ElementW (CC BY-SA 3.0) + +Check [license.txt](license.txt) + diff --git a/mods/bucket/depends.txt b/mods/bucket/depends.txt index 3a7daa1..9207dab 100644 --- a/mods/bucket/depends.txt +++ b/mods/bucket/depends.txt @@ -1,2 +1,2 @@ default - +intllib? diff --git a/mods/bucket/description.txt b/mods/bucket/description.txt new file mode 100644 index 0000000..9168a26 --- /dev/null +++ b/mods/bucket/description.txt @@ -0,0 +1 @@ +handle liquids in a tool named bucket diff --git a/mods/bucket/init.lua b/mods/bucket/init.lua index 62392e9..9472440 100644 --- a/mods/bucket/init.lua +++ b/mods/bucket/init.lua @@ -1,15 +1,39 @@ --- Minetest 0.4 mod: bucket +-- Minetest mod: bucket -- See README.txt for licensing and other information. +-- Load support for MT game translation. +local S + +if minetest.get_translator ~= nil then + S = minetest.get_translator("bucket") -- 5.x translation function +else + if minetest.get_modpath("intllib") then + dofile(minetest.get_modpath("intllib") .. "/init.lua") + if intllib.make_gettext_pair then + gettext, ngettext = intllib.make_gettext_pair() -- new gettext method + else + gettext = intllib.Getter() -- old text file method + end + S = gettext + else -- boilerplate function + S = function(str, ...) + local args = {...} + return str:gsub("@%d+", function(match) + return args[tonumber(match:sub(2))] + end) + end + end +end + minetest.register_alias("bucket", "bucket:bucket_empty") minetest.register_alias("bucket_water", "bucket:bucket_water") minetest.register_alias("bucket_lava", "bucket:bucket_lava") minetest.register_craft({ - output = 'bucket:bucket_empty 1', + output = "bucket:bucket_empty 1", recipe = { - {'default:steel_ingot', '', 'default:steel_ingot'}, - {'', 'default:steel_ingot', ''}, + {"default:steel_ingot", "", "default:steel_ingot"}, + {"", "default:steel_ingot", ""}, } }) @@ -65,6 +89,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name end local node = minetest.get_node_or_nil(pointed_thing.under) + if not node then return end local ndef = node and minetest.registered_nodes[node.name] -- Call on_rightclick if the pointed node defines it @@ -111,9 +136,9 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name end minetest.register_craftitem("bucket:bucket_empty", { - description = "Empty Bucket", + description = S("Empty Bucket"), inventory_image = "bucket.png", - stack_max = 99, + groups = {tool = 1}, liquids_pointable = true, on_use = function(itemstack, user, pointed_thing) if pointed_thing.type == "object" then @@ -125,6 +150,7 @@ minetest.register_craftitem("bucket:bucket_empty", { end -- Check if pointing to a liquid source local node = minetest.get_node(pointed_thing.under) + if not node then return end local liquiddef = bucket.liquids[node.name] local item_count = user:get_wielded_item():get_count() @@ -148,7 +174,7 @@ minetest.register_craftitem("bucket:bucket_empty", { if inv:room_for_item("main", {name=liquiddef.itemname}) then inv:add_item("main", liquiddef.itemname) else - local pos = user:getpos() + local pos = user:get_pos() pos.y = math.floor(pos.y + 0.5) minetest.add_item(pos, liquiddef.itemname) end @@ -185,17 +211,23 @@ bucket.register_liquid( "default:water_flowing", "bucket:bucket_water", "bucket_water.png", - "Water Bucket", - {water_bucket = 1} + S("Water Bucket"), + {tool = 1, water_bucket = 1} ) +-- River water source is 'liquid_renewable = false' to avoid horizontal spread +-- of water sources in sloping rivers that can cause water to overflow +-- riverbanks and cause floods. +-- River water source is instead made renewable by the 'force renew' option +-- used here. + bucket.register_liquid( "default:river_water_source", "default:river_water_flowing", "bucket:bucket_river_water", "bucket_river_water.png", - "River Water Bucket", - {water_bucket = 1}, + S("River Water Bucket"), + {tool = 1, water_bucket = 1}, true ) @@ -204,7 +236,8 @@ bucket.register_liquid( "default:lava_flowing", "bucket:bucket_lava", "bucket_lava.png", - "Lava Bucket" + S("Lava Bucket"), + {tool = 1} ) minetest.register_craft({ @@ -214,3 +247,16 @@ minetest.register_craft({ replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}}, }) +-- Register buckets as dungeon loot +if minetest.global_exists("dungeon_loot") then + dungeon_loot.register({ + {name = "bucket:bucket_empty", chance = 0.55}, + -- water in deserts/ice or above ground, lava otherwise + {name = "bucket:bucket_water", chance = 0.45, + types = {"sandstone", "desert", "ice"}}, + {name = "bucket:bucket_water", chance = 0.45, y = {0, 32768}, + types = {"normal"}}, + {name = "bucket:bucket_lava", chance = 0.45, y = {-32768, -1}, + types = {"normal"}}, + }) +end diff --git a/mods/bucket/locale/bucket.de.tr b/mods/bucket/locale/bucket.de.tr new file mode 100644 index 0000000..570dff1 --- /dev/null +++ b/mods/bucket/locale/bucket.de.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Leerer Eimer +Water Bucket=Wassereimer +River Water Bucket=Flusswassereimer +Lava Bucket=Lavaeimer diff --git a/mods/bucket/locale/bucket.eo.tr b/mods/bucket/locale/bucket.eo.tr new file mode 100644 index 0000000..b6266a1 --- /dev/null +++ b/mods/bucket/locale/bucket.eo.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Malplena Sitelo +Water Bucket=Sitelo da Akvo +River Water Bucket=Sitelo da Rivera Akvo +Lava Bucket=Sitelo da Lafo diff --git a/mods/bucket/locale/bucket.es.tr b/mods/bucket/locale/bucket.es.tr new file mode 100644 index 0000000..91a0623 --- /dev/null +++ b/mods/bucket/locale/bucket.es.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Cubo vacío +Water Bucket=Cubo con agua +River Water Bucket=Cubo con agua de río +Lava Bucket=Cubo con lava diff --git a/mods/bucket/locale/bucket.fr.tr b/mods/bucket/locale/bucket.fr.tr new file mode 100644 index 0000000..5065150 --- /dev/null +++ b/mods/bucket/locale/bucket.fr.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Seau vide +Water Bucket=Seau d'eau +River Water Bucket=Seau d'eau de rivière +Lava Bucket=Seau de lave diff --git a/mods/bucket/locale/bucket.id.tr b/mods/bucket/locale/bucket.id.tr new file mode 100644 index 0000000..5662563 --- /dev/null +++ b/mods/bucket/locale/bucket.id.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Ember Kosong +Water Bucket=Ember Air +River Water Bucket=Ember Air Sungai +Lava Bucket=Ember Lava diff --git a/mods/bucket/locale/bucket.it.tr b/mods/bucket/locale/bucket.it.tr new file mode 100644 index 0000000..beca28c --- /dev/null +++ b/mods/bucket/locale/bucket.it.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Secchio vuoto +Water Bucket=Secchio d'acqua +River Water Bucket=Secchio d'acqua di fiume +Lava Bucket=Secchio di lava diff --git a/mods/bucket/locale/bucket.ja.tr b/mods/bucket/locale/bucket.ja.tr new file mode 100644 index 0000000..df3bbb6 --- /dev/null +++ b/mods/bucket/locale/bucket.ja.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=空のバケツ +Water Bucket=水入りバケツ +River Water Bucket=川の水入りバケツ +Lava Bucket=溶岩入りバケツ diff --git a/mods/bucket/locale/bucket.jbo.tr b/mods/bucket/locale/bucket.jbo.tr new file mode 100644 index 0000000..e40d2b9 --- /dev/null +++ b/mods/bucket/locale/bucket.jbo.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=lo baktu be no da +Water Bucket=lo baktu be lo djacu +River Water Bucket=lo baktu be lo rirxe djacu +Lava Bucket=lo baktu be lo likro'i diff --git a/mods/bucket/locale/bucket.ms.tr b/mods/bucket/locale/bucket.ms.tr new file mode 100644 index 0000000..02ba38a --- /dev/null +++ b/mods/bucket/locale/bucket.ms.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Baldi Kosong +Water Bucket=Baldi Air +River Water Bucket=Baldi Air Sungai +Lava Bucket=Baldi Lava diff --git a/mods/bucket/locale/bucket.pt_BR.tr b/mods/bucket/locale/bucket.pt_BR.tr new file mode 100644 index 0000000..429acac --- /dev/null +++ b/mods/bucket/locale/bucket.pt_BR.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Balde Vazio +Water Bucket=Balde de Água +River Water Bucket=Balde de Água do Rio +Lava Bucket=Balde de Lava diff --git a/mods/bucket/locale/bucket.ru.tr b/mods/bucket/locale/bucket.ru.tr new file mode 100644 index 0000000..8ede280 --- /dev/null +++ b/mods/bucket/locale/bucket.ru.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Пустое Ведро +Water Bucket=Ведро с Водой +River Water Bucket=Ведро с Речной Водой +Lava Bucket=Ведро с Лавой diff --git a/mods/bucket/locale/bucket.sk.tr b/mods/bucket/locale/bucket.sk.tr new file mode 100644 index 0000000..0327b20 --- /dev/null +++ b/mods/bucket/locale/bucket.sk.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Prázdne vedro +Water Bucket=Vedro s vodou +River Water Bucket=Vedro s vodou z rieky +Lava Bucket=Vedro s lávou diff --git a/mods/bucket/locale/bucket.sv.tr b/mods/bucket/locale/bucket.sv.tr new file mode 100644 index 0000000..59ee62d --- /dev/null +++ b/mods/bucket/locale/bucket.sv.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Tom hink +Water Bucket=Vattenhink +River Water Bucket=Flodvattenshink +Lava Bucket=Lavahink diff --git a/mods/bucket/locale/bucket.uk.tr b/mods/bucket/locale/bucket.uk.tr new file mode 100644 index 0000000..a5251a5 --- /dev/null +++ b/mods/bucket/locale/bucket.uk.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=Пусте Відро +Water Bucket=Відро З Водою +River Water Bucket=Відро З Річною Водою +Lava Bucket=Відро З Лавою diff --git a/mods/bucket/locale/bucket.zh_CN.tr b/mods/bucket/locale/bucket.zh_CN.tr new file mode 100644 index 0000000..fda5bfc --- /dev/null +++ b/mods/bucket/locale/bucket.zh_CN.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=空桶 +Water Bucket=水桶 +River Water Bucket=河水桶 +Lava Bucket=岩浆桶 diff --git a/mods/bucket/locale/bucket.zh_TW.tr b/mods/bucket/locale/bucket.zh_TW.tr new file mode 100644 index 0000000..965d657 --- /dev/null +++ b/mods/bucket/locale/bucket.zh_TW.tr @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket=空桶 +Water Bucket=水桶 +River Water Bucket=河水桶 +Lava Bucket=岩漿桶 diff --git a/mods/bucket/locale/template.txt b/mods/bucket/locale/template.txt new file mode 100644 index 0000000..a37c103 --- /dev/null +++ b/mods/bucket/locale/template.txt @@ -0,0 +1,5 @@ +# textdomain: bucket +Empty Bucket= +Water Bucket= +River Water Bucket= +Lava Bucket= diff --git a/mods/bucket/mod.conf b/mods/bucket/mod.conf new file mode 100644 index 0000000..f2d89bd --- /dev/null +++ b/mods/bucket/mod.conf @@ -0,0 +1,4 @@ +name = bucket +description = handle liquids in a tool named bucket +depends = default +optional_depends = dungeon_loot diff --git a/mods/bucket/textures/bucket.png b/mods/bucket/textures/bucket.png old mode 100755 new mode 100644 diff --git a/mods/carts/README.md b/mods/carts/README.md new file mode 100644 index 0000000..a28fd4c --- /dev/null +++ b/mods/carts/README.md @@ -0,0 +1,74 @@ +minetest mod Carts (formerly boost_cart) +========================== + +Carts and rails (formerly boost_cart) + +Information +----------- + +This mod is named `carts`, it features work from `boost_cart` mod. +This is improved rail carts mod and featured boots rails.. + +![screenshot.png](screenshot.png) + + +#### Features + +- A fast cart for your railway or roller coaster (up to 7 m/s!) +- Boost and brake rails +- Rail junction switching with the 'right-left' walking keys +- Handbrake with the 'back' key + +#### Additions by TenPlus1 + +- Mesecon detector rail added +- 10 second cart drop when player or item not inside +- Alias' set to replace rails from boost_cart mod + +Technical informaton +-------------------- + +Carts, based almost entirely on the mod boost_cart [1], which +itself is based on (and fully compatible with) the carts mod [2] +and the model was originally designed by stujones11 [3] (CC-0). + +This mod can (and maybe must) replace the default carts mod of minetest game. + +[1] https://github.com/SmallJoker/boost_cart/ +[2] https://github.com/PilzAdam/carts/ +[3] https://github.com/stujones11/railcart/ + +#### Dependencies + +* default +* mesecons (optional) + +#### nodes + +| Name | node | notes | +| ------------ | --------------- | ----- | +| Rail | carts:rail | to use and travel over rails with carts | +| Bracke rails | carts:brakerail | rail to downgrade velocity of carts | +| Powered rail | carts:powerrail | rail to impulse velocity of a cart | +| Detector rail | carts:detectorrail | it depends on mesecons for detection of mese | + +Alias: + +| original | carts alias | +| -------------------- | -------------- | +| default:rail | carts:rail | +| carts:copperrail | default:rail | +| boost_cart:copperrail | default:rail | +| boost_cart:powerrail | carts:powerrail | +| boost_cart:brakerail | carts:brakerail | +| boost_cart:detectorrail | carts:detectorrail | + +Licence +------ + +The model was originally designed by stujones11 [3] (CC-0). + +Cart textures are based on original work from PixelBOX by Gambit (permissive +license). + +Check [lisence.txt](lisence.txt) diff --git a/mods/carts/README.txt b/mods/carts/README.txt deleted file mode 100644 index 31ce644..0000000 --- a/mods/carts/README.txt +++ /dev/null @@ -1,22 +0,0 @@ -Carts (formerly boost_cart) -========================== - -Carts, based almost entirely on the mod boost_cart [1], which -itself is based on (and fully compatible with) the carts mod [2]. - -The model was originally designed by stujones11 [3] (CC-0). - -Cart textures are based on original work from PixelBOX (WTFPL). - - -[1] https://github.com/SmallJoker/boost_cart/ -[2] https://github.com/PilzAdam/carts/ -[3] https://github.com/stujones11/railcart/ - - -Features ----------- -- A fast cart for your railway or roller coaster (up to 7 m/s!) -- Boost and brake rails -- Rail junction switching with the 'right-left' walking keys -- Handbrake with the 'back' key diff --git a/mods/carts/cart_entity.lua b/mods/carts/cart_entity.lua index 3755499..a72ab72 100644 --- a/mods/carts/cart_entity.lua +++ b/mods/carts/cart_entity.lua @@ -1,10 +1,23 @@ +-- carts/cart_entity.lua + +-- support for MT game translation. +local S = carts.get_translator + +-- is mesecons enabled ? +local HAVE_MESECONS_ENABLED = minetest.get_modpath("mesecons") +if HAVE_MESECONS_ENABLED then + dofile(minetest.get_modpath("carts") .. "/detector.lua") +end + local cart_entity = { - physical = false, -- otherwise going uphill breaks - collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, - visual = "mesh", - mesh = "carts_cart.b3d", - visual_size = {x=1, y=1}, - textures = {"carts_cart.png"}, + initial_properties = { + physical = false, -- otherwise going uphill breaks + collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + visual = "mesh", + mesh = "carts_cart.b3d", + visual_size = {x=1, y=1}, + textures = {"carts_cart.png"}, + }, driver = nil, punched = false, -- used to re-send velocity and position @@ -22,40 +35,45 @@ function cart_entity:on_rightclick(clicker) end local player_name = clicker:get_player_name() if self.driver and player_name == self.driver then - self.driver = nil carts:manage_attachment(clicker, nil) elseif not self.driver then - self.driver = player_name carts:manage_attachment(clicker, self.object) + self.driver = player_name end end function cart_entity:on_activate(staticdata, dtime_s) self.object:set_armor_groups({immortal=1}) + self.attached_items = {} -- needed to stop itemcount glitch if string.sub(staticdata, 1, string.len("return")) ~= "return" then return end local data = minetest.deserialize(staticdata) - if not data or type(data) ~= "table" then + if type(data) ~= "table" then return end self.railtype = data.railtype if data.old_dir then self.old_dir = data.old_dir end - if data.old_vel then - self.old_vel = data.old_vel - end end function cart_entity:get_staticdata() return minetest.serialize({ railtype = self.railtype, - old_dir = self.old_dir, - old_vel = self.old_vel + old_dir = self.old_dir }) end +-- 0.5.x and later: When the driver leaves +function cart_entity:on_detach_child(child) + if child and child:get_player_name() == self.driver then + -- Clean up eye height + carts:manage_attachment(child, nil) + self.driver = nil + end +end + function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, direction) local pos = self.object:get_pos() local vel = self.object:get_velocity() @@ -86,7 +104,7 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, local player = minetest.get_player_by_name(self.driver) carts:manage_attachment(player, nil) end - for _,obj_ in ipairs(self.attached_items) do + for _, obj_ in ipairs(self.attached_items) do if obj_ then obj_:set_detach() end @@ -120,7 +138,8 @@ function cart_entity:on_punch(puncher, time_from_last_punch, tool_capabilities, end local punch_interval = 1 - if tool_capabilities and tool_capabilities.full_punch_interval then + -- Faulty tool registrations may cause the interval to be set to 0 ! + if tool_capabilities and (tool_capabilities.full_punch_interval or 0) > 0 then punch_interval = tool_capabilities.full_punch_interval end time_from_last_punch = math.min(time_from_last_punch or punch_interval, punch_interval) @@ -153,6 +172,9 @@ local function rail_sound(self, dtime) minetest.after(0.2, minetest.sound_stop, handle) end local vel = self.object:get_velocity() + +if not vel then return end -- nil check + local speed = vector.length(vel) if speed > 0 then self.sound_handle = minetest.sound_play( @@ -169,7 +191,27 @@ local function get_railparams(pos) return carts.railparams[node.name] or {} end +local v3_len = vector.length local function rail_on_step(self, dtime) + + -- if cart contains nothing then drop as item after 10 seconds + if not self.driver and #self.attached_items == 0 then + self.count = (self.count or 0) + dtime + + if self.count > 10 then + minetest.add_item(self.object:get_pos(), "carts:cart") + if self.sound_handle then + local handle = self.sound_handle + self.sound_handle = nil + minetest.after(0.2, minetest.sound_stop, handle) + end + self.object:remove() + return + end + else + self.count = 0 + end + local vel = self.object:get_velocity() if self.punched then vel = vector.add(vel, self.velocity) @@ -180,21 +222,11 @@ local function rail_on_step(self, dtime) end local pos = self.object:get_pos() + local cart_dir = carts:velocity_to_dir(vel) + local same_dir = vector.equals(cart_dir, self.old_dir) local update = {} - -- stop cart if velocity vector flips - if self.old_vel and self.old_vel.y == 0 and - (self.old_vel.x * vel.x < 0 or self.old_vel.z * vel.z < 0) then - self.old_vel = {x = 0, y = 0, z = 0} - self.old_pos = pos - self.object:set_velocity(vector.new()) - self.object:set_acceleration(vector.new()) - rail_on_step_event(get_railparams(pos).on_step, self, dtime) - return - end - self.old_vel = vector.new(vel) - - if self.old_pos and not self.punched then + if self.old_pos and not self.punched and same_dir then local flo_pos = vector.round(pos) local flo_old = vector.round(self.old_pos) if vector.equals(flo_pos, flo_old) then @@ -213,20 +245,29 @@ local function rail_on_step(self, dtime) end end - if self.old_pos then - -- Detection for "skipping" nodes - local found_path = carts:pathfinder( - pos, self.old_pos, self.old_dir, ctrl, self.old_switch, self.railtype + local stop_wiggle = false + if self.old_pos and same_dir then + -- Detection for "skipping" nodes (perhaps use average dtime?) + -- It's sophisticated enough to take the acceleration in account + local acc = self.object:get_acceleration() + local distance = dtime * (v3_len(vel) + 0.5 * dtime * v3_len(acc)) + + local new_pos, new_dir = carts:pathfinder( + pos, self.old_pos, self.old_dir, distance, ctrl, + self.old_switch, self.railtype ) - if not found_path then - -- No rail found: reset back to the expected position - pos = vector.new(self.old_pos) + if new_pos then + -- No rail found: set to the expected position + pos = new_pos update.pos = true + cart_dir = new_dir end + elseif self.old_pos and self.old_dir.y ~= 1 and not self.punched then + -- Stop wiggle + stop_wiggle = true end - local cart_dir = carts:velocity_to_dir(vel) local railparams -- dir: New moving direction of the cart @@ -234,16 +275,25 @@ local function rail_on_step(self, dtime) local dir, switch_keys = carts:get_rail_direction( pos, cart_dir, ctrl, self.old_switch, self.railtype ) + local dir_changed = not vector.equals(dir, self.old_dir) local new_acc = {x=0, y=0, z=0} - if vector.equals(dir, {x=0, y=0, z=0}) then + if stop_wiggle or vector.equals(dir, {x=0, y=0, z=0}) then vel = {x = 0, y = 0, z = 0} - pos = vector.round(pos) + local pos_r = vector.round(pos) + if not carts:is_rail(pos_r, self.railtype) + and self.old_pos then + pos = self.old_pos + elseif not stop_wiggle then + pos = pos_r + else + pos.y = math.floor(pos.y + 0.5) + end update.pos = true update.vel = true else -- Direction change detected - if not vector.equals(dir, self.old_dir) then + if dir_changed then vel = vector.multiply(dir, math.abs(vel.x + vel.z)) update.vel = true if dir.y ~= self.old_dir.y then @@ -284,6 +334,11 @@ local function rail_on_step(self, dtime) new_acc = vector.multiply(dir, acc) end + -- mesecon detector rail + if HAVE_MESECONS_ENABLED then + carts:signal_detector_rail(vector.round(pos)) + end + -- Limits local max_vel = carts.speed_max for _, v in pairs({"x","y","z"}) do @@ -295,8 +350,8 @@ local function rail_on_step(self, dtime) end self.object:set_acceleration(new_acc) - self.old_pos = vector.new(pos) - if not vector.equals(dir, {x=0, y=0, z=0}) then + self.old_pos = vector.round(pos) + if not vector.equals(dir, {x=0, y=0, z=0}) and not stop_wiggle then self.old_dir = vector.new(dir) end self.old_switch = switch_keys @@ -306,7 +361,7 @@ local function rail_on_step(self, dtime) for _, obj_ in pairs(minetest.get_objects_inside_radius(pos, 1)) do if not obj_:is_player() and obj_:get_luaentity() and - not obj_:get_luaentity().physical_state and +-- not obj_:get_luaentity().physical_state and obj_:get_luaentity().name == "__builtin:item" then obj_:set_attach(self.object, "", {x=0, y=0, z=0}, {x=0, y=0, z=0}) @@ -332,7 +387,7 @@ local function rail_on_step(self, dtime) elseif self.old_dir.z < 0 then yaw = 1 end - self.object:setyaw(yaw * math.pi) + self.object:set_yaw(yaw * math.pi) local anim = {x=0, y=0} if dir.y == -1 then @@ -342,9 +397,15 @@ local function rail_on_step(self, dtime) end self.object:set_animation(anim, 1, 0) - self.object:set_velocity(vel) + if update.vel then + self.object:set_velocity(vel) + end if update.pos then - self.object:set_pos(pos) + if dir_changed then + self.object:set_pos(pos) + else + self.object:move_to(pos) + end end -- call event handler @@ -359,8 +420,9 @@ end minetest.register_entity("carts:cart", cart_entity) minetest.register_craftitem("carts:cart", { - description = "Cart (Sneak+Click to pick up)", - inventory_image = minetest.inventorycube("carts_cart_top.png", "carts_cart_side.png", "carts_cart_side.png"), + description = S("Cart") .. "\n" .. S("(Sneak+Click to pick up)"), + inventory_image = minetest.inventorycube( + "carts_cart_top.png", "carts_cart_front.png", "carts_cart_side.png"), wield_image = "carts_cart_side.png", on_place = function(itemstack, placer, pointed_thing) local under = pointed_thing.under @@ -385,7 +447,7 @@ minetest.register_craftitem("carts:cart", { end minetest.sound_play({name = "default_place_node_metal", gain = 0.5}, - {pos = pointed_thing.above}) + {pos = pointed_thing.above}, true) if not (creative and creative.is_enabled_for and creative.is_enabled_for(placer:get_player_name())) then diff --git a/mods/carts/depends.txt b/mods/carts/depends.txt index 4ad96d5..9aad284 100644 --- a/mods/carts/depends.txt +++ b/mods/carts/depends.txt @@ -1 +1,4 @@ default +intllib? +mesecons? +dungeon_loot? diff --git a/mods/carts/detector.lua b/mods/carts/detector.lua new file mode 100644 index 0000000..e73aad4 --- /dev/null +++ b/mods/carts/detector.lua @@ -0,0 +1,75 @@ + +local mesecons_rules = mesecon.rules.flat + +function carts:turnoff_detector_rail(pos) + + local node = minetest.get_node(pos) + + if minetest.get_item_group(node.name, "detector_rail") == 1 then + + if node.name == "carts:detectorrail_on" then --has not been dug + minetest.swap_node(pos, {name = "carts:detectorrail", param2 = node.param2}) + end + + mesecon.receptor_off(pos, mesecons_rules) + end +end + + +function carts:signal_detector_rail(pos) + + local node = minetest.get_node(pos) + + if minetest.get_item_group(node.name, "detector_rail") ~= 1 then + return + end + + if node.name == "carts:detectorrail" then + minetest.swap_node(pos, {name = "carts:detectorrail_on", param2 = node.param2}) + end + + mesecon.receptor_on(pos, mesecons_rules) + + minetest.after(0.5, carts.turnoff_detector_rail, carts, pos) +end + + +carts:register_rail("carts:detectorrail", { + description = "Detector rail", + tiles = { + "carts_rail_straight_dtc.png", "carts_rail_curved_dtc.png", + "carts_rail_t_junction_dtc.png", "carts_rail_crossing_dtc.png" + }, + groups = carts:get_rail_groups({detector_rail = 1}), + + mesecons = {receptor = {state = "off", rules = mesecons_rules}}, +}) + +minetest.register_alias("boost_cart:detectorrail", "carts:detectorrail") + + +carts:register_rail("carts:detectorrail_on", { + description = "Detector rail ON (you hacker you)", + tiles = { + "carts_rail_straight_dtc_on.png", "carts_rail_curved_dtc_on.png", + "carts_rail_t_junction_dtc_on.png", "carts_rail_crossing_dtc_on.png" + }, + groups = carts:get_rail_groups({ + detector_rail = 1, not_in_creative_inventory = 1 + }), + drop = "carts:detectorrail", + + mesecons = {receptor = {state = "on", rules = mesecons_rules}}, +}) + +minetest.register_alias("boost_cart:detectorrail_on", "carts:detectorrail_on") + + +minetest.register_craft({ + output = "boost_cart:detectorrail 6", + recipe = { + {"default:steel_ingot", "mesecons:wire_00000000_off", "default:steel_ingot"}, + {"default:steel_ingot", "group:stick", "default:steel_ingot"}, + {"default:steel_ingot", "mesecons:wire_00000000_off", "default:steel_ingot"}, + }, +}) diff --git a/mods/carts/functions.lua b/mods/carts/functions.lua index 9b7e2c6..9d4e739 100644 --- a/mods/carts/functions.lua +++ b/mods/carts/functions.lua @@ -1,3 +1,5 @@ +local is_50 = minetest.get_translator + function carts:get_sign(z) if z == 0 then return 0 @@ -12,14 +14,28 @@ function carts:manage_attachment(player, obj) end local status = obj ~= nil local player_name = player:get_player_name() - if default.player_attached[player_name] == status then + if obj and player:get_attach() == obj then return end - default.player_attached[player_name] = status + + if is_50 then + player_api.player_attached[player_name] = status + else + default.player_attached[player_name] = status + end if status then - player:set_attach(obj, "", {x=0, y=6, z=0}, {x=0, y=0, z=0}) + player:set_attach(obj, "", {x=0, y=-4.5, z=0}, {x=0, y=0, z=0}) player:set_eye_offset({x=0, y=-4, z=0},{x=0, y=-4, z=0}) + + -- player_api does not update the animation + -- when the player is attached, reset to default animation + if is_50 then + player_api.set_animation(player, "stand") + else + default.player_set_animation(player, "stand") + end + else player:set_detach() player:set_eye_offset({x=0, y=0, z=0},{x=0, y=0, z=0}) @@ -99,6 +115,16 @@ function carts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) right.z = -dir.x end + local straight_priority = ctrl and dir.y ~= 0 + + -- Normal, to disallow rail switching up- & downhill + if straight_priority then + cur = self:check_front_up_down(pos, dir, true, railtype) + if cur then + return cur + end + end + if ctrl then if old_switch == 1 then left_check = false @@ -106,14 +132,14 @@ function carts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) right_check = false end if ctrl.left and left_check then - cur = carts:check_front_up_down(pos, left, false, railtype) + cur = self:check_front_up_down(pos, left, false, railtype) if cur then return cur, 1 end left_check = false end if ctrl.right and right_check then - cur = carts:check_front_up_down(pos, right, false, railtype) + cur = self:check_front_up_down(pos, right, false, railtype) if cur then return cur, 2 end @@ -122,9 +148,11 @@ function carts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) end -- Normal - cur = carts:check_front_up_down(pos, dir, true, railtype) - if cur then - return cur + if not straight_priority then + cur = self:check_front_up_down(pos, dir, true, railtype) + if cur then + return cur + end end -- Left, if not already checked @@ -158,33 +186,37 @@ function carts:get_rail_direction(pos_, dir, ctrl, old_switch, railtype) return {x=0, y=0, z=0} end -function carts:pathfinder(pos_, old_pos, old_dir, ctrl, pf_switch, railtype) - if vector.equals(old_pos, pos_) then - return true - end +function carts:pathfinder(pos_, old_pos, old_dir, distance, ctrl, + pf_switch, railtype) local pos = vector.round(pos_) + if vector.equals(old_pos, pos) then + return + end + local pf_pos = vector.round(old_pos) local pf_dir = vector.new(old_dir) + distance = math.min(carts.path_distance_max, + math.floor(distance + 1)) - for i = 1, 3 do - pf_dir, pf_switch = carts:get_rail_direction( - pf_pos, pf_dir, ctrl, pf_switch, railtype) + for i = 1, distance do + pf_dir, pf_switch = self:get_rail_direction( + pf_pos, pf_dir, ctrl, pf_switch or 0, railtype) if vector.equals(pf_dir, {x=0, y=0, z=0}) then -- No way forwards - return false + return pf_pos, pf_dir end pf_pos = vector.add(pf_pos, pf_dir) if vector.equals(pf_pos, pos) then -- Success! Cart moved on correctly - return true + return end end - -- Cart not found - return false + -- Not found. Put cart to predicted position + return pf_pos, pf_dir end function carts:register_rail(name, def_overwrite, railparams) diff --git a/mods/carts/init.lua b/mods/carts/init.lua index 53b33cc..350b94d 100644 --- a/mods/carts/init.lua +++ b/mods/carts/init.lua @@ -1,20 +1,48 @@ +-- carts/init.lua + +-- translation support +local S +if minetest.get_translator ~= nil then + S = minetest.get_translator("carts") -- 5.x translation function +else + if minetest.get_modpath("intllib") then + dofile(minetest.get_modpath("intllib") .. "/init.lua") + if intllib.make_gettext_pair then + gettext, ngettext = intllib.make_gettext_pair() -- new gettext method + else + gettext = intllib.Getter() -- old text file method + end + S = gettext + else -- boilerplate function + S = function(str, ...) + local args = {...} + return str:gsub("@%d+", function(match) + return args[tonumber(match:sub(2))] + end) + end + end +end carts = {} carts.modpath = minetest.get_modpath("carts") carts.railparams = {} +carts.get_translator = S -- Maximal speed of the cart in m/s (min = -1) carts.speed_max = 7 -- Set to -1 to disable punching the cart from inside (min = -1) carts.punch_speed_max = 5 +-- Maximal distance for the path correction (for dtime peaks) +carts.path_distance_max = 3 dofile(carts.modpath.."/functions.lua") dofile(carts.modpath.."/rails.lua") - --- Support for non-default games -if not default.player_attached then - default.player_attached = {} -end - dofile(carts.modpath.."/cart_entity.lua") + +-- Register rails as dungeon loot +if minetest.global_exists("dungeon_loot") then + dungeon_loot.register({ + name = "carts:rail", chance = 0.35, count = {1, 6} + }) +end diff --git a/mods/carts/locale/carts.de.tr b/mods/carts/locale/carts.de.tr new file mode 100644 index 0000000..89a33ac --- /dev/null +++ b/mods/carts/locale/carts.de.tr @@ -0,0 +1,6 @@ +# textdomain: carts +Cart=Lore +(Sneak+Click to pick up)=(Schleichen u. Klicken zum Aufheben) +Rail=Schiene +Powered Rail=Antriebsschiene +Brake Rail=Bremsschiene diff --git a/mods/carts/locale/carts.es.tr b/mods/carts/locale/carts.es.tr new file mode 100644 index 0000000..c0857a1 --- /dev/null +++ b/mods/carts/locale/carts.es.tr @@ -0,0 +1,6 @@ +# textdomain: carts +Cart=Vagoneta +(Sneak+Click to pick up)=(Agacharse+Clic para recoger) +Rail=Raíl +Powered Rail=Raíl energizado +Brake Rail=Raíl de frenado diff --git a/mods/carts/locale/carts.fr.tr b/mods/carts/locale/carts.fr.tr new file mode 100644 index 0000000..b092f14 --- /dev/null +++ b/mods/carts/locale/carts.fr.tr @@ -0,0 +1,6 @@ +# textdomain: carts +Cart=Chariot +(Sneak+Click to pick up)=(Se baisser + clic pour ramasser) +Rail=Rail +Powered Rail=Rail de traction +Brake Rail=Rail de freinage diff --git a/mods/carts/locale/carts.it.tr b/mods/carts/locale/carts.it.tr new file mode 100644 index 0000000..546471c --- /dev/null +++ b/mods/carts/locale/carts.it.tr @@ -0,0 +1,6 @@ +# textdomain: carts +Cart=Vagone +(Sneak+Click to pick up)=(Strisciare+Click per raccoglierlo) +Rail=Binario +Powered Rail=Binario alimentato +Brake Rail=Binario freno \ No newline at end of file diff --git a/mods/carts/locale/carts.ms.tr b/mods/carts/locale/carts.ms.tr new file mode 100644 index 0000000..e8944e9 --- /dev/null +++ b/mods/carts/locale/carts.ms.tr @@ -0,0 +1,6 @@ +# textdomain: carts +Cart=Pedati +(Sneak+Click to pick up)=(Selinap+Klik untuk ambil balik) +Rail=Landasan +Powered Rail=Landasan Berkuasa +Brake Rail=Landasan Brek diff --git a/mods/carts/locale/carts.ru.tr b/mods/carts/locale/carts.ru.tr new file mode 100644 index 0000000..6ff5be6 --- /dev/null +++ b/mods/carts/locale/carts.ru.tr @@ -0,0 +1,6 @@ +# textdomain: carts +Cart=Вагонетка +(Sneak+Click to pick up)=(Пригнитесь и кликните по вагонетке, чтобы забрать) +Rail=Рельса +Powered Rail=Механизированная Рельса +Brake Rail=Рельса с тормозом diff --git a/mods/carts/locale/carts.se.tr b/mods/carts/locale/carts.se.tr new file mode 100644 index 0000000..e40f8ca --- /dev/null +++ b/mods/carts/locale/carts.se.tr @@ -0,0 +1,6 @@ +# textdomain: carts +Cart=Vagn +(Sneak+Click to pick up)=(Shift+Klicka för att plocka upp) +Rail=Räls +Powered Rail=Aktiverad räls +Brake Rail=Broms räls \ No newline at end of file diff --git a/mods/carts/locale/carts.zh_CN.tr b/mods/carts/locale/carts.zh_CN.tr new file mode 100644 index 0000000..953cdef --- /dev/null +++ b/mods/carts/locale/carts.zh_CN.tr @@ -0,0 +1,6 @@ +# textdomain: carts +Cart=矿车 +(Sneak+Click to pick up)=(潜行+单击以捡起) +Rail=铁轨 +Powered Rail=动力铁轨 +Brake Rail=制动铁轨 diff --git a/mods/carts/locale/carts.zh_TW.tr b/mods/carts/locale/carts.zh_TW.tr new file mode 100644 index 0000000..f6300d4 --- /dev/null +++ b/mods/carts/locale/carts.zh_TW.tr @@ -0,0 +1,6 @@ +# textdomain: carts +Cart=礦車 +(Sneak+Click to pick up)=(潛行+單擊以撿起) +Rail=鐵軌 +Powered Rail=動力鐵軌 +Brake Rail=制動鐵軌 diff --git a/mods/carts/locale/template.txt b/mods/carts/locale/template.txt new file mode 100644 index 0000000..a67d95f --- /dev/null +++ b/mods/carts/locale/template.txt @@ -0,0 +1,6 @@ +# textdomain: carts +Cart= +(Sneak+Click to pick up)= +Rail= +Powered Rail= +Brake Rail= diff --git a/mods/carts/mod.conf b/mods/carts/mod.conf new file mode 100644 index 0000000..63347d2 --- /dev/null +++ b/mods/carts/mod.conf @@ -0,0 +1,4 @@ +name = carts +description = Carts (formerly boost_cart) +depends = default, player_api +optional_depends = dungeon_loot, mesecons diff --git a/mods/carts/rails.lua b/mods/carts/rails.lua index a5fff8a..9de2437 100644 --- a/mods/carts/rails.lua +++ b/mods/carts/rails.lua @@ -1,5 +1,10 @@ +-- carts/rails.lua + +-- support for MT game translation. +local S = carts.get_translator + carts:register_rail("carts:rail", { - description = "Rail", + description = S("Rail"), tiles = { "carts_rail_straight.png", "carts_rail_curved.png", "carts_rail_t_junction.png", "carts_rail_crossing.png" @@ -22,7 +27,7 @@ minetest.register_alias("default:rail", "carts:rail") carts:register_rail("carts:powerrail", { - description = "Powered Rail", + description = S("Powered Rail"), tiles = { "carts_rail_straight_pwr.png", "carts_rail_curved_pwr.png", "carts_rail_t_junction_pwr.png", "carts_rail_crossing_pwr.png" @@ -41,7 +46,7 @@ minetest.register_craft({ carts:register_rail("carts:brakerail", { - description = "Brake Rail", + description = S("Brake Rail"), tiles = { "carts_rail_straight_brk.png", "carts_rail_curved_brk.png", "carts_rail_t_junction_brk.png", "carts_rail_crossing_brk.png" @@ -57,3 +62,9 @@ minetest.register_craft({ {"default:steel_ingot", "group:wood", "default:steel_ingot"}, } }) + +-- add alias for boost_cart rails +minetest.register_alias("carts:copperrail", "default:rail") +minetest.register_alias("boost_cart:copperrail", "default:rail") +minetest.register_alias("boost_cart:powerrail", "carts:powerrail") +minetest.register_alias("boost_cart:brakerail", "carts:brakerail") diff --git a/mods/carts/screenshot.png b/mods/carts/screenshot.png new file mode 100644 index 0000000..e9eaa5b Binary files /dev/null and b/mods/carts/screenshot.png differ diff --git a/mods/carts/textures/carts_cart.png b/mods/carts/textures/carts_cart.png index 965347c..4eb10c5 100644 Binary files a/mods/carts/textures/carts_cart.png and b/mods/carts/textures/carts_cart.png differ diff --git a/mods/carts/textures/carts_rail_crossing.png b/mods/carts/textures/carts_rail_crossing.png index e10f3b1..71e4108 100644 Binary files a/mods/carts/textures/carts_rail_crossing.png and b/mods/carts/textures/carts_rail_crossing.png differ diff --git a/mods/carts/textures/carts_rail_crossing_brk.png b/mods/carts/textures/carts_rail_crossing_brk.png index 0bf455e..810893e 100644 Binary files a/mods/carts/textures/carts_rail_crossing_brk.png and b/mods/carts/textures/carts_rail_crossing_brk.png differ diff --git a/mods/carts/textures/carts_rail_crossing_dtc.png b/mods/carts/textures/carts_rail_crossing_dtc.png new file mode 100644 index 0000000..cf04f0f Binary files /dev/null and b/mods/carts/textures/carts_rail_crossing_dtc.png differ diff --git a/mods/carts/textures/carts_rail_crossing_dtc_on.png b/mods/carts/textures/carts_rail_crossing_dtc_on.png new file mode 100644 index 0000000..b6f5b87 Binary files /dev/null and b/mods/carts/textures/carts_rail_crossing_dtc_on.png differ diff --git a/mods/carts/textures/carts_rail_crossing_pwr.png b/mods/carts/textures/carts_rail_crossing_pwr.png index d763d50..4b085cc 100644 Binary files a/mods/carts/textures/carts_rail_crossing_pwr.png and b/mods/carts/textures/carts_rail_crossing_pwr.png differ diff --git a/mods/carts/textures/carts_rail_curved.png b/mods/carts/textures/carts_rail_curved.png index b320f0d..a51ea6a 100644 Binary files a/mods/carts/textures/carts_rail_curved.png and b/mods/carts/textures/carts_rail_curved.png differ diff --git a/mods/carts/textures/carts_rail_curved_brk.png b/mods/carts/textures/carts_rail_curved_brk.png index ca40723..f1fa742 100644 Binary files a/mods/carts/textures/carts_rail_curved_brk.png and b/mods/carts/textures/carts_rail_curved_brk.png differ diff --git a/mods/carts/textures/carts_rail_curved_dtc.png b/mods/carts/textures/carts_rail_curved_dtc.png new file mode 100644 index 0000000..8117c27 Binary files /dev/null and b/mods/carts/textures/carts_rail_curved_dtc.png differ diff --git a/mods/carts/textures/carts_rail_curved_dtc_on.png b/mods/carts/textures/carts_rail_curved_dtc_on.png new file mode 100644 index 0000000..032630f Binary files /dev/null and b/mods/carts/textures/carts_rail_curved_dtc_on.png differ diff --git a/mods/carts/textures/carts_rail_curved_pwr.png b/mods/carts/textures/carts_rail_curved_pwr.png index 781bbd0..1e3e70a 100644 Binary files a/mods/carts/textures/carts_rail_curved_pwr.png and b/mods/carts/textures/carts_rail_curved_pwr.png differ diff --git a/mods/carts/textures/carts_rail_straight.png b/mods/carts/textures/carts_rail_straight.png index 30dcafe..1862892 100644 Binary files a/mods/carts/textures/carts_rail_straight.png and b/mods/carts/textures/carts_rail_straight.png differ diff --git a/mods/carts/textures/carts_rail_straight_brk.png b/mods/carts/textures/carts_rail_straight_brk.png index 0c69052..96f8405 100644 Binary files a/mods/carts/textures/carts_rail_straight_brk.png and b/mods/carts/textures/carts_rail_straight_brk.png differ diff --git a/mods/carts/textures/carts_rail_straight_dtc.png b/mods/carts/textures/carts_rail_straight_dtc.png new file mode 100644 index 0000000..5e2ccef Binary files /dev/null and b/mods/carts/textures/carts_rail_straight_dtc.png differ diff --git a/mods/carts/textures/carts_rail_straight_dtc_on.png b/mods/carts/textures/carts_rail_straight_dtc_on.png new file mode 100644 index 0000000..e81dbe1 Binary files /dev/null and b/mods/carts/textures/carts_rail_straight_dtc_on.png differ diff --git a/mods/carts/textures/carts_rail_straight_pwr.png b/mods/carts/textures/carts_rail_straight_pwr.png index e067ff1..03784f0 100644 Binary files a/mods/carts/textures/carts_rail_straight_pwr.png and b/mods/carts/textures/carts_rail_straight_pwr.png differ diff --git a/mods/carts/textures/carts_rail_t_junction.png b/mods/carts/textures/carts_rail_t_junction.png index 8b1b946..8887f27 100644 Binary files a/mods/carts/textures/carts_rail_t_junction.png and b/mods/carts/textures/carts_rail_t_junction.png differ diff --git a/mods/carts/textures/carts_rail_t_junction_brk.png b/mods/carts/textures/carts_rail_t_junction_brk.png index 6b4f6fa..60a2568 100644 Binary files a/mods/carts/textures/carts_rail_t_junction_brk.png and b/mods/carts/textures/carts_rail_t_junction_brk.png differ diff --git a/mods/carts/textures/carts_rail_t_junction_dtc.png b/mods/carts/textures/carts_rail_t_junction_dtc.png new file mode 100644 index 0000000..b154f43 Binary files /dev/null and b/mods/carts/textures/carts_rail_t_junction_dtc.png differ diff --git a/mods/carts/textures/carts_rail_t_junction_dtc_on.png b/mods/carts/textures/carts_rail_t_junction_dtc_on.png new file mode 100644 index 0000000..9fda111 Binary files /dev/null and b/mods/carts/textures/carts_rail_t_junction_dtc_on.png differ diff --git a/mods/carts/textures/carts_rail_t_junction_pwr.png b/mods/carts/textures/carts_rail_t_junction_pwr.png index dd0eede..c408b5a 100644 Binary files a/mods/carts/textures/carts_rail_t_junction_pwr.png and b/mods/carts/textures/carts_rail_t_junction_pwr.png differ diff --git a/mods/creative/README.md b/mods/creative/README.md new file mode 100644 index 0000000..9478a9b --- /dev/null +++ b/mods/creative/README.md @@ -0,0 +1,38 @@ +Minetest Game mod: creative +=========================== + +Simplified creative with faster loading + +Information +------------ + +This mod is named `creative` and is a replacement for default "creative" mod +of orginal game, with reduced tabs, also it uses a cached memory to faster lodaing. + +![screenshot.png](screenshot.png) + +Technical Information +---------------------- + +This mod fork used as base the commit `72acd4db9cc676f9e0ae1435e371adb2b10cdbe8`, +for backguard compatibility with 5.2 and 0.4.16, with minimal backports, you +can download from https://codeberg.org/minenux/minetest-mod-creative and after +clone or downloaded renamed to `creative` (obviously replace the current one if any) + +Modified by TenPlus1 (added creative privelage, reduced tab count, tweaked code), +original work is at https://notabug.org/TenPlus1/creative + +### Authors of source code + +Originally by Perttu Ahola (celeron55) (MIT) +Jean-Patrick G. (kilbith) (MIT) + +### Author of media (textures) + +Jean-Patrick G. (kilbith) (CC BY-SA 3.0) + +LICENSE +------- + +See [license.txt](license.txt) for license information. + diff --git a/mods/creative/README.txt b/mods/creative/README.txt index 82357f3..9478a9b 100644 --- a/mods/creative/README.txt +++ b/mods/creative/README.txt @@ -1,12 +1,38 @@ Minetest Game mod: creative =========================== -See license.txt for license information. -Authors of source code +Simplified creative with faster loading + +Information +------------ + +This mod is named `creative` and is a replacement for default "creative" mod +of orginal game, with reduced tabs, also it uses a cached memory to faster lodaing. + +![screenshot.png](screenshot.png) + +Technical Information ---------------------- + +This mod fork used as base the commit `72acd4db9cc676f9e0ae1435e371adb2b10cdbe8`, +for backguard compatibility with 5.2 and 0.4.16, with minimal backports, you +can download from https://codeberg.org/minenux/minetest-mod-creative and after +clone or downloaded renamed to `creative` (obviously replace the current one if any) + +Modified by TenPlus1 (added creative privelage, reduced tab count, tweaked code), +original work is at https://notabug.org/TenPlus1/creative + +### Authors of source code + Originally by Perttu Ahola (celeron55) (MIT) Jean-Patrick G. (kilbith) (MIT) -Author of media (textures) --------------------------- +### Author of media (textures) + Jean-Patrick G. (kilbith) (CC BY-SA 3.0) + +LICENSE +------- + +See [license.txt](license.txt) for license information. + diff --git a/mods/creative/depends.txt b/mods/creative/depends.txt index 975e652..e354eb3 100644 --- a/mods/creative/depends.txt +++ b/mods/creative/depends.txt @@ -1,2 +1 @@ -default sfinv diff --git a/mods/creative/description.txt b/mods/creative/description.txt new file mode 100644 index 0000000..aefb5cd --- /dev/null +++ b/mods/creative/description.txt @@ -0,0 +1 @@ +Simplified creative with faster loading diff --git a/mods/creative/init.lua b/mods/creative/init.lua index ef190b8..0215d3d 100644 --- a/mods/creative/init.lua +++ b/mods/creative/init.lua @@ -13,7 +13,205 @@ function creative.is_enabled_for(name) minetest.check_player_privs(name, {creative = true}) end -dofile(minetest.get_modpath("creative") .. "/inventory.lua") +local player_inventory = {} +local inventory_cache = {} + +local function init_creative_cache(items) + inventory_cache[items] = {} + local i_cache = inventory_cache[items] + + for name, def in pairs(items) do + if def.groups and def.groups.not_in_creative_inventory ~= 1 and + def.description and def.description ~= "" then + i_cache[name] = def + end + end + table.sort(i_cache) + return i_cache +end + +function creative.init_creative_inventory(player) + local player_name = player:get_player_name() + player_inventory[player_name] = { + size = 0, + filter = "", + start_i = 0 + } + + minetest.create_detached_inventory("creative_" .. player_name, { + allow_move = function(inv, from_list, from_index, to_list, to_index, count, player2) + local name = player2 and player2:get_player_name() or "" + if not creative.is_enabled_for(name) or + to_list == "main" then + return 0 + end + return count + end, + allow_put = function(inv, listname, index, stack, player2) + return 0 + end, + allow_take = function(inv, listname, index, stack, player2) + local name = player2 and player2:get_player_name() or "" + if not creative.is_enabled_for(name) then + return 0 + end + return -1 + end, + on_move = function(inv, from_list, from_index, to_list, to_index, count, player2) + end, + on_take = function(inv, listname, index, stack, player2) + if stack and stack:get_count() > 0 then + minetest.log("action", player_name .. " takes " .. stack:get_name().. " from creative inventory") + end + end, + }, player_name) + + return player_inventory[player_name] +end + +function creative.update_creative_inventory(player_name, tab_content) + local creative_list = {} + local inv = player_inventory[player_name] or + creative.init_creative_inventory(minetest.get_player_by_name(player_name)) + local player_inv = minetest.get_inventory({type = "detached", name = "creative_" .. player_name}) + + local items = inventory_cache[tab_content] or init_creative_cache(tab_content) + + for name, def in pairs(items) do + if def.name:find(inv.filter, 1, true) or + def.description:lower():find(inv.filter, 1, true) then + creative_list[#creative_list+1] = name + end + end + + table.sort(creative_list) + player_inv:set_size("main", #creative_list) + player_inv:set_list("main", creative_list) + inv.size = #creative_list +end + +-- Create the trash field +local trash = minetest.create_detached_inventory("creative_trash", { + -- Allow the stack to be placed and remove it in on_put() + -- This allows the creative inventory to restore the stack + allow_put = function(inv, listname, index, stack, player) + return stack:get_count() + end, + on_put = function(inv, listname) + inv:set_list(listname, {}) + end, +}) +trash:set_size("main", 1) + +creative.formspec_add = "" + +function creative.register_tab(name, title, items) + sfinv.register_page("creative:" .. name, { + title = title, + is_in_nav = function(self, player, context) + return creative.is_enabled_for(player:get_player_name()) + end, + get = function(self, player, context) + local player_name = player:get_player_name() + creative.update_creative_inventory(player_name, items) + local inv = player_inventory[player_name] + local start_i = inv.start_i or 0 + local pagenum = math.floor(start_i / (3*8) + 1) + local pagemax = math.ceil(inv.size / (3*8)) + return sfinv.make_formspec(player, context, + "label[6.2,3.35;" .. minetest.colorize("#FFFF00", tostring(pagenum)) .. " / " .. tostring(pagemax) .. "]" .. + [[ + image[4.06,3.4;0.8,0.8;creative_trash_icon.png] + listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] + list[current_player;main;0,4.7;8,1;] + list[current_player;main;0,5.85;8,3;8] + list[detached:creative_trash;main;4,3.3;1,1;] + listring[] + button[5.4,3.2;0.8,0.9;creative_prev;<] + button[7.25,3.2;0.8,0.9;creative_next;>] + button[2.1,3.4;0.8,0.5;creative_search;?] + button[2.75,3.4;0.8,0.5;creative_clear;X] +-- image_button[5.4,3.25;0.8,0.8;creative_prev_icon.png;creative_prev;] +-- image_button[7.2,3.25;0.8,0.8;creative_next_icon.png;creative_next;] +-- image_button[2.1,3.25;0.8,0.8;creative_search_icon.png;creative_search;] +-- image_button[2.75,3.25;0.8,0.8;creative_clear_icon.png;creative_clear;] + tooltip[creative_search;Search] + tooltip[creative_clear;Reset] + tooltip[creative_prev;Previous page] + tooltip[creative_next;Next page] + listring[current_player;main] + field_close_on_enter[creative_filter;false] + ]] .. + "field[0.3,3.5;2.2,1;creative_filter;;" .. minetest.formspec_escape(inv.filter) .. "]" .. + "listring[detached:creative_" .. player_name .. ";main]" .. + "list[detached:creative_" .. player_name .. ";main;0,0;8,3;" .. tostring(start_i) .. "]" .. + default.get_hotbar_bg(0,4.7) .. + default.gui_bg .. default.gui_bg_img .. default.gui_slots + .. creative.formspec_add, false) + end, + on_enter = function(self, player, context) + local player_name = player:get_player_name() + local inv = player_inventory[player_name] + if inv then + inv.start_i = 0 + end + end, + on_player_receive_fields = function(self, player, context, fields) + local player_name = player:get_player_name() + local inv = player_inventory[player_name] + assert(inv) + + if fields.creative_clear then + inv.start_i = 0 + inv.filter = "" + creative.update_creative_inventory(player_name, items) + sfinv.set_player_inventory_formspec(player, context) + elseif fields.creative_search or + fields.key_enter_field == "creative_filter" then + inv.start_i = 0 + inv.filter = fields.creative_filter:lower() + creative.update_creative_inventory(player_name, items) + sfinv.set_player_inventory_formspec(player, context) + elseif not fields.quit then + local start_i = inv.start_i or 0 + + if fields.creative_prev then + start_i = start_i - 3*8 + if start_i < 0 then + start_i = inv.size - (inv.size % (3*8)) + if inv.size == start_i then + start_i = math.max(0, inv.size - (3*8)) + end + end + elseif fields.creative_next then + start_i = start_i + 3*8 + if start_i >= inv.size then + start_i = 0 + end + end + + inv.start_i = start_i + sfinv.set_player_inventory_formspec(player, context) + end + end + }) +end + +--creative.register_tab("all", "All", minetest.registered_items) +--creative.register_tab("nodes", "Nodes", minetest.registered_nodes) +--creative.register_tab("tools", "Tools", minetest.registered_tools) +--creative.register_tab("craftitems", "Items", minetest.registered_craftitems) +creative.register_tab("all", "Creative", minetest.registered_items) + +local old_homepage_name = sfinv.get_homepage_name +function sfinv.get_homepage_name(player) + if creative.is_enabled_for(player:get_player_name()) then + return "creative:all" + else + return old_homepage_name(player) + end +end + if creative_mode_cache then -- Dig time is modified according to difference (leveldiff) between tool @@ -56,7 +254,8 @@ end) local old_handle_node_drops = minetest.handle_node_drops function minetest.handle_node_drops(pos, drops, digger) if not digger or not digger:is_player() or - not creative.is_enabled_for(digger:get_player_name()) then +-- not creative.is_enabled_for(digger:get_player_name()) then + not creative_mode_cache then return old_handle_node_drops(pos, drops, digger) end local inv = digger:get_inventory() diff --git a/mods/creative/inventory.lua b/mods/creative/inventory.lua deleted file mode 100644 index 0aad92b..0000000 --- a/mods/creative/inventory.lua +++ /dev/null @@ -1,193 +0,0 @@ -local player_inventory = {} -local inventory_cache = {} - -local function init_creative_cache(items) - inventory_cache[items] = {} - local i_cache = inventory_cache[items] - - for name, def in pairs(items) do - if def.groups.not_in_creative_inventory ~= 1 and - def.description and def.description ~= "" then - i_cache[name] = def - end - end - table.sort(i_cache) - return i_cache -end - -function creative.init_creative_inventory(player) - local player_name = player:get_player_name() - player_inventory[player_name] = { - size = 0, - filter = "", - start_i = 0 - } - - minetest.create_detached_inventory("creative_" .. player_name, { - allow_move = function(inv, from_list, from_index, to_list, to_index, count, player2) - local name = player2 and player2:get_player_name() or "" - if not creative.is_enabled_for(name) or - to_list == "main" then - return 0 - end - return count - end, - allow_put = function(inv, listname, index, stack, player2) - return 0 - end, - allow_take = function(inv, listname, index, stack, player2) - local name = player2 and player2:get_player_name() or "" - if not creative.is_enabled_for(name) then - return 0 - end - return -1 - end, - on_move = function(inv, from_list, from_index, to_list, to_index, count, player2) - end, - on_take = function(inv, listname, index, stack, player2) - if stack and stack:get_count() > 0 then - minetest.log("action", player_name .. " takes " .. stack:get_name().. " from creative inventory") - end - end, - }, player_name) - - return player_inventory[player_name] -end - -function creative.update_creative_inventory(player_name, tab_content) - local creative_list = {} - local inv = player_inventory[player_name] or - creative.init_creative_inventory(minetest.get_player_by_name(player_name)) - local player_inv = minetest.get_inventory({type = "detached", name = "creative_" .. player_name}) - - local items = inventory_cache[tab_content] or init_creative_cache(tab_content) - - for name, def in pairs(items) do - if def.name:find(inv.filter, 1, true) or - def.description:lower():find(inv.filter, 1, true) then - creative_list[#creative_list+1] = name - end - end - - table.sort(creative_list) - player_inv:set_size("main", #creative_list) - player_inv:set_list("main", creative_list) - inv.size = #creative_list -end - --- Create the trash field -local trash = minetest.create_detached_inventory("creative_trash", { - -- Allow the stack to be placed and remove it in on_put() - -- This allows the creative inventory to restore the stack - allow_put = function(inv, listname, index, stack, player) - return stack:get_count() - end, - on_put = function(inv, listname) - inv:set_list(listname, {}) - end, -}) -trash:set_size("main", 1) - -creative.formspec_add = "" - -function creative.register_tab(name, title, items) - sfinv.register_page("creative:" .. name, { - title = title, - is_in_nav = function(self, player, context) - return creative.is_enabled_for(player:get_player_name()) - end, - get = function(self, player, context) - local player_name = player:get_player_name() - creative.update_creative_inventory(player_name, items) - local inv = player_inventory[player_name] - local start_i = inv.start_i or 0 - local pagenum = math.floor(start_i / (3*8) + 1) - local pagemax = math.ceil(inv.size / (3*8)) - return sfinv.make_formspec(player, context, - "label[6.2,3.35;" .. minetest.colorize("#FFFF00", tostring(pagenum)) .. " / " .. tostring(pagemax) .. "]" .. - [[ - image[4.06,3.4;0.8,0.8;creative_trash_icon.png] - listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] - list[current_player;main;0,4.7;8,1;] - list[current_player;main;0,5.85;8,3;8] - list[detached:creative_trash;main;4,3.3;1,1;] - listring[] - button[5.4,3.2;0.8,0.9;creative_prev;<] - button[7.25,3.2;0.8,0.9;creative_next;>] - button[2.1,3.4;0.8,0.5;creative_search;?] - button[2.75,3.4;0.8,0.5;creative_clear;X] - tooltip[creative_search;Search] - tooltip[creative_clear;Reset] - tooltip[creative_prev;Previous page] - tooltip[creative_next;Next page] - listring[current_player;main] - field_close_on_enter[creative_filter;false] - ]] .. - "field[0.3,3.5;2.2,1;creative_filter;;" .. minetest.formspec_escape(inv.filter) .. "]" .. - "listring[detached:creative_" .. player_name .. ";main]" .. - "list[detached:creative_" .. player_name .. ";main;0,0;8,3;" .. tostring(start_i) .. "]" .. - default.get_hotbar_bg(0,4.7) .. - default.gui_bg .. default.gui_bg_img .. default.gui_slots - .. creative.formspec_add, false) - end, - on_enter = function(self, player, context) - local player_name = player:get_player_name() - local inv = player_inventory[player_name] - if inv then - inv.start_i = 0 - end - end, - on_player_receive_fields = function(self, player, context, fields) - local player_name = player:get_player_name() - local inv = player_inventory[player_name] - assert(inv) - - if fields.creative_clear then - inv.start_i = 0 - inv.filter = "" - creative.update_creative_inventory(player_name, items) - sfinv.set_player_inventory_formspec(player, context) - elseif fields.creative_search or - fields.key_enter_field == "creative_filter" then - inv.start_i = 0 - inv.filter = fields.creative_filter:lower() - creative.update_creative_inventory(player_name, items) - sfinv.set_player_inventory_formspec(player, context) - elseif not fields.quit then - local start_i = inv.start_i or 0 - - if fields.creative_prev then - start_i = start_i - 3*8 - if start_i < 0 then - start_i = inv.size - (inv.size % (3*8)) - if inv.size == start_i then - start_i = math.max(0, inv.size - (3*8)) - end - end - elseif fields.creative_next then - start_i = start_i + 3*8 - if start_i >= inv.size then - start_i = 0 - end - end - - inv.start_i = start_i - sfinv.set_player_inventory_formspec(player, context) - end - end - }) -end - -creative.register_tab("all", "All", minetest.registered_items) -creative.register_tab("nodes", "Nodes", minetest.registered_nodes) -creative.register_tab("tools", "Tools", minetest.registered_tools) -creative.register_tab("craftitems", "Items", minetest.registered_craftitems) - -local old_homepage_name = sfinv.get_homepage_name -function sfinv.get_homepage_name(player) - if creative.is_enabled_for(player:get_player_name()) then - return "creative:all" - else - return old_homepage_name(player) - end -end diff --git a/mods/creative/mod.conf b/mods/creative/mod.conf new file mode 100644 index 0000000..8aeabd1 --- /dev/null +++ b/mods/creative/mod.conf @@ -0,0 +1,3 @@ +name = creative +depends = sfinv +description = Simplified creative with faster loading diff --git a/mods/creative/screenshot.png b/mods/creative/screenshot.png new file mode 100644 index 0000000..c47e5f3 Binary files /dev/null and b/mods/creative/screenshot.png differ diff --git a/mods/creative/textures/creative_trash_icon.png b/mods/creative/textures/creative_trash_icon.png index e789ad6..9ebb675 100644 Binary files a/mods/creative/textures/creative_trash_icon.png and b/mods/creative/textures/creative_trash_icon.png differ diff --git a/mods/doors/README.md b/mods/doors/README.md new file mode 100644 index 0000000..f0e1c27 --- /dev/null +++ b/mods/doors/README.md @@ -0,0 +1,167 @@ +minetest mod Doors Redo +========================= + +This mod improves doors, featured also a master key + +Information +----------- + +This mod must be named `doors` a improvement version of the built-in Doors mod +also featured the player to craft a key tool which can be used on any of the +registered doors to flip between states (open, owned, protected) + +![screenshot.png](screenshot.png) + +Tech information +---------------- + +This mod sustitute default one, you must disable the default of minetest +game if present or override it. + +#### Door States + +* OPEN - This is like default Doors mod, can be opened by any player or dug up. +* OWNED - This locks the door so that only the owner can open or dig the door. +* PROTECTED - This locks the door but based on protected area the door sits inside. + +Note: A protection mod must be installed to use Protected mode so that it works +properly, not having one running will mean all protected doors will open for +anyone who uses them. + +#### Dependencies + +* default + +Optional dependences: + +* screwdriver +* creative (only in newer engines) +* protector + +#### Nodes + +| Node name | Description name | +| ----------------------- | --------------------- | +| doors:hidden | Hidden Door Segment | +| doors:trapdoor | Trapdoor | +| doors:trapdoor_steel | Steel Trapdoor | +| doors:door_steel | Steel Door | +| doors:door_glass | Glass Door | +| doors:door_obsidian_glass | Obsidian Glass Door | +| doors:door_phiwari | Phiwari's Wooden Door | +| doors:door_iceage | IceAge's Wooden Door | +| doors:gate_wood | Wooden Fence Gate | +| doors:gate_acacia_wood | Acacia Fence Gate | +| doors:gate_junglewood | Junglewood Fence Gate | +| doors:gate_pine_wood | Pine Fence Gate | +| doors:gate_aspen_wood | Aspen Fence Gate | + +#### Items tools + +The key tool is crafted using 5x steel ingots (2x2 box in lower left and 1 in +top right). When held in players hand you can punch a door to flip between each +state to open, lock (own) and protect the door. + +| Node item | Description name | +| --------------------- | --------------------- | +| doors:key | Key Tool | + +#### Know issues + +In past were reported some issues with homedecor doors, as +in https://notabug.org/TenPlus1/doors/issues/3 #3 .. + +Replacing the older homdecor doors with their new door api counterparts. + +License +------- + +#### Authors of source code + +Originally by PilzAdam (MIT) + +Modified by BlockMen (MIT): Added sounds, glass doors (glass, obsidian glass) and trapdoor. + +Modified by sofar (sofar@foo-projects.org) (MIT): +Added Steel trapdoor. +Re-implemented most of the door algorithms, added meshes, UV wrapped texture. +Added doors API to facilitate coding mods accessing and operating doors. +Added Fence Gate model, code, and sounds. + +Various Minetest developers and contributors (MIT) + +Finally featured by TenPlus1 + +#### Authors of media (textures) + +Following textures created by Fernando Zapata (CC BY-SA 3.0): + door_wood.png + door_wood_a.png + door_wood_a_r.png + door_wood_b.png + door_wood_b_r.png + +Following textures created by BlockMen (CC BY-SA 3.0): + door_trapdoor.png + door_obsidian_glass_side.png + +Following textures created by celeron55 (CC BY-SA 3.0): + door_glass_a.png + door_glass_b.png + +Following textures created by PenguinDad (CC BY-SA 4.0): + door_glass.png + door_obsidian_glass.png + +Following textures created by sofar (CC-BY-SA-3.0): + doors_trapdoor_steel.png + +Following textures created by paramat (CC-BY-SA-3.0): + door_trapdoor_side.png + doors_trapdoor_steel_side.png + +Obsidian door textures by red-001 based on textures by Pilzadam and BlockMen (CC BY-SA 3.0): + door_obsidian_glass.png + +Glass door textures by Krock and paramat based on textures by VanessaE (CC BY-SA 3.0): + doors_door_glass.png + doors_item_glass.png + +TenPlus1 (CC-BY-SA-3.0): + doors_key.png + +All other textures (created by PilzAdam) (CC BY-SA 3.0): + +Door textures were converted to the new texture map by sofar, paramat and +red-001, under the same license as the originals. + +#### Authors of media (models) + +Door 3d models by sofar (CC-BY-SA-3.0) + - door_a.obj + - door_b.obj +Fence gate models by sofar (CC-BY-SA-3.0) + - fencegate_open.obj + - fencegate_closed.obj + + +#### Authors of media (sounds) + +Opening-Sound created by CGEffex (CC BY 3.0), modified by BlockMen + door_open.ogg +Closing-Sound created by bennstir (CC BY 3.0) + door_close.ogg +fencegate_open.ogg: + http://www.freesound.org/people/mhtaylor67/sounds/126041/ - (CC0 1.0) +fencegate_close.ogg: + http://www.freesound.org/people/BarkersPinhead/sounds/274807/ - (CC-BY-3.0) + http://www.freesound.org/people/rivernile7/sounds/249573/ - (CC-BY-3.0) +Steel door sounds open & close (CC-BY-3.0) by HazMatt + - http://www.freesound.org/people/HazMattt/sounds/187283/ + doors_steel_door_open.ogg + doors_steel_door_close.ogg +doors_glass_door_open.ogg, doors_glass_door_close.ogg: + https://www.freesound.org/people/SkeetMasterFunk69/sounds/235546/ (CC0 1.0) + + +Check [license.txt](license.txt) diff --git a/mods/doors/README.txt b/mods/doors/README.txt index 9ad7093..f0e1c27 100644 --- a/mods/doors/README.txt +++ b/mods/doors/README.txt @@ -1,9 +1,83 @@ -Minetest Game mod: doors -======================== -See license.txt for license information. +minetest mod Doors Redo +========================= + +This mod improves doors, featured also a master key + +Information +----------- + +This mod must be named `doors` a improvement version of the built-in Doors mod +also featured the player to craft a key tool which can be used on any of the +registered doors to flip between states (open, owned, protected) + +![screenshot.png](screenshot.png) + +Tech information +---------------- + +This mod sustitute default one, you must disable the default of minetest +game if present or override it. + +#### Door States + +* OPEN - This is like default Doors mod, can be opened by any player or dug up. +* OWNED - This locks the door so that only the owner can open or dig the door. +* PROTECTED - This locks the door but based on protected area the door sits inside. + +Note: A protection mod must be installed to use Protected mode so that it works +properly, not having one running will mean all protected doors will open for +anyone who uses them. + +#### Dependencies + +* default + +Optional dependences: + +* screwdriver +* creative (only in newer engines) +* protector + +#### Nodes + +| Node name | Description name | +| ----------------------- | --------------------- | +| doors:hidden | Hidden Door Segment | +| doors:trapdoor | Trapdoor | +| doors:trapdoor_steel | Steel Trapdoor | +| doors:door_steel | Steel Door | +| doors:door_glass | Glass Door | +| doors:door_obsidian_glass | Obsidian Glass Door | +| doors:door_phiwari | Phiwari's Wooden Door | +| doors:door_iceage | IceAge's Wooden Door | +| doors:gate_wood | Wooden Fence Gate | +| doors:gate_acacia_wood | Acacia Fence Gate | +| doors:gate_junglewood | Junglewood Fence Gate | +| doors:gate_pine_wood | Pine Fence Gate | +| doors:gate_aspen_wood | Aspen Fence Gate | + +#### Items tools + +The key tool is crafted using 5x steel ingots (2x2 box in lower left and 1 in +top right). When held in players hand you can punch a door to flip between each +state to open, lock (own) and protect the door. + +| Node item | Description name | +| --------------------- | --------------------- | +| doors:key | Key Tool | + +#### Know issues + +In past were reported some issues with homedecor doors, as +in https://notabug.org/TenPlus1/doors/issues/3 #3 .. + +Replacing the older homdecor doors with their new door api counterparts. + +License +------- + +#### Authors of source code -Authors of source code ----------------------- Originally by PilzAdam (MIT) Modified by BlockMen (MIT): Added sounds, glass doors (glass, obsidian glass) and trapdoor. @@ -16,9 +90,10 @@ Added Fence Gate model, code, and sounds. Various Minetest developers and contributors (MIT) +Finally featured by TenPlus1 + +#### Authors of media (textures) -Authors of media (textures) ---------------------------- Following textures created by Fernando Zapata (CC BY-SA 3.0): door_wood.png door_wood_a.png @@ -40,23 +115,28 @@ Following textures created by PenguinDad (CC BY-SA 4.0): Following textures created by sofar (CC-BY-SA-3.0): doors_trapdoor_steel.png - doors_trapdoor_steel_side.png + +Following textures created by paramat (CC-BY-SA-3.0): door_trapdoor_side.png + doors_trapdoor_steel_side.png Obsidian door textures by red-001 based on textures by Pilzadam and BlockMen (CC BY-SA 3.0): door_obsidian_glass.png -Glass door textures by red-001 based on textures by celeron55 (CC BY-SA 3.0): - door_glass.png +Glass door textures by Krock and paramat based on textures by VanessaE (CC BY-SA 3.0): + doors_door_glass.png + doors_item_glass.png + +TenPlus1 (CC-BY-SA-3.0): + doors_key.png All other textures (created by PilzAdam) (CC BY-SA 3.0): Door textures were converted to the new texture map by sofar, paramat and red-001, under the same license as the originals. +#### Authors of media (models) -Authors of media (models) -------------------------- Door 3d models by sofar (CC-BY-SA-3.0) - door_a.obj - door_b.obj @@ -65,8 +145,8 @@ Fence gate models by sofar (CC-BY-SA-3.0) - fencegate_closed.obj -Authors of media (sounds) -------------------------- +#### Authors of media (sounds) + Opening-Sound created by CGEffex (CC BY 3.0), modified by BlockMen door_open.ogg Closing-Sound created by bennstir (CC BY 3.0) @@ -82,3 +162,6 @@ Steel door sounds open & close (CC-BY-3.0) by HazMatt doors_steel_door_close.ogg doors_glass_door_open.ogg, doors_glass_door_close.ogg: https://www.freesound.org/people/SkeetMasterFunk69/sounds/235546/ (CC0 1.0) + + +Check [license.txt](license.txt) diff --git a/mods/doors/depends.txt b/mods/doors/depends.txt index 5e28bee..dcca666 100644 --- a/mods/doors/depends.txt +++ b/mods/doors/depends.txt @@ -1,2 +1,3 @@ default screwdriver? +creative? diff --git a/mods/doors/init.lua b/mods/doors/init.lua index 5945cc0..f314929 100644 --- a/mods/doors/init.lua +++ b/mods/doors/init.lua @@ -1,66 +1,113 @@ --- our API object -doors = {} --- private data -local _doors = {} -_doors.registered_doors = {} -_doors.registered_trapdoors = {} +local is_53 = minetest.has_feature("object_step_has_moveresult") + +-- our API object +doors = { + mod = "redo", + registered_doors = {}, + registered_trapdoors = {} +} + +-- cache creative +local creative = minetest.settings:get_bool("creative_mode") + +function is_creative_enabled_for(name) + + if is_53 then + return minetest.is_creative_enabled(name) + end + + if creative or minetest.check_player_privs(name, {creative = true}) then + return true + end + + return false +end + local function replace_old_owner_information(pos) + local meta = minetest.get_meta(pos) local owner = meta:get_string("doors_owner") + if owner and owner ~= "" then meta:set_string("owner", owner) meta:set_string("doors_owner", "") end end + -- returns an object to a door object or nil function doors.get(pos) + local node_name = minetest.get_node(pos).name - if _doors.registered_doors[node_name] then + + if doors.registered_doors[node_name] then + -- A normal upright door return { + pos = pos, + open = function(self, player) + if self:state() then return false end - return _doors.door_toggle(self.pos, nil, player) + + return doors.door_toggle(self.pos, nil, player) end, + close = function(self, player) + if not self:state() then return false end - return _doors.door_toggle(self.pos, nil, player) + + return doors.door_toggle(self.pos, nil, player) end, + toggle = function(self, player) - return _doors.door_toggle(self.pos, nil, player) + return doors.door_toggle(self.pos, nil, player) end, + state = function(self) + local state = minetest.get_meta(self.pos):get_int("state") + return state %2 == 1 end } - elseif _doors.registered_trapdoors[node_name] then + + elseif doors.registered_trapdoors[node_name] then + -- A trapdoor return { + pos = pos, + open = function(self, player) + if self:state() then return false end - return _doors.trapdoor_toggle(self.pos, nil, player) + + return doors.trapdoor_toggle(self.pos, nil, player) end, + close = function(self, player) + if not self:state() then return false end - return _doors.trapdoor_toggle(self.pos, nil, player) + + return doors.trapdoor_toggle(self.pos, nil, player) end, + toggle = function(self, player) - return _doors.trapdoor_toggle(self.pos, nil, player) + return doors.trapdoor_toggle(self.pos, nil, player) end, + state = function(self) return minetest.get_node(self.pos).name:sub(-5) == "_open" end @@ -70,6 +117,7 @@ function doors.get(pos) end end + -- this hidden node is placed on top of the bottom, and prevents -- nodes from being placed in the top half of the door. minetest.register_node("doors:hidden", { @@ -80,6 +128,7 @@ minetest.register_node("doors:hidden", { paramtype = "light", paramtype2 = "facedir", sunlight_propagates = true, + use_texture_alpha = "clip", -- has to be walkable for falling nodes to stop falling. walkable = true, pointable = false, @@ -93,51 +142,57 @@ minetest.register_node("doors:hidden", { -- 1px transparent block inside door hinge near node top. node_box = { type = "fixed", - fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32}, + fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32} }, -- collision_box needed otherise selection box would be full node size collision_box = { type = "fixed", - fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32}, - }, + fixed = {-15/32, 13/32, -15/32, -13/32, 1/2, -13/32} + } }) + -- table used to aid door opening/closing local transform = { { - {v = "_a", param2 = 3}, - {v = "_a", param2 = 0}, - {v = "_a", param2 = 1}, - {v = "_a", param2 = 2}, + { v = "_a", param2 = 3 }, + { v = "_a", param2 = 0 }, + { v = "_a", param2 = 1 }, + { v = "_a", param2 = 2 } }, { - {v = "_b", param2 = 1}, - {v = "_b", param2 = 2}, - {v = "_b", param2 = 3}, - {v = "_b", param2 = 0}, + { v = "_b", param2 = 1 }, + { v = "_b", param2 = 2 }, + { v = "_b", param2 = 3 }, + { v = "_b", param2 = 0 } }, { - {v = "_b", param2 = 1}, - {v = "_b", param2 = 2}, - {v = "_b", param2 = 3}, - {v = "_b", param2 = 0}, + { v = "_b", param2 = 1 }, + { v = "_b", param2 = 2 }, + { v = "_b", param2 = 3 }, + { v = "_b", param2 = 0 } }, { - {v = "_a", param2 = 3}, - {v = "_a", param2 = 0}, - {v = "_a", param2 = 1}, - {v = "_a", param2 = 2}, - }, + { v = "_a", param2 = 3 }, + { v = "_a", param2 = 0 }, + { v = "_a", param2 = 1 }, + { v = "_a", param2 = 2 } + } } -function _doors.door_toggle(pos, node, clicker) - local meta = minetest.get_meta(pos) + +function doors.door_toggle(pos, node, clicker) + + local meta = minetest.get_meta(pos) ; if not meta then return false end + node = node or minetest.get_node(pos) + local def = minetest.registered_nodes[node.name] local name = def.door.name - local state = meta:get_string("state") + if state == "" then + -- fix up lvm-placed right-hinged doors, default closed if node.name:sub(-2) == "_b" then state = 2 @@ -150,10 +205,27 @@ function _doors.door_toggle(pos, node, clicker) replace_old_owner_information(pos) - if clicker and not default.can_interact_with_node(clicker, pos) then - return false + if clicker and not minetest.check_player_privs(clicker, "protection_bypass") then + + local owner = meta:get_string("owner") + local prot = meta:get_string("doors_protected") + + if prot ~= "" then + + if minetest.is_protected(pos, clicker:get_player_name()) then + return false + end + + elseif owner ~= "" then + + if clicker:get_player_name() ~= owner then + return false + end + end end + local old = state + -- until Lua-5.2 we have no bitwise operators :( if state % 2 == 1 then state = state - 1 @@ -162,51 +234,75 @@ function _doors.door_toggle(pos, node, clicker) end local dir = node.param2 + + -- It's possible param2 is messed up, so, validate before using + -- the input data. This indicates something may have rotated + -- the door, even though that is not supported. + if not transform[state + 1] or not transform[state + 1][dir + 1] then + return false + end + if state % 2 == 0 then + minetest.sound_play(def.door.sounds[1], - {pos = pos, gain = 0.3, max_hear_distance = 10}) + {pos = pos, gain = 0.3, max_hear_distance = 10}, true) else minetest.sound_play(def.door.sounds[2], - {pos = pos, gain = 0.3, max_hear_distance = 10}) + {pos = pos, gain = 0.3, max_hear_distance = 10}, true) end minetest.swap_node(pos, { - name = name .. transform[state + 1][dir+1].v, - param2 = transform[state + 1][dir+1].param2 + name = name .. transform[state + 1][dir + 1].v, + param2 = transform[state + 1][dir + 1].param2 }) + meta:set_int("state", state) return true end -local function on_place_node(place_to, newnode, - placer, oldnode, itemstack, pointed_thing) +local function on_place_node(place_to, newnode, placer, oldnode, itemstack, pointed_thing) + -- Run script hook - for _, callback in ipairs(minetest.registered_on_placenodes) do + local _, callback + + for _, callback in pairs(minetest.registered_on_placenodes) do + -- Deepcopy pos, node and pointed_thing because callback can modify them local place_to_copy = {x = place_to.x, y = place_to.y, z = place_to.z} - local newnode_copy = - {name = newnode.name, param1 = newnode.param1, param2 = newnode.param2} - local oldnode_copy = - {name = oldnode.name, param1 = oldnode.param1, param2 = oldnode.param2} + local newnode_copy = { + name = newnode.name, param1 = newnode.param1, param2 = newnode.param2} + local oldnode_copy = { + name = oldnode.name, param1 = oldnode.param1, param2 = oldnode.param2} local pointed_thing_copy = { - type = pointed_thing.type, + type = pointed_thing.type, above = vector.new(pointed_thing.above), under = vector.new(pointed_thing.under), - ref = pointed_thing.ref, + ref = pointed_thing.ref } - callback(place_to_copy, newnode_copy, placer, - oldnode_copy, itemstack, pointed_thing_copy) + + callback(place_to_copy, newnode_copy, placer, oldnode_copy, itemstack, + pointed_thing_copy) end end + local function can_dig_door(pos, digger) + replace_old_owner_information(pos) - return default.can_interact_with_node(digger, pos) + + local digger_name = digger and digger:get_player_name() + + if digger_name and minetest.get_player_privs(digger_name).protection_bypass then + return true + end + + return minetest.get_meta(pos):get_string("owner") == digger_name end function doors.register(name, def) + if not name:find(":") then name = "doors:" .. name end @@ -215,31 +311,39 @@ function doors.register(name, def) minetest.register_lbm({ name = ":doors:replace_" .. name:gsub(":", "_"), nodenames = {name.."_b_1", name.."_b_2"}, + action = function(pos, node) + local l = tonumber(node.name:sub(-1)) local meta = minetest.get_meta(pos) local h = meta:get_int("right") + 1 local p2 = node.param2 local replace = { - {{type = "a", state = 0}, {type = "a", state = 3}}, - {{type = "b", state = 1}, {type = "b", state = 2}} + {{ type = "a", state = 0 }, { type = "a", state = 3 }}, + {{ type = "b", state = 1 }, { type = "b", state = 2 }} } local new = replace[l][h] + -- retain infotext and doors_owner fields minetest.swap_node(pos, {name = name .. "_" .. new.type, param2 = p2}) meta:set_int("state", new.state) + -- properly place doors:hidden at the right spot local p3 = p2 + if new.state >= 2 then p3 = (p3 + 3) % 4 end + if new.state % 2 == 1 then + if new.state >= 2 then p3 = (p3 + 1) % 4 else p3 = (p3 + 3) % 4 end end + -- wipe meta on top node as it's unused minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z}, {name = "doors:hidden", param2 = p3}) @@ -252,17 +356,22 @@ function doors.register(name, def) groups = table.copy(def.groups), on_place = function(itemstack, placer, pointed_thing) + local pos if not pointed_thing.type == "node" then return itemstack end + local doorname = itemstack:get_name() local node = minetest.get_node(pointed_thing.under) local pdef = minetest.registered_nodes[node.name] - if pdef and pdef.on_rightclick and - not (placer and placer:is_player() and - placer:get_player_control().sneak) then + + if pdef + and pdef.on_rightclick + and not (placer and placer:is_player() + and placer:get_player_control().sneak) then + return pdef.on_rightclick(pointed_thing.under, node, placer, itemstack, pointed_thing) end @@ -273,6 +382,7 @@ function doors.register(name, def) pos = pointed_thing.above node = minetest.get_node(pos) pdef = minetest.registered_nodes[node.name] + if not pdef or not pdef.buildable_to then return itemstack end @@ -287,6 +397,7 @@ function doors.register(name, def) end local pn = placer and placer:get_player_name() or "" + if minetest.is_protected(pos, pn) or minetest.is_protected(above, pn) then return itemstack end @@ -297,53 +408,61 @@ function doors.register(name, def) {x = -1, y = 0, z = 0}, {x = 0, y = 0, z = 1}, {x = 1, y = 0, z = 0}, - {x = 0, y = 0, z = -1}, + {x = 0, y = 0, z = -1} } local aside = { x = pos.x + ref[dir + 1].x, y = pos.y + ref[dir + 1].y, - z = pos.z + ref[dir + 1].z, + z = pos.z + ref[dir + 1].z } local state = 0 + if minetest.get_item_group(minetest.get_node(aside).name, "door") == 1 then state = state + 2 - minetest.set_node(pos, {name = name .. "_b", param2 = dir}) + minetest.set_node(pos, {name = doorname .. "_b", param2 = dir}) minetest.set_node(above, {name = "doors:hidden", param2 = (dir + 3) % 4}) else - minetest.set_node(pos, {name = name .. "_a", param2 = dir}) + minetest.set_node(pos, {name = doorname .. "_a", param2 = dir}) minetest.set_node(above, {name = "doors:hidden", param2 = dir}) end local meta = minetest.get_meta(pos) + meta:set_int("state", state) if def.protected then + + local pn = placer:get_player_name() + meta:set_string("owner", pn) meta:set_string("infotext", "Owned by " .. pn) end - if not (creative and creative.is_enabled_for and creative.is_enabled_for(pn)) then + if not is_creative_enabled_for(pn) then itemstack:take_item() end - minetest.sound_play(def.sounds.place, {pos = pos}) + minetest.sound_play(def.sounds.place, {pos = pos}, true) - on_place_node(pos, minetest.get_node(pos), - placer, node, itemstack, pointed_thing) + on_place_node(pos, minetest.get_node(pos), placer, node, itemstack, + pointed_thing) return itemstack end }) + def.inventory_image = nil if def.recipe then + minetest.register_craft({ output = name, - recipe = def.recipe, + recipe = def.recipe }) end + def.recipe = nil if not def.sounds then @@ -361,19 +480,25 @@ function doors.register(name, def) def.groups.not_in_creative_inventory = 1 def.groups.door = 1 def.drop = name - def.door = { - name = name, - sounds = { def.sound_close, def.sound_open }, - } + def.door = {name = name, sounds = {def.sound_close, def.sound_open}} - def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - _doors.door_toggle(pos, node, clicker) - return itemstack + if not def.on_rightclick then + + def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + + doors.door_toggle(pos, node, clicker) + + return itemstack + end end + def.after_dig_node = function(pos, node, meta, digger) + minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) + minetest.check_for_falling({x = pos.x, y = pos.y + 1, z = pos.z}) end + def.on_rotate = function(pos, node, user, mode, new_param2) return false end @@ -381,36 +506,14 @@ function doors.register(name, def) if def.protected then def.can_dig = can_dig_door def.on_blast = function() end - def.on_key_use = function(pos, player) - local door = doors.get(pos) - door:toggle(player) - end - def.on_skeleton_key_use = function(pos, player, newsecret) - replace_old_owner_information(pos) - local meta = minetest.get_meta(pos) - local owner = meta:get_string("owner") - local pname = player:get_player_name() - - -- verify placer is owner of lockable door - if owner ~= pname then - minetest.record_protection_violation(pos, pname) - minetest.chat_send_player(pname, "You do not own this locked door.") - return nil - end - - local secret = meta:get_string("key_lock_secret") - if secret == "" then - secret = newsecret - meta:set_string("key_lock_secret", secret) - end - - return secret, "a locked door", owner - end else def.on_blast = function(pos, intensity) + minetest.remove_node(pos) + -- hidden node doesn't get blasted away. minetest.remove_node({x = pos.x, y = pos.y + 1, z = pos.z}) + return {name} end end @@ -423,95 +526,137 @@ function doors.register(name, def) def.paramtype = "light" def.paramtype2 = "facedir" def.sunlight_propagates = true + def.use_texture_alpha = def.use_texture_alpha or "clip" def.walkable = true def.is_ground_content = false def.buildable_to = false - def.selection_box = {type = "fixed", fixed = {-1/2,-1/2,-1/2,1/2,3/2,-6/16}} - def.collision_box = {type = "fixed", fixed = {-1/2,-1/2,-1/2,1/2,3/2,-6/16}} + def.selection_box = {type = "fixed", fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16}} + def.collision_box = {type = "fixed", fixed = { -1/2,-1/2,-1/2,1/2,3/2,-6/16}} - def.mesh = "door_a.obj" - minetest.register_node(":" .. name .. "_a", def) + def.mesh = "door_a.b3d" + minetest.register_node(":" .. name .. "_a", table.copy(def)) - def.mesh = "door_b.obj" - minetest.register_node(":" .. name .. "_b", def) + minetest.register_alias(name .. "_c", name .. "_b") - _doors.registered_doors[name .. "_a"] = true - _doors.registered_doors[name .. "_b"] = true + def.mesh = "door_b.b3d" + minetest.register_node(":" .. name .. "_b", table.copy(def)) + + minetest.register_alias(name .. "_d", name .. "_a") + + doors.registered_doors[name .. "_a"] = true + doors.registered_doors[name .. "_b"] = true end + doors.register("door_wood", { - tiles = {{ name = "doors_door_wood.png", backface_culling = true }}, - description = "Wooden Door", - inventory_image = "doors_item_wood.png", - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - recipe = { - {"group:wood", "group:wood"}, - {"group:wood", "group:wood"}, - {"group:wood", "group:wood"}, - } + tiles = {{name = "doors_door_wood.png", backface_culling = true}}, + description = "Wooden Door", + inventory_image = "doors_item_wood.png", + groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + recipe = { + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"} + } }) + doors.register("door_steel", { - tiles = {{name = "doors_door_steel.png", backface_culling = true}}, - description = "Steel Door", - inventory_image = "doors_item_steel.png", - protected = true, - groups = {cracky = 1, level = 2}, - sounds = default.node_sound_metal_defaults(), - sound_open = "doors_steel_door_open", - sound_close = "doors_steel_door_close", - recipe = { - {"default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "default:steel_ingot"}, - {"default:steel_ingot", "default:steel_ingot"}, - } + tiles = {{name = "doors_door_steel.png", backface_culling = true}}, + description = "Steel Door", + inventory_image = "doors_item_steel.png", + protected = true, + groups = {node = 1, cracky = 1, level = 2}, + sounds = default.node_sound_stone_defaults(), + sound_open = "doors_steel_door_open", + sound_close = "doors_steel_door_close", + recipe = { + {"default:steel_ingot", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot"} + } }) + doors.register("door_glass", { - tiles = {"doors_door_glass.png"}, - description = "Glass Door", - inventory_image = "doors_item_glass.png", - groups = {cracky=3, oddly_breakable_by_hand=3}, - sounds = default.node_sound_glass_defaults(), - sound_open = "doors_glass_door_open", - sound_close = "doors_glass_door_close", - recipe = { - {"default:glass", "default:glass"}, - {"default:glass", "default:glass"}, - {"default:glass", "default:glass"}, - } + tiles = { "doors_door_glass.png"}, + description = "Glass Door", + inventory_image = "doors_item_glass.png", + groups = {node = 1, cracky = 3, oddly_breakable_by_hand = 3}, + sounds = default.node_sound_glass_defaults(), + sound_open = "doors_glass_door_open", + sound_close = "doors_glass_door_close", + recipe = { + {"default:glass", "default:glass"}, + {"default:glass", "default:glass"}, + {"default:glass", "default:glass"} + } }) + doors.register("door_obsidian_glass", { - tiles = {"doors_door_obsidian_glass.png"}, - description = "Obsidian Glass Door", - inventory_image = "doors_item_obsidian_glass.png", - groups = {cracky=3}, - sounds = default.node_sound_glass_defaults(), - sound_open = "doors_glass_door_open", - sound_close = "doors_glass_door_close", - recipe = { - {"default:obsidian_glass", "default:obsidian_glass"}, - {"default:obsidian_glass", "default:obsidian_glass"}, - {"default:obsidian_glass", "default:obsidian_glass"}, - }, + tiles = { "doors_door_obsidian_glass.png" }, + description = "Obsidian Glass Door", + inventory_image = "doors_item_obsidian_glass.png", + groups = {node = 1, cracky = 3}, + sounds = default.node_sound_glass_defaults(), + sound_open = "doors_glass_door_open", + sound_close = "doors_glass_door_close", + recipe = { + {"default:obsidian_glass", "default:obsidian_glass"}, + {"default:obsidian_glass", "default:obsidian_glass"}, + {"default:obsidian_glass", "default:obsidian_glass"} + } }) + +-- special doors (CC0 textures by Phiwari123 and IceAgeComing) +doors.register("door_phiwari", { + tiles = {{name = "doors_door_phiwari.png", backface_culling = true}}, + description = "Phiwari's Wooden Door", + inventory_image = "doors_item_phiwari.png", + groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + recipe = { + {"group:wood", "default:obsidian_glass"}, + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"} + } +}) + + +doors.register("door_iceage", { + tiles = {{name = "doors_door_iceage.png", backface_culling = true}}, + description = "IceAge's Wooden Door", + inventory_image = "doors_item_iceage.png", + groups = {node = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + recipe = { + {"group:wood", "default:iron_lump"}, + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"} + } +}) + + -- Capture mods using the old API as best as possible. function doors.register_door(name, def) + if def.only_placer_can_open then def.protected = true end + def.only_placer_can_open = nil local i = name:find(":") local modname = name:sub(1, i - 1) + if not def.tiles then + if def.protected then def.tiles = {{name = "doors_door_steel.png", backface_culling = true}} else def.tiles = {{name = "doors_door_wood.png", backface_culling = true}} end + minetest.log("warning", modname .. " registered door \"" .. name .. "\" " .. "using deprecated API method \"doors.register_door()\" but " .. "did not provide the \"tiles\" parameter. A fallback tiledef " .. @@ -523,31 +668,57 @@ end ----trapdoor---- -function _doors.trapdoor_toggle(pos, node, clicker) - node = node or minetest.get_node(pos) +function doors.trapdoor_toggle(pos, node, clicker) replace_old_owner_information(pos) - if clicker and not default.can_interact_with_node(clicker, pos) then - return false + node = node or minetest.get_node(pos) + + if clicker and not minetest.check_player_privs(clicker, "protection_bypass") then + + local meta = minetest.get_meta(pos) ; if not meta then return false end + local owner = meta:get_string("owner") + local prot = meta:get_string("doors_protected") + + if prot ~= "" then + + if minetest.is_protected(pos, clicker:get_player_name()) then + return false + end + + elseif owner ~= "" then + + if clicker:get_player_name() ~= owner then + return false + end + end end local def = minetest.registered_nodes[node.name] if string.sub(node.name, -5) == "_open" then + minetest.sound_play(def.sound_close, - {pos = pos, gain = 0.3, max_hear_distance = 10}) - minetest.swap_node(pos, {name = string.sub(node.name, 1, - string.len(node.name) - 5), param1 = node.param1, param2 = node.param2}) + {pos = pos, gain = 0.3, max_hear_distance = 10}, true) + + minetest.swap_node(pos, { + name = string.sub(node.name, 1, string.len(node.name) - 5), + param1 = node.param1, param2 = node.param2 + }) else minetest.sound_play(def.sound_open, - {pos = pos, gain = 0.3, max_hear_distance = 10}) - minetest.swap_node(pos, {name = node.name .. "_open", - param1 = node.param1, param2 = node.param2}) + {pos = pos, gain = 0.3, max_hear_distance = 10}, true) + + minetest.swap_node(pos, { + name = node.name .. "_open", + param1 = node.param1, param2 = node.param2 + }) end end + function doors.register_trapdoor(name, def) + if not name:find(":") then name = "doors:" .. name end @@ -556,7 +727,9 @@ function doors.register_trapdoor(name, def) local name_opened = name.."_open" def.on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) - _doors.trapdoor_toggle(pos, node, clicker) + + doors.trapdoor_toggle(pos, node, clicker) + return itemstack end @@ -564,48 +737,29 @@ function doors.register_trapdoor(name, def) def.drawtype = "nodebox" def.paramtype = "light" def.paramtype2 = "facedir" + def.use_texture_alpha = def.use_texture_alpha or "clip" def.is_ground_content = false if def.protected then + def.can_dig = can_dig_door def.after_place_node = function(pos, placer, itemstack, pointed_thing) + local pn = placer:get_player_name() local meta = minetest.get_meta(pos) + meta:set_string("owner", pn) meta:set_string("infotext", "Owned by "..pn) - return (creative and creative.is_enabled_for and creative.is_enabled_for(pn)) + return is_creative_enabled_for(pn) end def.on_blast = function() end - def.on_key_use = function(pos, player) - local door = doors.get(pos) - door:toggle(player) - end - def.on_skeleton_key_use = function(pos, player, newsecret) - replace_old_owner_information(pos) - local meta = minetest.get_meta(pos) - local owner = meta:get_string("owner") - local pname = player:get_player_name() - - -- verify placer is owner of lockable door - if owner ~= pname then - minetest.record_protection_violation(pos, pname) - minetest.chat_send_player(pname, "You do not own this trapdoor.") - return nil - end - - local secret = meta:get_string("key_lock_secret") - if secret == "" then - secret = newsecret - meta:set_string("key_lock_secret", secret) - end - - return secret, "a locked trapdoor", owner - end else def.on_blast = function(pos, intensity) + minetest.remove_node(pos) + return {name} end end @@ -633,11 +787,14 @@ function doors.register_trapdoor(name, def) type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -6/16, 0.5} } - def_closed.tiles = {def.tile_front, - def.tile_front .. '^[transformFY', - def.tile_side, def.tile_side, - def.tile_side, def.tile_side} - + def_closed.tiles = { + def.tile_front, + def.tile_front .. "^[transformFY", + def.tile_side, + def.tile_side, + def.tile_side, + def.tile_side + } def_opened.node_box = { type = "fixed", fixed = {-0.5, -0.5, 6/16, 0.5, 0.5, 0.5} @@ -646,11 +803,14 @@ function doors.register_trapdoor(name, def) type = "fixed", fixed = {-0.5, -0.5, 6/16, 0.5, 0.5, 0.5} } - def_opened.tiles = {def.tile_side, def.tile_side, - def.tile_side .. '^[transform3', - def.tile_side .. '^[transform1', - def.tile_front .. '^[transform46', - def.tile_front .. '^[transform6'} + def_opened.tiles = { + def.tile_side, + def.tile_side .. "^[transform2", + def.tile_side .. "^[transform3", + def.tile_side .. "^[transform1", + def.tile_front .. "^[transform46", + def.tile_front .. "^[transform6" + } def_opened.drop = name_closed def_opened.groups.not_in_creative_inventory = 1 @@ -658,17 +818,18 @@ function doors.register_trapdoor(name, def) minetest.register_node(name_opened, def_opened) minetest.register_node(name_closed, def_closed) - _doors.registered_trapdoors[name_opened] = true - _doors.registered_trapdoors[name_closed] = true + doors.registered_trapdoors[name_opened] = true + doors.registered_trapdoors[name_closed] = true end + doors.register_trapdoor("doors:trapdoor", { - description = "Wooden Trapdoor", + description = "Trapdoor", inventory_image = "doors_trapdoor.png", wield_image = "doors_trapdoor.png", tile_front = "doors_trapdoor.png", tile_side = "doors_trapdoor_side.png", - groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door = 1}, + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door = 1} }) doors.register_trapdoor("doors:trapdoor_steel", { @@ -678,33 +839,122 @@ doors.register_trapdoor("doors:trapdoor_steel", { tile_front = "doors_trapdoor_steel.png", tile_side = "doors_trapdoor_steel_side.png", protected = true, - sounds = default.node_sound_metal_defaults(), sound_open = "doors_steel_door_open", sound_close = "doors_steel_door_close", - groups = {cracky = 1, level = 2, door = 1}, + groups = {cracky = 1, level = 2, door = 1} }) minetest.register_craft({ - output = 'doors:trapdoor 2', + output = "doors:trapdoor 2", recipe = { - {'group:wood', 'group:wood', 'group:wood'}, - {'group:wood', 'group:wood', 'group:wood'}, - {'', '', ''}, + {"group:wood", "group:wood", "group:wood"}, + {"group:wood", "group:wood", "group:wood"}, + {"", "", ""} } }) minetest.register_craft({ - output = 'doors:trapdoor_steel', + output = "doors:trapdoor_steel", recipe = { - {'default:steel_ingot', 'default:steel_ingot'}, - {'default:steel_ingot', 'default:steel_ingot'}, + {"default:steel_ingot", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot"} } }) +-----key tool----- + +minetest.register_tool("doors:key", { + description = "Key Tool", + inventory_image = "doors_key.png", + + on_use = function(itemstack, user, pointed_thing) + + local pos = pointed_thing.under + + if pointed_thing.type ~= "node" + or not doors.get(pos) then + return + end + + replace_old_owner_information(pos) + + local player_name = user:get_player_name() + local meta = minetest.get_meta(pos) ; if not meta then return end + local owner = meta:get_string("owner") + local prot = meta:get_string("doors_protected") + local ok = 0 + local infotext = "" + + if prot == "" + and owner == "" then + + -- flip normal to owned + if minetest.is_protected(pos, player_name) then + minetest.record_protection_violation(pos, player_name) + else + infotext = "Owned by " .. player_name + owner = player_name + prot = "" + ok = 1 + end + + elseif prot == "" + and owner ~= "" then + + -- flip owned to protected + if player_name == owner then + infotext = "Protected by " .. player_name + owner = "" + prot = player_name + ok = 1 + end + + elseif prot ~= "" + and owner == "" then + + -- flip protected to normal + if player_name == prot then + infotext = " " + owner = "" + prot = "" + ok = 1 + end + end + + if ok == 1 then + + meta:set_string("infotext", infotext) + meta:set_string("owner", owner) + meta:set_string("doors_protected", prot) + + if not is_creative_enabled_for(player_name) then + itemstack:add_wear(65535 / 50) + end + end + + return itemstack + end +}) + +minetest.register_craft({ + output = "doors:key", + recipe = { + {"", "", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot", ""}, + {"default:steel_ingot", "default:steel_ingot", ""} + } +}) + +-- remove default key +--if minetest.registered_craftitems["default:skeleton_key"] then +-- minetest.clear_craft({output = "default:skeleton_key"}) +--end ----fence gate---- +local fence_collision_extra = minetest.settings:get_bool("enable_fence_tall") and 3/8 or 0 function doors.register_fencegate(name, def) + local fence = { description = def.description, drawtype = "mesh", @@ -717,20 +967,25 @@ function doors.register_fencegate(name, def) connect_sides = {"left", "right"}, groups = def.groups, sounds = def.sounds, + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) + local node_def = minetest.registered_nodes[node.name] + minetest.swap_node(pos, {name = node_def.gate, param2 = node.param2}) + minetest.sound_play(node_def.sound, {pos = pos, gain = 0.3, - max_hear_distance = 8}) + max_hear_distance = 8}, true) + return itemstack end, + selection_box = { type = "fixed", - fixed = {-1/2, -1/2, -1/4, 1/2, 1/2, 1/4}, - }, + fixed = {-1/2, -1/2, -1/4, 1/2, 1/2, 1/4} + } } - if type(def.texture) == "string" then fence.tiles[1] = {name = def.texture, backface_culling = true} elseif def.texture.backface_culling == nil then @@ -747,22 +1002,24 @@ function doors.register_fencegate(name, def) fence.groups.fence = 1 local fence_closed = table.copy(fence) + fence_closed.mesh = "doors_fencegate_closed.obj" fence_closed.gate = name .. "_open" fence_closed.sound = "doors_fencegate_open" fence_closed.collision_box = { type = "fixed", - fixed = {-1/2, -1/2, -1/4, 1/2, 1/2, 1/4}, + fixed = {-1/2, -1/2, -1/4, 1/2, 1/2 + fence_collision_extra, 1/4} } local fence_open = table.copy(fence) + fence_open.mesh = "doors_fencegate_open.obj" fence_open.gate = name .. "_closed" fence_open.sound = "doors_fencegate_close" fence_open.groups.not_in_creative_inventory = 1 fence_open.collision_box = { type = "fixed", - fixed = {{-1/2, -1/2, -1/4, -3/8, 1/2, 1/4}, + fixed = {{-1/2, -1/2, -1/8, -3/8, 1/2 + fence_collision_extra, 1/8}, {-1/2, -3/8, -1/2, -3/8, 3/8, 0}}, } @@ -772,88 +1029,88 @@ function doors.register_fencegate(name, def) minetest.register_craft({ output = name .. "_closed", recipe = { - {"default:stick", def.material, "default:stick"}, - {"default:stick", def.material, "default:stick"} + {"group:stick", def.material, "group:stick"}, + {"group:stick", def.material, "group:stick"} } }) end + doors.register_fencegate("doors:gate_wood", { - description = "Apple Wood Fence Gate", + description = "Wooden Fence Gate", texture = "default_wood.png", material = "default:wood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} }) doors.register_fencegate("doors:gate_acacia_wood", { - description = "Acacia Wood Fence Gate", + description = "Acacia Fence Gate", texture = "default_acacia_wood.png", material = "default:acacia_wood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} }) doors.register_fencegate("doors:gate_junglewood", { - description = "Jungle Wood Fence Gate", + description = "Junglewood Fence Gate", texture = "default_junglewood.png", material = "default:junglewood", groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} }) doors.register_fencegate("doors:gate_pine_wood", { - description = "Pine Wood Fence Gate", + description = "Pine Fence Gate", texture = "default_pine_wood.png", material = "default:pine_wood", - groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3} + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} }) doors.register_fencegate("doors:gate_aspen_wood", { - description = "Aspen Wood Fence Gate", + description = "Aspen Fence Gate", texture = "default_aspen_wood.png", material = "default:aspen_wood", - groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3} + groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2} }) - ----fuels---- minetest.register_craft({ type = "fuel", recipe = "doors:trapdoor", - burntime = 7, + burntime = 7 }) minetest.register_craft({ type = "fuel", recipe = "doors:door_wood", - burntime = 14, + burntime = 14 }) minetest.register_craft({ type = "fuel", recipe = "doors:gate_wood_closed", - burntime = 7, + burntime = 7 }) minetest.register_craft({ type = "fuel", recipe = "doors:gate_acacia_wood_closed", - burntime = 8, + burntime = 8 }) minetest.register_craft({ type = "fuel", recipe = "doors:gate_junglewood_closed", - burntime = 9, + burntime = 9 }) minetest.register_craft({ type = "fuel", recipe = "doors:gate_pine_wood_closed", - burntime = 6, + burntime = 6 }) minetest.register_craft({ type = "fuel", recipe = "doors:gate_aspen_wood_closed", - burntime = 5, + burntime = 5 }) diff --git a/mods/doors/mod.conf b/mods/doors/mod.conf new file mode 100644 index 0000000..352c795 --- /dev/null +++ b/mods/doors/mod.conf @@ -0,0 +1,4 @@ +name = doors +depends = default +optional_depends = screwdriver, creative +description = Replaces default doors and adds protection support with switching key. diff --git a/mods/doors/models/door_a.b3d b/mods/doors/models/door_a.b3d new file mode 100644 index 0000000..7f9249f Binary files /dev/null and b/mods/doors/models/door_a.b3d differ diff --git a/mods/doors/models/door_a.obj b/mods/doors/models/door_a.obj deleted file mode 100644 index bd5127b..0000000 --- a/mods/doors/models/door_a.obj +++ /dev/null @@ -1,40 +0,0 @@ -# Blender v2.76 (sub 0) OBJ File: 'door_a.blend' -# www.blender.org -mtllib door_a.mtl -o Cube_Cube.001 -v 0.499000 -0.499000 -0.499000 -v 0.499000 1.499000 -0.499000 -v 0.499000 -0.499000 -0.375000 -v 0.499000 1.499000 -0.375000 -v -0.499000 -0.499000 -0.499000 -v -0.499000 1.499000 -0.499000 -v -0.499000 -0.499000 -0.375000 -v -0.499000 1.499000 -0.375000 -vt 0.842105 1.000000 -vt 0.894737 1.000000 -vt 0.894737 0.000000 -vt 0.842105 0.000000 -vt 0.421053 1.000000 -vt 0.421053 0.000000 -vt 0.947368 1.000000 -vt 0.947368 0.000000 -vt 0.000000 1.000000 -vt 0.000000 0.000000 -vt 1.000000 0.500000 -vt 0.947368 0.500000 -vt 1.000000 1.000000 -vt 1.000000 0.000000 -vn 1.000000 0.000000 0.000000 -vn 0.000000 0.000000 1.000000 -vn -1.000000 0.000000 0.000000 -vn 0.000000 0.000000 -1.000000 -vn 0.000000 -1.000000 0.000000 -vn 0.000000 1.000000 0.000000 -usemtl None -s off -f 2/1/1 4/2/1 3/3/1 1/4/1 -f 4/5/2 8/1/2 7/4/2 3/6/2 -f 8/2/3 6/7/3 5/8/3 7/3/3 -f 6/9/4 2/5/4 1/6/4 5/10/4 -f 1/11/5 3/12/5 7/7/5 5/13/5 -f 6/14/6 8/8/6 4/12/6 2/11/6 diff --git a/mods/doors/models/door_b.b3d b/mods/doors/models/door_b.b3d new file mode 100644 index 0000000..77a1a16 Binary files /dev/null and b/mods/doors/models/door_b.b3d differ diff --git a/mods/doors/models/door_b.obj b/mods/doors/models/door_b.obj deleted file mode 100644 index c5607b8..0000000 --- a/mods/doors/models/door_b.obj +++ /dev/null @@ -1,40 +0,0 @@ -# Blender v2.76 (sub 0) OBJ File: 'door_b.blend' -# www.blender.org -mtllib door_b.mtl -o Cube_Cube.001 -v -0.499000 -0.499000 -0.499000 -v -0.499000 1.499000 -0.499000 -v -0.499000 -0.499000 -0.375000 -v -0.499000 1.499000 -0.375000 -v 0.499000 -0.499000 -0.499000 -v 0.499000 1.499000 -0.499000 -v 0.499000 -0.499000 -0.375000 -v 0.499000 1.499000 -0.375000 -vt 0.842105 1.000000 -vt 0.842105 0.000000 -vt 0.894737 0.000000 -vt 0.894737 1.000000 -vt 0.421053 1.000000 -vt 0.421053 0.000000 -vt 0.947368 0.000000 -vt 0.947368 1.000000 -vt 0.000000 1.000000 -vt 0.000000 0.000000 -vt 1.000000 0.000000 -vt 1.000000 0.500000 -vt 0.947368 0.500000 -vt 1.000000 1.000000 -vn -1.000000 0.000000 0.000000 -vn 0.000000 0.000000 1.000000 -vn 1.000000 0.000000 0.000000 -vn 0.000000 0.000000 -1.000000 -vn 0.000000 -1.000000 0.000000 -vn 0.000000 1.000000 0.000000 -usemtl None -s off -f 2/1/1 1/2/1 3/3/1 4/4/1 -f 4/5/2 3/6/2 7/2/2 8/1/2 -f 8/4/3 7/3/3 5/7/3 6/8/3 -f 6/9/4 5/10/4 1/6/4 2/5/4 -f 1/11/5 5/12/5 7/13/5 3/7/5 -f 6/8/6 2/13/6 4/12/6 8/14/6 diff --git a/mods/doors/screenshot.png b/mods/doors/screenshot.png new file mode 100644 index 0000000..6220f8b Binary files /dev/null and b/mods/doors/screenshot.png differ diff --git a/mods/doors/textures/doors_door_glass.png b/mods/doors/textures/doors_door_glass.png index 26c427b..afc36ed 100644 Binary files a/mods/doors/textures/doors_door_glass.png and b/mods/doors/textures/doors_door_glass.png differ diff --git a/mods/doors/textures/doors_door_iceage.png b/mods/doors/textures/doors_door_iceage.png new file mode 100644 index 0000000..39cb956 Binary files /dev/null and b/mods/doors/textures/doors_door_iceage.png differ diff --git a/mods/doors/textures/doors_door_obsidian_glass.png b/mods/doors/textures/doors_door_obsidian_glass.png index 07ac5b2..6229c94 100644 Binary files a/mods/doors/textures/doors_door_obsidian_glass.png and b/mods/doors/textures/doors_door_obsidian_glass.png differ diff --git a/mods/doors/textures/doors_door_phiwari.png b/mods/doors/textures/doors_door_phiwari.png new file mode 100644 index 0000000..5a95fa5 Binary files /dev/null and b/mods/doors/textures/doors_door_phiwari.png differ diff --git a/mods/doors/textures/doors_item_glass.png b/mods/doors/textures/doors_item_glass.png index 791a58a..ee310a1 100644 Binary files a/mods/doors/textures/doors_item_glass.png and b/mods/doors/textures/doors_item_glass.png differ diff --git a/mods/doors/textures/doors_item_iceage.png b/mods/doors/textures/doors_item_iceage.png new file mode 100644 index 0000000..3b71d83 Binary files /dev/null and b/mods/doors/textures/doors_item_iceage.png differ diff --git a/mods/doors/textures/doors_item_obsidian_glass.png b/mods/doors/textures/doors_item_obsidian_glass.png index 1026d43..01690de 100644 Binary files a/mods/doors/textures/doors_item_obsidian_glass.png and b/mods/doors/textures/doors_item_obsidian_glass.png differ diff --git a/mods/doors/textures/doors_item_phiwari.png b/mods/doors/textures/doors_item_phiwari.png new file mode 100644 index 0000000..aa634f7 Binary files /dev/null and b/mods/doors/textures/doors_item_phiwari.png differ diff --git a/mods/doors/textures/doors_key.png b/mods/doors/textures/doors_key.png new file mode 100644 index 0000000..e69a71c Binary files /dev/null and b/mods/doors/textures/doors_key.png differ diff --git a/mods/doors/textures/doors_trapdoor_side.png b/mods/doors/textures/doors_trapdoor_side.png index c45d870..55981ea 100644 Binary files a/mods/doors/textures/doors_trapdoor_side.png and b/mods/doors/textures/doors_trapdoor_side.png differ diff --git a/mods/doors/textures/doors_trapdoor_steel_side.png b/mods/doors/textures/doors_trapdoor_steel_side.png index 44c4344..e29c59e 100644 Binary files a/mods/doors/textures/doors_trapdoor_steel_side.png and b/mods/doors/textures/doors_trapdoor_steel_side.png differ diff --git a/mods/farming/README.md b/mods/farming/README.md new file mode 100644 index 0000000..6b957b2 --- /dev/null +++ b/mods/farming/README.md @@ -0,0 +1,302 @@ +minetest mod Farming Redo +========================= + +This mod improves all food and farming related content + +Information +----------- + +This mod must be named `farming` a simplified version of the built-in farming mod in minetest +but improved with more foods, it comes with wheat, cotton, carrot, cucumber, +potato and tomato to start out with which spawn throughout the map... + +It also features that foods can be planted on tilled soil so no seeds are required, +original wheat and cotton will require seeds which are found inside normal and jungle grass... + +![screenshot.png](screenshot.png) + +Tech information +---------------- + +This mod sustitute default one, you must disable the default of minetest +game if present or override it. + +This mod works by adding your new plant to the {growing=1} group +and numbering the stages with sufix from `_1` to as many stages as you like, +but the underscore MUST be used only once in the node name +to separate plant from stage number e.g.: + +* `farming:cotton_1` through to `farming:cotton_8` will grow up with 8 times passed +* `farming:wheat_6` through to `farming:wheat_8` will grow up with 3 times passed, but looks like faster +* `farming:cucumber_4` through to `farming:cucumber_4` will grow up inmediatelly + +https://forum.minetest.net/viewtopic.php?id=9019 + +**It provides 47 lucky blocks.** + +Farming Redo also works with Bonemeal mod for quick growing crops and saplings +at https://notabug.org/TenPlus1/bonemeal + +#### Dependencies + +* default + +Optional dependences: + +* stairs +* intllib (only for older engines) +* lucky_block +* toolranks + +It detects other mods like FarmingPlus, Ethereal and Bonemeal etc, +but cannot set to optional depends becouse of the bug of circular depends. + +#### Configuration + +It reads the configuration values from two places, `minetest.conf` and `farming.conf`, this last +must be at world path, if you have older place at mod path will be read but must be deprecated. + + +| Configuration | type | default | place file | Notes about | +| -------------------- | ----- | ------- | ------------ | ----------------------------------------- | +| time_speed | float | 73 | minetest.conf | Speed to grow up the plants on engine (used as base for seed) | +| farming_stage_length | float | 160.0 | minetest.conf | Contains a value used for speed of crop growth in seconds | +| farming.rarety | float | 0.002 | farming.conf | default rarety of crops on map (higher number = more crops) | +| farming.min_light | int | 12 | farming.conf | default minimum and maximum light levels crops need to grow | +| farming.max_light | int | 15 | farming.conf | default minimum and maximum light levels crops need to grow | +| farming.carrot | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.potato | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.tomato | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.cucumber | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.corn | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.coffee | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.melon | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.pumpkin | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.cocoa | bool | true | farming.conf | true or false only | +| farming.raspberry | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.blueberry | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.rhubarb | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.beans | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.grapes | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.barley | bool | true | farming.conf | true or false only | +| farming.chili | float | 0.003 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.hemp | float | 0.003 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.garlic | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.onion | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.pepper | float | 0.002 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.pineapple | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.peas | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.beetroot | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.mint | float | 0.005 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.cabbage | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.blackberry | float | 0.002 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.lettuce | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.soy | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.vanilla | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.artichoke | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.parsley | float | 0.002 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.sunflower | float | 0.001 | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | +| farming.grains | bool | true | farming.conf | true or false only | +| farming.rice | bool | true | farming.conf | true to enable crop/food in-game and on mapgen set spawn rarety | + +#### Nodes and food + +This farming mod provides a large featured basic foods production of farming: + +| Node name | Description name | +| ----------------------- | --------------------- | +| farming:salt | Salt | +| farming:salt_crystal | Salt crystal | +| farming:rose_water | Rose Water | +| farming:glass_water | Glass of Water | +| farming:sugar | Sugar | +| farming:caramel | Caramel | +| farming:turkish_delight | Turkish Delight | +| farming:garlic_bread | Garlic Bread | +| farming:donut | Donut | +| farming:donut_chocolate | Chocolate Donut | +| farming:donut_apple | Apple Donut | +| farming:porridge | Porridge | +| farming:jaffa_cake | Jaffa Cake | +| farming:apple_pie | Apple Pie | +| farming:cactus_juice | Cactus Juice | +| farming:pasta | Pasta | +| farming:spaghetti | Spaghetti | +| farming:bibimbap | Bibimbap | +| farming:burger | Burger | +| farming:salad | Salad | +| farming:smoothie_berry | Triple Berry Smoothie | +| farming:spanish_potatoes | Spanish Potatoes | +| farming:potato_omelet | Potato omelet | +| farming:paella | Paella | +| farming:flan | Vanilla Flan | +| farming:cheese_vegan | Vegan Cheese | +| farming:onigiri | Onirigi | +| farming:gyoza | Gyoza | +| farming:mochi | Mochi | + +TODO: list `crops/*lua` files and compare + + + +#### Items tools + +| farming:scythe_mithril | Mithril Scythe (Use to harvest and replant crops) | +| farming:hoe_bomb | Hoe Bomb (use or throw on grassy areas to hoe land) | +| farming:hoe_wood | Wooden Hoe | +| farming:hoe_stone | Stone Hoe | +| farming:hoe_steel | Steel Hoe | +| farming:hoe_bronze | Bronze Hoe | +| farming:hoe_mese | Mese Hoe | +| farming:hoe_diamond | Diamond Hoe | +| farming:bowl | Wooden Bowl | +| farming:saucepan | Saucepan | +| farming:pot | Cooking Pot | +| farming:baking_tray | Baking Tray | +| farming:skillet | Skillet | +| farming:mortar_pestle | Mortar and Pestle | +| farming:cutting_board | Cutting Board | +| farming:juicer | Juicer | +| farming:mixing_bowl | Glass Mixing Bowl | +| moreores:hoe_silver | Silver Hoe | +| moreores:hoe_mithril | Mitril Hoe | + + +#### Nodes and Aliasing + +Depending of the detection of mods some nodes are aliasing, +if those mods/nodes are not present, will be (re)defined/provided, +note for the both "farming" names here, in the left side its +about default Farming mod, not Farming Redo one. + + +| mod name : node name | new mod name : new node | +| --------------------------- | ----------------------- | +| farming:big_pumpkin | farming:jackolantern | +| farming:big_pumpkin_side | air (will be jackolanter) | +| farming:big_pumpkin_top | air (will be jackolanter) | +| farming:big_pumpkin_corner | air (will be jackolanter) | +| farming:pumpkin_seed | farming:pumpkin_slice | +| farming:pumpkin_face | farming:jackolantern | +| farming:pumpkin_face_light | farming:jackolantern_on | +| farming:scarecrow | farming:jackolantern | +| farming:scarecrow_light | farming:jackolantern_on | +| farming:pumpkin_flour | farming:pumpkin_dough | +| farming:weed | default:grass_2 | +| farming_plus:banana_sapling | default:sapling | +| farming_plus:banana | ethereal:banana | +| farming_plus:banana_sapling | ethereal:banana_tree_sapling | +| farming_plus:banana_leaves | ethereal:bananaleaves | +| farming_plus:orange | ethereal:orange | +| farming_plus:orange_item | ethereal:orange | +| farming_plus:orange_seed | ethereal:orange_tree_sapling | +| farming_plus:strawberry_item | ethereal:strawberry | +| farming_plus:strawberry_seed | ethereal:strawberry | +| farming_plus:strawberry_1 | ethereal:strawberry_1 | +| farming_plus:strawberry_2 | ethereal:strawberry_3 | +| farming_plus:strawberry_3 | ethereal:strawberry_5 | +| farming_plus:strawberry | ethereal:strawberry_7 | +| farming_plus:strawberry_item | ethereal:strawberry | +| farming_plus:strawberry_seed | ethereal:strawberry | +| farming_plus:strawberry_1 | farming:raspberry_1 | +| farming_plus:strawberry_2 | farming:raspberry_2 | +| farming_plus:strawberry_3 | farming:raspberry_3 | +| farming_plus:strawberry | farming:raspberry_4 | +| farming_plus:carrot_seed | farming:carrot | +| farming_plus:carrot_1 | farming:carrot_1 | +| farming_plus:carrot_2 | farming:carrot_4 | +| farming_plus:carrot_3 | farming:carrot_6 | +| farming_plus:carrot | farming:carrot_8 | +| farming_plus:carrot_item | farming:carrot | +| farming_plus:cocoa_sapling | farming:cocoa_beans | +| farming_plus:cocoa_bean | farming:cocoa_beans | +| farming_plus:cocoa_leaves | default:leaves | +| farming_plus:cocoa | default:apple | +| farming_plus:orange_seed | default:sapling | +| farming_plus:orange_1 | farming:tomato_1 | +| farming_plus:orange_2 | farming:tomato_4 | +| farming_plus:orange_3 | farming:tomato_6 | +| farming_plus:potato_item | farming:potato | +| farming_plus:potato_1 | farming:potato_1 | +| farming_plus:potato_2 | farming:potato_2 | +| farming_plus:potato | farming:potato_3 | +| farming_plus:potato_seed | farming:potato | +| farming_plus:rhubarb_seed | farming:rhubarb | +| farming_plus:rhubarb_1 | farming:rhubarb_1 | +| farming_plus:rhubarb_2 | farming:rhubarb_2 | +| farming_plus:rhubarb | farming:rhubarb_3 | +| farming_plus:rhubarb_item | farming:rhubarb | +| farming_plus:tomato_seed | farming:tomato | +| farming_plus:tomato_item | farming:tomato | +| farming_plus:tomato_1 | farming:tomato_2 | +| farming_plus:tomato_2 | farming:tomato_4 | +| farming_plus:tomato_3 | farming:tomato_6 | +| farming_plus:tomato | farming:tomato_8 | + +#### AMB + +There one abm for new group `group:growing`. + + +#### development notes + +To check nodes a usefull command are `| grep -A2 'register\_' | grep S -B2 | grep -v '\-\-'` +this can be used in a loop for over all files using `find`. + +### Changelog: + +- 1.46 - Added min/max default light settings, added lettuce and blackberries with food items (thanks OgelGames), added soya, vanilla and sunflowers (thanks Felfa), added tofu, added salt crystals (thanks gorlock) +- 1.45 - Dirt and Hoes are more in line with default by using dry/wet/base, added cactus juice, added pasta, spaghetti, cabbage, korean bibimbap, code tidy +options, onion soup added (thanks edcrypt), Added apple pie, added wild cotton to savanna +- 1.44 - Added 'farming_stage_length' in mod settings for speed of crop growth, also thanks to TheDarkTiger for translation updates +- 1.43 - Scythe works on use instead of right-click, added seed=1 groups to actual seeds and seed=2 group for plantable food items. +- 1.42 - Soil needs water to be present within 3 blocks horizontally and 1 below to make wet soil, Jack 'o Lanterns now check protection, add chocolate block. +- 1.41 - Each crop has it's own spawn rate (can be changed in farming.conf) +- 1.40 - Added Mithril Scythe to quick harvest and replant crops on right-click. Added Hoe's for MoreOres with Toolrank support. +- 1.39 - Added Rice, Rye and Oats thanks to Ademants Grains mod. Added Jaffa Cake and multigrain bread. +- 1.38 - Pumpkin grows into block, use chopping board to cut into 4x slices, same with melon block, 2x2 slices makes a block, cocoa pods are no longer walkable +- 1.37 - Added custom 'growth_check(pos, nodename) function for crop nodes to use (check cocoa.lua for example) +- 1.36 - Added Beetroot, Beetroot Soup (6x beetroot, 1x bowl), fix register_plant() issue, add new recipes +- 1.35 - Deprecated bronze/mese/diamond hoe's, added hoe bomb and deprecated hoe's as lucky block prizes +- 1.34 - Added scarecrow Base (5x sticks in a cross shape) +- 1.33 - Added cooking utensils (wooden bowl, saucepan, cooking pot, baking tray, skillet, cutting board, mortar & pestle, juicer, glass mixing bowl) for easier food crafts. +- 1.32 - Added Pea plant (textures by Andrey01) - also added Wooden Bowl and Pea Soup crafts +- 1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water, added food groups so it's more compatible with Ruben's food mods. +- 1.30 - Added Garlic, Pepper and Onions thanks to Grizzly Adam for sharing textures +- 1.29 - Updating functions so requires Minetest 0.4.16 and above to run +- 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. +- 1.23 - Huge code tweak and tidy done and added barley seeds to be found in dry grass, barley can make flour for bread also. +- 1.22 - Added grape bushes at high climates which can be cultivated into grape vines using trellis (9 sticks). +- 1.21 - Added auto-refill code for planting crops (thanks crabman77), also fixed a few bugs +- 1.20b - Tidied code, made api compatible with new 0.4.13 changes and changed to soil texture overlays +- 1.20 - NEW growing routine added that allows crops to grow while player is away doing other things (thanks prestidigitator) +- 1.14 - Added Green Beans from Crops mod (thanks sofar), little bushels in the wild but need to be grown using beanpoles crafted with 4 sticks (2 either side) +- 1.13 - Fixed seed double-placement glitch. Mapgen now uses 0.4.12+ for plant generation +- 1.12 - Player cannot place seeds in protected area, also growing speeds changed to match defaults +- 1.11 - Added Straw Bale, streamlined growing abm a little, fixed melon rotation bug with screwdriver +- 1.10 - Added Blueberry Bush and Blueberry Muffins, also Pumpkin/Melon easier to pick up, added check for unloaded map +- 1.09 - Corn now uses single nodes instead of 1 ontop of the other, Ethanol recipe is more expensive (requires 5 corn) and some code cleanup. +- 1.08 - Added Farming Plus compatibility, plus can be removed and no more missing nodes +- 1.07 - Added Rhubarb and Rhubarb Pie +- 1.06 - register_hoe and register_plant added for compatibility with default farming mod, although any plants registered will use farming redo to grow +- 1.05 - Added Raspberry Bushels and Raspberry Smoothie +- 1.04 - Added Donuts... normal, chocolate and apple... and a few code cleanups and now compatible with jungletree's from MoreTrees mod +- 1.03 - Bug fixes and more compatibility as drop-in replacement for built-in farming mod +- 1.02 - Added farming.mod string to help other mods identify which farming mod is running, if it returns "redo" then you're using this one, "" empty is built-in mod +- 1.01 - Crafting coffee or ethanol returns empty bucket/bottle, also Cocoa spawns a little rarer +- 1.0 - Added Cocoa which randomly grows on jungle tree's, pods give cocoa beans which can be used to farm more pods on a jungle trunk or make Cookies which have been added (or other treats) +- 0.9 - Added Pumpkin, Jack 'O Lantern, Pumpkin Slice and Sugar (a huge thanks to painterly.net for allowing me to use their textures) +- 0.8 - Added Watermelon and Melon Slice +- 0.7 - Added Coffee, Coffee Beans, Drinking Cup, Cold and Hot Cup of Coffee +- 0.6 - Added Corn, Corn on the Cob... Also reworked Abm +- 0.5 - Added Carrot, Cucumber, Potato (and Baked Potato), Tomato +- 0.4 - Checks for Protection, also performance changes +- 0.3 - Added Diamond and Mese hoe +- 0.2 - Fixed check for wet soil +- 0.1 - Fixed growing bug +- 0.0 - Initial release + diff --git a/mods/farming/README.txt b/mods/farming/README.txt deleted file mode 100644 index d46748d..0000000 --- a/mods/farming/README.txt +++ /dev/null @@ -1,40 +0,0 @@ -Minetest Game mod: farming -========================== -See license.txt for license information. - -Authors of source code ----------------------- -Originally by PilzAdam (MIT) -webdesigner97 (MIT) -Various Minetest developers and contributors (MIT) - -Authors of media (textures) ---------------------------- -Created by PilzAdam (CC BY 3.0): - farming_bread.png - farming_soil.png - farming_soil_wet.png - farming_soil_wet_side.png - farming_string.png - -Created by BlockMen (CC BY 3.0): - farming_tool_diamondhoe.png - farming_tool_mesehoe.png - farming_tool_bronzehoe.png - farming_tool_steelhoe.png - farming_tool_stonehoe.png - farming_tool_woodhoe.png - -Created by MasterGollum (CC BY 3.0): - farming_straw.png - -Created by Gambit (CC BY 3.0): - farming_wheat.png - farming_wheat_*.png - farming_cotton_*.png - farming_flour.png - farming_cotton_seed.png - farming_wheat_seed.png - -Created by Napiophelios (CC BY-SA 3.0): - farming_cotton.png diff --git a/mods/farming/api.lua b/mods/farming/api.lua deleted file mode 100644 index 1c63ee3..0000000 --- a/mods/farming/api.lua +++ /dev/null @@ -1,398 +0,0 @@ - --- Wear out hoes, place soil --- TODO Ignore group:flower -farming.registered_plants = {} - -farming.hoe_on_use = function(itemstack, user, pointed_thing, uses) - local pt = pointed_thing - -- check if pointing at a node - if not pt then - return - end - if pt.type ~= "node" then - return - end - - local under = minetest.get_node(pt.under) - local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} - local above = minetest.get_node(p) - - -- return if any of the nodes is not registered - if not minetest.registered_nodes[under.name] then - return - end - if not minetest.registered_nodes[above.name] then - return - end - - -- check if the node above the pointed thing is air - if above.name ~= "air" then - return - end - - -- check if pointing at soil - if minetest.get_item_group(under.name, "soil") ~= 1 then - return - end - - -- check if (wet) soil defined - local regN = minetest.registered_nodes - if regN[under.name].soil == nil or regN[under.name].soil.wet == nil or regN[under.name].soil.dry == nil then - return - end - - if minetest.is_protected(pt.under, user:get_player_name()) then - minetest.record_protection_violation(pt.under, user:get_player_name()) - return - end - if minetest.is_protected(pt.above, user:get_player_name()) then - minetest.record_protection_violation(pt.above, user:get_player_name()) - return - end - - -- turn the node into soil and play sound - minetest.set_node(pt.under, {name = regN[under.name].soil.dry}) - minetest.sound_play("default_dig_crumbly", { - pos = pt.under, - gain = 0.5, - }) - - if not (creative and creative.is_enabled_for - and creative.is_enabled_for(user:get_player_name())) then - -- wear tool - local wdef = itemstack:get_definition() - itemstack:add_wear(65535/(uses-1)) - -- tool break sound - if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then - minetest.sound_play(wdef.sound.breaks, {pos = pt.above, gain = 0.5}) - end - end - return itemstack -end - --- Register new hoes -farming.register_hoe = function(name, def) - -- Check for : prefix (register new hoes in your mod's namespace) - if name:sub(1,1) ~= ":" then - name = ":" .. name - end - -- Check def table - if def.description == nil then - def.description = "Hoe" - end - if def.inventory_image == nil then - def.inventory_image = "unknown_item.png" - end - if def.recipe == nil then - def.recipe = { - {"air","air",""}, - {"","group:stick",""}, - {"","group:stick",""} - } - end - if def.max_uses == nil then - def.max_uses = 30 - end - -- Register the tool - minetest.register_tool(name, { - description = def.description, - inventory_image = def.inventory_image, - on_use = function(itemstack, user, pointed_thing) - return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses) - end, - groups = def.groups, - sound = {breaks = "default_tool_breaks"}, - }) - -- Register its recipe - if def.material == nil then - minetest.register_craft({ - output = name:sub(2), - recipe = def.recipe - }) - else - minetest.register_craft({ - output = name:sub(2), - recipe = { - {def.material, def.material, ""}, - {"", "group:stick", ""}, - {"", "group:stick", ""} - } - }) - end -end - --- how often node timers for plants will tick, +/- some random value -local function tick(pos) - minetest.get_node_timer(pos):start(math.random(166, 286)) -end --- how often a growth failure tick is retried (e.g. too dark) -local function tick_again(pos) - minetest.get_node_timer(pos):start(math.random(40, 80)) -end - --- Seed placement -farming.place_seed = function(itemstack, placer, pointed_thing, plantname) - local pt = pointed_thing - -- check if pointing at a node - if not pt then - return itemstack - end - if pt.type ~= "node" then - return itemstack - end - - local under = minetest.get_node(pt.under) - local above = minetest.get_node(pt.above) - - local player_name = placer and placer:get_player_name() or "" - - if minetest.is_protected(pt.under, player_name) then - minetest.record_protection_violation(pt.under, player_name) - return - end - if minetest.is_protected(pt.above, player_name) then - minetest.record_protection_violation(pt.above, player_name) - return - end - - -- return if any of the nodes is not registered - if not minetest.registered_nodes[under.name] then - return itemstack - end - if not minetest.registered_nodes[above.name] then - return itemstack - end - - -- check if pointing at the top of the node - if pt.above.y ~= pt.under.y+1 then - return itemstack - end - - -- check if you can replace the node above the pointed node - if not minetest.registered_nodes[above.name].buildable_to then - return itemstack - end - - -- check if pointing at soil - if minetest.get_item_group(under.name, "soil") < 2 then - return itemstack - end - - -- add the node and remove 1 item from the itemstack - minetest.add_node(pt.above, {name = plantname, param2 = 1}) - tick(pt.above) - if not (creative and creative.is_enabled_for - and creative.is_enabled_for(player_name)) then - itemstack:take_item() - end - return itemstack -end - -farming.grow_plant = function(pos, elapsed) - local node = minetest.get_node(pos) - local name = node.name - local def = minetest.registered_nodes[name] - - if not def.next_plant then - -- disable timer for fully grown plant - return - end - - -- grow seed - if minetest.get_item_group(node.name, "seed") and def.fertility then - local soil_node = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) - if not soil_node then - tick_again(pos) - return - end - -- omitted is a check for light, we assume seeds can germinate in the dark. - for _, v in pairs(def.fertility) do - if minetest.get_item_group(soil_node.name, v) ~= 0 then - local placenode = {name = def.next_plant} - if def.place_param2 then - placenode.param2 = def.place_param2 - end - minetest.swap_node(pos, placenode) - if minetest.registered_nodes[def.next_plant].next_plant then - tick(pos) - return - end - end - end - - return - end - - -- check if on wet soil - local below = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) - if minetest.get_item_group(below.name, "soil") < 3 then - tick_again(pos) - return - end - - -- check light - local light = minetest.get_node_light(pos) - if not light or light < def.minlight or light > def.maxlight then - tick_again(pos) - return - end - - -- grow - local placenode = {name = def.next_plant} - if def.place_param2 then - placenode.param2 = def.place_param2 - end - minetest.swap_node(pos, placenode) - - -- new timer needed? - if minetest.registered_nodes[def.next_plant].next_plant then - tick(pos) - end - return -end - --- Register plants -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 = "Seed" - end - if not def.inventory_image then - def.inventory_image = "unknown_item.png" - end - if not def.steps then - return nil - end - if not def.minlight then - def.minlight = 1 - end - if not def.maxlight then - def.maxlight = 14 - end - if not def.fertility then - def.fertility = {} - end - - farming.registered_plants[pname] = def - - -- Register seed - local lbm_nodes = {mname .. ":seed_" .. pname} - local g = {seed = 1, snappy = 3, attached_node = 1, flammable = 2} - for k, v in pairs(def.fertility) do - g[v] = 1 - end - minetest.register_node(":" .. mname .. ":seed_" .. pname, { - description = def.description, - tiles = {def.inventory_image}, - inventory_image = def.inventory_image, - wield_image = def.inventory_image, - drawtype = "signlike", - groups = g, - paramtype = "light", - paramtype2 = "wallmounted", - place_param2 = def.place_param2 or nil, -- this isn't actually used for placement - walkable = false, - sunlight_propagates = true, - selection_box = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, - }, - fertility = def.fertility, - sounds = default.node_sound_dirt_defaults({ - dig = {name = "", gain = 0}, - dug = {name = "default_grass_footstep", gain = 0.2}, - place = {name = "default_place_node", gain = 0.25}, - }), - - on_place = function(itemstack, placer, pointed_thing) - local under = pointed_thing.under - local node = minetest.get_node(under) - local udef = minetest.registered_nodes[node.name] - if udef and udef.on_rightclick and - not (placer and placer:is_player() and - placer:get_player_control().sneak) then - return udef.on_rightclick(under, node, placer, itemstack, - pointed_thing) or itemstack - end - - return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":seed_" .. pname) - end, - next_plant = mname .. ":" .. pname .. "_1", - on_timer = farming.grow_plant, - minlight = def.minlight, - maxlight = def.maxlight, - }) - - -- Register harvest - minetest.register_craftitem(":" .. mname .. ":" .. pname, { - description = pname:gsub("^%l", string.upper), - inventory_image = mname .. "_" .. pname .. ".png", - groups = {flammable = 2}, - }) - - -- Register growing steps - for i = 1, def.steps do - local base_rarity = 1 - if def.steps ~= 1 then - base_rarity = 8 - (i - 1) * 7 / (def.steps - 1) - end - local drop = { - items = { - {items = {mname .. ":" .. pname}, rarity = base_rarity}, - {items = {mname .. ":" .. pname}, rarity = base_rarity * 2}, - {items = {mname .. ":seed_" .. pname}, rarity = base_rarity}, - {items = {mname .. ":seed_" .. pname}, rarity = base_rarity * 2}, - } - } - local nodegroups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1} - nodegroups[pname] = i - - local next_plant = nil - - if i < def.steps then - next_plant = mname .. ":" .. pname .. "_" .. (i + 1) - lbm_nodes[#lbm_nodes + 1] = mname .. ":" .. pname .. "_" .. i - end - - minetest.register_node(":" .. mname .. ":" .. pname .. "_" .. i, { - 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 = { - type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, - }, - groups = nodegroups, - sounds = default.node_sound_leaves_defaults(), - next_plant = next_plant, - on_timer = farming.grow_plant, - minlight = def.minlight, - maxlight = def.maxlight, - }) - end - - -- replacement LBM for pre-nodetimer plants - minetest.register_lbm({ - name = ":" .. mname .. ":start_nodetimer_" .. pname, - nodenames = lbm_nodes, - action = function(pos, node) - tick_again(pos) - end, - }) - - -- Return - local r = { - seed = mname .. ":seed_" .. pname, - harvest = mname .. ":" .. pname - } - return r -end diff --git a/mods/farming/api.txt b/mods/farming/api.txt new file mode 100644 index 0000000..81092c6 --- /dev/null +++ b/mods/farming/api.txt @@ -0,0 +1,64 @@ +Farming API +----------- + +The farming API allows you to easily register plants and hoes. + +`farming.register_hoe(name, hoe definition)` + * Register a new hoe, see [#hoe definition] + +`farming.register_plant(name, Plant definition)` + * Register a new growing plant, see [#Plant definition] + +`farming.registered_plants[name] = definition` + * Table of registered plants, indexed by plant name + 'crop' holds name of growing crop node minus _step-number at end + 'seed' has name of seed required to plant crop + 'minlight' min light level needed to grow + 'maxlight' max light level needed to grow + 'steps' number of steps crop has in growth cycle + +### Hoe Definition + + + { + description = "My Hoe", -- Description for tooltip + inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image + max_uses = 30, -- Uses until destroyed + material = "", -- Material for recipes + recipe = { -- Craft recipe, if material isn't used + {"air", "air", "air"}, + {"", "group:stick"}, + {"", "group:stick"}, + } + } + +### Plant definition + + { + description = "My Plant", -- Description of seed item + inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image + steps = 8, -- How many steps the plant has to grow, until it can be harvested + -- ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber) + minlight = 13, -- Minimum light to grow + maxlight = default.LIGHT_MAX -- Maximum light to grow + } + +Note: Any crops registered with the above function will use the new growing routines, also if crops are manually added with the {growing=1} group they will also grow. + +### Crop functions + +If a mod registers nodes to be used as crops using the {growing=1} group then an additional function can be used for custom growth checks instead of the standard 'are we above wet soil'. + +growth_check = function(pos, node_name) + -- check surrounding for jungle tree + if minetest.find_node_near(pos, 1, {"default:jungletree"}) then + return false -- place next growth stage + end + return true -- condition not met, skip next growth stage until next check +end, + +### Scythe items that will not drop + +This is a function to add items to a list that scythes will not drop, e.g. farming:trellis or farming:beanpole. + +farming.add_to_scythe_not_drops(item_name) diff --git a/mods/farming/compatibility.lua b/mods/farming/compatibility.lua new file mode 100644 index 0000000..1fdf620 --- /dev/null +++ b/mods/farming/compatibility.lua @@ -0,0 +1,167 @@ + +local S = farming.intllib + +--= Helpers + +local eth = minetest.get_modpath("ethereal") +local alias = function(orig, new) + minetest.register_alias(orig, new) +end + +--= Overrides (add food_* group to apple and brown mushroom) + +minetest.override_item("default:apple", { + groups = {food_apple = 1, fleshy = 3, dig_immediate = 3, flammable = 2, + leafdecay = 3, leafdecay_drop = 1} +}) + +--= Aliases + +-- Banana +if eth then + alias("farming_plus:banana_sapling", "ethereal:banana_tree_sapling") + alias("farming_plus:banana_leaves", "ethereal:bananaleaves") + alias("farming_plus:banana", "ethereal:banana") +else + minetest.register_node(":ethereal:banana", { + description = S("Banana"), + drawtype = "torchlike", + tiles = {"farming_banana_single.png"}, + inventory_image = "farming_banana_single.png", + wield_image = "farming_banana_single.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2} + }, + groups = {food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2}, + on_use = minetest.item_eat(2), + sounds = default.node_sound_leaves_defaults() + }) + + minetest.register_node(":ethereal:bananaleaves", { + description = S("Banana Leaves"), + tiles = {"farming_banana_leaf.png"}, + inventory_image = "farming_banana_leaf.png", + wield_image = "farming_banana_leaf.png", + paramtype = "light", + waving = 1, + groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2}, + sounds = default.node_sound_leaves_defaults() + }) + + alias("farming_plus:banana_sapling", "default:sapling") + alias("farming_plus:banana_leaves", "ethereal:bananaleaves") + alias("farming_plus:banana", "ethereal:banana") +end + +-- Carrot +alias("farming_plus:carrot_seed", "farming:carrot") +alias("farming_plus:carrot_1", "farming:carrot_1") +alias("farming_plus:carrot_2", "farming:carrot_4") +alias("farming_plus:carrot_3", "farming:carrot_6") +alias("farming_plus:carrot", "farming:carrot_8") +alias("farming_plus:carrot_item", "farming:carrot") + +-- Cocoa +alias("farming_plus:cocoa_sapling", "farming:cocoa_beans") +alias("farming_plus:cocoa_leaves", "default:leaves") +alias("farming_plus:cocoa", "default:apple") +alias("farming_plus:cocoa_bean", "farming:cocoa_beans") + +-- Orange +alias("farming_plus:orange_1", "farming:tomato_1") +alias("farming_plus:orange_2", "farming:tomato_4") +alias("farming_plus:orange_3", "farming:tomato_6") + +if eth then + alias("farming_plus:orange_item", "ethereal:orange") + alias("farming_plus:orange", "ethereal:orange") + alias("farming_plus:orange_seed", "ethereal:orange_tree_sapling") +else + minetest.register_node(":ethereal:orange", { + description = S("Orange"), + drawtype = "plantlike", + tiles = {"farming_orange.png"}, + inventory_image = "farming_orange.png", + wield_image = "farming_orange.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.2, -0.3, -0.2, 0.2, 0.2, 0.2} + }, + groups = {food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2}, + on_use = minetest.item_eat(4), + sounds = default.node_sound_leaves_defaults() + }) + + alias("farming_plus:orange_item", "ethereal:orange") + alias("farming_plus:orange", "ethereal:orange") + alias("farming_plus:orange_seed", "default:sapling") +end + +-- Potato +alias("farming_plus:potato_item", "farming:potato") +alias("farming_plus:potato_1", "farming:potato_1") +alias("farming_plus:potato_2", "farming:potato_2") +alias("farming_plus:potato", "farming:potato_3") +alias("farming_plus:potato_seed", "farming:potato") + +-- Pumpkin +alias("farming:pumpkin_seed", "farming:pumpkin_slice") +alias("farming:pumpkin_face", "farming:jackolantern") +alias("farming:pumpkin_face_light", "farming:jackolantern_on") +alias("farming:big_pumpkin", "farming:jackolantern") +alias("farming:big_pumpkin_side", "air") +alias("farming:big_pumpkin_top", "air") +alias("farming:big_pumpkin_corner", "air") +alias("farming:scarecrow", "farming:jackolantern") +alias("farming:scarecrow_light", "farming:jackolantern_on") +alias("farming:pumpkin_flour", "farming:pumpkin_dough") + +-- Rhubarb +alias("farming_plus:rhubarb_seed", "farming:rhubarb") +alias("farming_plus:rhubarb_1", "farming:rhubarb_1") +alias("farming_plus:rhubarb_2", "farming:rhubarb_2") +alias("farming_plus:rhubarb", "farming:rhubarb_3") +alias("farming_plus:rhubarb_item", "farming:rhubarb") + +-- Strawberry +if eth then + alias("farming_plus:strawberry_item", "ethereal:strawberry") + alias("farming_plus:strawberry_seed", "ethereal:strawberry") + alias("farming_plus:strawberry_1", "ethereal:strawberry_1") + alias("farming_plus:strawberry_2", "ethereal:strawberry_3") + alias("farming_plus:strawberry_3", "ethereal:strawberry_5") + alias("farming_plus:strawberry", "ethereal:strawberry_7") +else + minetest.register_craftitem(":ethereal:strawberry", { + description = S("Strawberry"), + inventory_image = "farming_strawberry.png", + wield_image = "farming_strawberry.png", + groups = {food_strawberry = 1, flammable = 2}, + on_use = minetest.item_eat(1) + }) + + alias("farming_plus:strawberry_item", "ethereal:strawberry") + alias("farming_plus:strawberry_seed", "ethereal:strawberry") + alias("farming_plus:strawberry_1", "farming:raspberry_1") + alias("farming_plus:strawberry_2", "farming:raspberry_2") + alias("farming_plus:strawberry_3", "farming:raspberry_3") + alias("farming_plus:strawberry", "farming:raspberry_4") +end + +-- Tomato +alias("farming_plus:tomato_seed", "farming:tomato") +alias("farming_plus:tomato_item", "farming:tomato") +alias("farming_plus:tomato_1", "farming:tomato_2") +alias("farming_plus:tomato_2", "farming:tomato_4") +alias("farming_plus:tomato_3", "farming:tomato_6") +alias("farming_plus:tomato", "farming:tomato_8") + +-- Weed +alias("farming:weed", "default:grass_2") diff --git a/mods/farming/crops/artichoke.lua b/mods/farming/crops/artichoke.lua new file mode 100644 index 0000000..92143f6 --- /dev/null +++ b/mods/farming/crops/artichoke.lua @@ -0,0 +1,64 @@ +local S = farming.intllib + +-- item definition +minetest.register_craftitem("farming:artichoke", { + description = S("Artichoke"), + inventory_image = "farming_artichoke.png", + groups = {seed = 2, food_artichoke = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:artichoke_1") + end, + on_use = minetest.item_eat(4) +}) + +-- crop definition +local def = { + drawtype = "plantlike", + tiles = {"farming_artichoke_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:artichoke_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_artichoke_2.png"} +minetest.register_node("farming:artichoke_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_artichoke_3.png"} +minetest.register_node("farming:artichoke_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_artichoke_4.png"} +minetest.register_node("farming:artichoke_4", table.copy(def)) + +-- stage 5 (final) +def.tiles = {"farming_artichoke_5.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:artichoke 2"}, rarity = 1}, + {items = {"farming:artichoke"}, rarity = 2} + } +} +minetest.register_node("farming:artichoke_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:artichoke"] = { + crop = "farming:artichoke", + seed = "farming:artichoke", + minlight = 13, + maxlight = 15, + steps = 5 +} diff --git a/mods/farming/crops/barley.lua b/mods/farming/crops/barley.lua new file mode 100644 index 0000000..e7f3840 --- /dev/null +++ b/mods/farming/crops/barley.lua @@ -0,0 +1,120 @@ + +local S = farming.intllib + +-- barley seeds +minetest.register_node("farming:seed_barley", { + description = S("Barley Seed"), + tiles = {"farming_barley_seed.png"}, + inventory_image = "farming_barley_seed.png", + wield_image = "farming_barley_seed.png", + drawtype = "signlike", + groups = {seed = 1, snappy = 3, attached_node = 1}, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = farming.select, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:barley_1") + end +}) + +-- harvested barley +minetest.register_craftitem("farming:barley", { + description = S("Barley"), + inventory_image = "farming_barley.png", + groups = {food_barley = 1, flammable = 2} +}) + +-- flour +minetest.register_craft({ + output = "farming:flour", + recipe = { + {"farming:barley", "farming:barley", "farming:barley"}, + {"farming:barley", "farming:mortar_pestle", ""} + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}} +}) + +-- barley definition +local def = { + drawtype = "plantlike", + tiles = {"farming_barley_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, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:barley_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_barley_2.png"} +minetest.register_node("farming:barley_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_barley_3.png"} +minetest.register_node("farming:barley_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_barley_4.png"} +minetest.register_node("farming:barley_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_barley_5.png"} +def.drop = { + items = { + {items = {"farming:barley"}, rarity = 2}, + {items = {"farming:seed_barley"}, rarity = 2} + } +} +minetest.register_node("farming:barley_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_barley_6.png"} +def.drop = { + items = { + {items = {"farming:barley"}, rarity = 2}, + {items = {"farming:seed_barley"}, rarity = 1} + } +} +minetest.register_node("farming:barley_6", table.copy(def)) + +-- stage 7 (final) +def.tiles = {"farming_barley_7.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:barley"}, rarity = 1}, + {items = {"farming:barley"}, rarity = 3}, + {items = {"farming:seed_barley"}, rarity = 1}, + {items = {"farming:seed_barley"}, rarity = 3} + } +} +minetest.register_node("farming:barley_7", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:barley"] = { + crop = "farming:barley", + seed = "farming:seed_barley", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 7 +} + +-- Fuel +minetest.register_craft({ + type = "fuel", + recipe = "farming:barley", + burntime = 1 +}) diff --git a/mods/farming/crops/beans.lua b/mods/farming/crops/beans.lua new file mode 100644 index 0000000..f1a6e16 --- /dev/null +++ b/mods/farming/crops/beans.lua @@ -0,0 +1,254 @@ +--[[ + All textures by + (C) Auke Kok + CC-BY-SA-3.0 +]] + +local S = farming.intllib + +-- place beans +local function place_beans(itemstack, placer, pointed_thing, plantname) + + local pt = pointed_thing + + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end + + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if placer and itemstack and def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack, pt) + end + + -- is player planting crop? + local name = placer and placer:get_player_name() or "" + + -- check for protection + if minetest.is_protected(pt.under, name) then + return + end + + -- check if pointing at bean pole + if under.name ~= "farming:beanpole" then + return + end + + -- add the node and remove 1 item from the itemstack + minetest.set_node(pt.under, {name = plantname}) + + minetest.sound_play("default_place_node", {pos = pt.under, gain = 1.0}) + + if placer or not farming.is_creative(placer:get_player_name()) then + + itemstack:take_item() + + -- check for refill + if itemstack:get_count() == 0 then + + minetest.after(0.20, + farming.refill_plant, + placer, + "farming:beans", + placer:get_wield_index() + ) + end + end + + return itemstack +end + +-- beans +minetest.register_craftitem("farming:beans", { + description = S("Green Beans"), + inventory_image = "farming_beans.png", + groups = {seed = 2, food_beans = 1, flammable = 2}, + on_use = minetest.item_eat(1), + on_place = function(itemstack, placer, pointed_thing) + return place_beans(itemstack, placer, pointed_thing, "farming:beanpole_1") + end +}) + +-- beans can be used for green dye +minetest.register_craft({ + output = "dye:green", + recipe = {{"farming:beans"}} +}) + +-- beanpole +minetest.register_node("farming:beanpole", { + description = S("Bean Pole (place on soil before planting beans)"), + drawtype = "plantlike", + tiles = {"farming_beanpole.png"}, + inventory_image = "farming_beanpole.png", + visual_scale = 1.90, + paramtype = "light", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = "farming:beanpole", + selection_box = farming.select, + groups = {snappy = 3, flammable = 2, attached_node = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_place = function(itemstack, placer, pointed_thing) + + local pt = pointed_thing + + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end + + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack, pt) + end + + if minetest.is_protected(pt.above, placer:get_player_name()) then + return + end + + local nodename = under.name + + if minetest.get_item_group(nodename, "soil") < 2 then + return + end + + local top = { + x = pointed_thing.above.x, + y = pointed_thing.above.y + 1, + z = pointed_thing.above.z + } + + nodename = minetest.get_node(top).name + + if nodename ~= "air" then + return + end + + minetest.set_node(pointed_thing.above, {name = "farming:beanpole"}) + + if not farming.is_creative(placer:get_player_name()) then + itemstack:take_item() + end + + return itemstack + end +}) + +minetest.register_craft({ + output = "farming:beanpole", + recipe = { + {"", "", ""}, + {"default:stick", "", "default:stick"}, + {"default:stick", "", "default:stick"} + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:beanpole", + burntime = 10 +}) + +-- green bean definition +local def = { + drawtype = "plantlike", + tiles = {"farming_beanpole_1.png"}, + visual_scale = 1.90, + paramtype = "light", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {"farming:beanpole"}, rarity = 1} + } + }, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 3, not_in_creative_inventory = 1, + attached_node = 1, growing = 1, plant = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:beanpole_1", table.copy(def)) + +-- stage2 +def.tiles = {"farming_beanpole_2.png"} +minetest.register_node("farming:beanpole_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_beanpole_3.png"} +minetest.register_node("farming:beanpole_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_beanpole_4.png"} +minetest.register_node("farming:beanpole_4", table.copy(def)) + +-- stage 5 (final) +def.tiles = {"farming_beanpole_5.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:beanpole"}, rarity = 1}, + {items = {"farming:beans 3"}, rarity = 1}, + {items = {"farming:beans 2"}, rarity = 2}, + {items = {"farming:beans 2"}, rarity = 3} + } +} +minetest.register_node("farming:beanpole_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:beans"] = { + crop = "farming:beanpole", + seed = "farming:beans", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} + +-- wild green bean bush (this is what you find on the map) +minetest.register_node("farming:beanbush", { + drawtype = "plantlike", + tiles = {"farming_beanbush.png"}, + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {"farming:beans 1"}, rarity = 1}, + {items = {"farming:beans 1"}, rarity = 2}, + {items = {"farming:beans 1"}, rarity = 3} + } + }, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1 + }, + sounds = default.node_sound_leaves_defaults() +}) diff --git a/mods/farming/crops/beetroot.lua b/mods/farming/crops/beetroot.lua new file mode 100644 index 0000000..05e0b3a --- /dev/null +++ b/mods/farming/crops/beetroot.lua @@ -0,0 +1,89 @@ + +local S = farming.intllib + +-- beetroot +minetest.register_craftitem("farming:beetroot", { + description = S("Beetroot"), + inventory_image = "farming_beetroot.png", + groups = {seed = 2, food_beetroot = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:beetroot_1") + end, + on_use = minetest.item_eat(1) +}) + +-- beetroot soup +minetest.register_craftitem("farming:beetroot_soup", { + description = S("Beetroot Soup"), + inventory_image = "farming_beetroot_soup.png", + groups = {flammable = 2}, + on_use = minetest.item_eat(6, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:beetroot_soup", + recipe = { + {"group:food_beetroot", "group:food_beetroot", "group:food_beetroot"}, + {"group:food_beetroot", "group:food_bowl", "group:food_beetroot"} + } +}) + +-- red dye +minetest.register_craft({ + output = "dye:red", + recipe = {{"group:food_beetroot"}} +}) + +local def = { + drawtype = "plantlike", + tiles = {"farming_beetroot_1.png"}, + paramtype = "light", + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:beetroot_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_beetroot_2.png"} +minetest.register_node("farming:beetroot_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_beetroot_3.png"} +minetest.register_node("farming:beetroot_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_beetroot_4.png"} +minetest.register_node("farming:beetroot_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_beetroot_5.png"} +def.groups.growing = nil +def.drop = { + max_items = 4, items = { + {items = {"farming:beetroot"}, rarity = 1}, + {items = {"farming:beetroot"}, rarity = 2}, + {items = {"farming:beetroot"}, rarity = 3}, + {items = {"farming:beetroot"}, rarity = 4} + } +} +minetest.register_node("farming:beetroot_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:beetroot"] = { + crop = "farming:beetroot", + seed = "farming:beetroot", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} diff --git a/mods/farming/crops/blackberry.lua b/mods/farming/crops/blackberry.lua new file mode 100644 index 0000000..e2122fd --- /dev/null +++ b/mods/farming/crops/blackberry.lua @@ -0,0 +1,62 @@ + +local S = farming.intllib + +-- blackberries +minetest.register_craftitem("farming:blackberry", { + description = S("Blackberries"), + inventory_image = "farming_blackberry.png", + groups = {seed = 2, food_blackberries = 1, food_blackberry = 1, + food_berry = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:blackberry_1") + end, + on_use = minetest.item_eat(1), +}) + +local def = { + drawtype = "plantlike", + tiles = {"farming_blackberry_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:blackberry_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_blackberry_2.png"} +minetest.register_node("farming:blackberry_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_blackberry_3.png"} +minetest.register_node("farming:blackberry_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_blackberry_4.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {'farming:blackberry 2'}, rarity = 1}, + {items = {'farming:blackberry'}, rarity = 2}, + {items = {'farming:blackberry'}, rarity = 3}, + } +} +minetest.register_node("farming:blackberry_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:blackberry"] = { + crop = "farming:blackberry", + seed = "farming:blackberry", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 4 +} diff --git a/mods/farming/crops/blueberry.lua b/mods/farming/crops/blueberry.lua new file mode 100644 index 0000000..be1d3b2 --- /dev/null +++ b/mods/farming/crops/blueberry.lua @@ -0,0 +1,99 @@ + +local S = farming.intllib + +-- blueberries +minetest.register_craftitem("farming:blueberries", { + description = S("Wild Blueberries"), + inventory_image = "farming_blueberries.png", + groups = {seed = 2, food_blueberries = 1, food_blueberry = 1, + food_berry = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1") + end, + on_use = minetest.item_eat(1) +}) + +-- blueberry muffin (thanks to sosogirl123 @ deviantart.com for muffin image) +minetest.register_craftitem("farming:muffin_blueberry", { + description = S("Blueberry Muffin"), + inventory_image = "farming_blueberry_muffin.png", + on_use = minetest.item_eat(2) +}) + +minetest.register_craft({ + output = "farming:muffin_blueberry 2", + recipe = { + {"group:food_blueberries", "group:food_bread", "group:food_blueberries"} + } +}) + +-- Blueberry Pie +minetest.register_craftitem("farming:blueberry_pie", { + description = S("Blueberry Pie"), + inventory_image = "farming_blueberry_pie.png", + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + output = "farming:blueberry_pie", + recipe = { + {"group:food_flour", "group:food_sugar", "group:food_blueberries"}, + {"group:food_baking_tray", "", ""} + }, + replacements = {{"group:food_baking_tray", "farming:baking_tray"}} +}) + +-- Blue Dye +minetest.register_craft({ + output = "dye:blue", + recipe = {{"farming:blueberries"}} +}) + +-- blueberry definition +local def = { + drawtype = "plantlike", + tiles = {"farming_blueberry_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:blueberry_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_blueberry_2.png"} +minetest.register_node("farming:blueberry_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_blueberry_3.png"} +minetest.register_node("farming:blueberry_3", table.copy(def)) + +-- stage 4 (final) +def.tiles = {"farming_blueberry_4.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:blueberries 2"}, rarity = 1}, + {items = {"farming:blueberries"}, rarity = 2}, + {items = {"farming:blueberries"}, rarity = 3} + } +} +minetest.register_node("farming:blueberry_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:blueberries"] = { + crop = "farming:blueberry", + seed = "farming:blueberries", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 4 +} diff --git a/mods/farming/crops/cabbage.lua b/mods/farming/crops/cabbage.lua new file mode 100644 index 0000000..b57ac00 --- /dev/null +++ b/mods/farming/crops/cabbage.lua @@ -0,0 +1,69 @@ + +local S = farming.intllib + +-- cabbage +minetest.register_craftitem("farming:cabbage", { + description = S("Cabbage"), + inventory_image = "farming_cabbage.png", + groups = {seed = 2, food_cabbage = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:cabbage_1") + end, + on_use = minetest.item_eat(1) +}) + +local def = { + drawtype = "plantlike", + tiles = {"farming_cabbage_1.png"}, + paramtype = "light", + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:cabbage_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_cabbage_2.png"} +minetest.register_node("farming:cabbage_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_cabbage_3.png"} +minetest.register_node("farming:cabbage_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_cabbage_4.png"} +minetest.register_node("farming:cabbage_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_cabbage_5.png"} +minetest.register_node("farming:cabbage_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_cabbage_6.png"} +def.groups.growing = nil +def.drop = { + max_items = 2, items = { + {items = {"farming:cabbage 2"}, rarity = 1}, + {items = {"farming:cabbage 1"}, rarity = 2} + } +} +minetest.register_node("farming:cabbage_6", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:cabbage"] = { + crop = "farming:cabbage", + seed = "farming:cabbage", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 6 +} diff --git a/mods/farming/crops/carrot.lua b/mods/farming/crops/carrot.lua new file mode 100644 index 0000000..2dd45f3 --- /dev/null +++ b/mods/farming/crops/carrot.lua @@ -0,0 +1,125 @@ + +--[[ + Original textures from PixelBox texture pack + https://forum.minetest.net/viewtopic.php?id=4990 +]] + +local S = farming.intllib + +-- carrot +minetest.register_craftitem("farming:carrot", { + description = S("Carrot"), + inventory_image = "farming_carrot.png", + groups = {seed = 2, food_carrot = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1") + end, + on_use = minetest.item_eat(4) +}) + +-- carrot juice +minetest.register_craftitem("farming:carrot_juice", { + description = S("Carrot Juice"), + inventory_image = "farming_carrot_juice.png", + on_use = minetest.item_eat(4, "vessels:drinking_glass"), + groups = {vessel = 1, drink = 1} +}) + +minetest.register_craft({ + output = "farming:carrot_juice", + recipe = { + {"group:food_carrot"}, + {"farming:juicer"}, + {"vessels:drinking_glass"} + }, + replacements = { + {"group:food_juicer", "farming:juicer"} + } +}) + +-- golden carrot +minetest.register_craftitem("farming:carrot_gold", { + description = S("Golden Carrot"), + inventory_image = "farming_carrot_gold.png", + on_use = minetest.item_eat(10) +}) + +minetest.register_craft({ + output = "farming:carrot_gold", + recipe = { + {"", "default:gold_lump", ""}, + {"default:gold_lump", "group:food_carrot", "default:gold_lump"}, + {"", "default:gold_lump", ""} + } +}) + +-- carrot definition +local def = { + drawtype = "plantlike", + tiles = {"farming_carrot_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + + +-- stage 1 +minetest.register_node("farming:carrot_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_carrot_2.png"} +minetest.register_node("farming:carrot_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_carrot_3.png"} +minetest.register_node("farming:carrot_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_carrot_4.png"} +minetest.register_node("farming:carrot_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_carrot_5.png"} +minetest.register_node("farming:carrot_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_carrot_6.png"} +minetest.register_node("farming:carrot_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_carrot_7.png"} +def.drop = { + items = { + {items = {"farming:carrot"}, rarity = 1}, + {items = {"farming:carrot 2"}, rarity = 3} + } +} +minetest.register_node("farming:carrot_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_carrot_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:carrot 2"}, rarity = 1}, + {items = {"farming:carrot 3"}, rarity = 2} + } +} +minetest.register_node("farming:carrot_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:carrot"] = { + crop = "farming:carrot", + seed = "farming:carrot", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/chili.lua b/mods/farming/crops/chili.lua new file mode 100644 index 0000000..95f3a30 --- /dev/null +++ b/mods/farming/crops/chili.lua @@ -0,0 +1,98 @@ + +local S = farming.intllib + +-- chili pepper +minetest.register_craftitem("farming:chili_pepper", { + description = S("Chili Pepper"), + inventory_image = "farming_chili_pepper.png", + groups = {seed = 2, food_chili_pepper = 1, flammable = 4}, + 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, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:chili_bowl", + recipe = { + {"group:food_chili_pepper", "group:food_rice", "group:food_tomato"}, + {"group:food_beans", "group:food_bowl", ""} + } +}) + +-- chili can be used for red dye +minetest.register_craft({ + output = "dye:red", + recipe = {{"farming:chili_pepper"}} +}) + +-- chili definition +local 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(def)) + +-- stage 2 +def.tiles = {"farming_chili_2.png"} +minetest.register_node("farming:chili_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_chili_3.png"} +minetest.register_node("farming:chili_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_chili_4.png"} +minetest.register_node("farming:chili_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_chili_5.png"} +minetest.register_node("farming:chili_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_chili_6.png"} +minetest.register_node("farming:chili_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_chili_7.png"} +minetest.register_node("farming:chili_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_chili_8.png"} +def.groups.growing = nil +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(def)) + +-- add to registered_plants +farming.registered_plants["farming:chili_pepper"] = { + crop = "farming:chili", + seed = "farming:chili_pepper", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/cocoa.lua b/mods/farming/crops/cocoa.lua new file mode 100644 index 0000000..c5c0df7 --- /dev/null +++ b/mods/farming/crops/cocoa.lua @@ -0,0 +1,246 @@ + +local S = farming.intllib + +-- place cocoa +local function place_cocoa(itemstack, placer, pointed_thing, plantname) + + local pt = pointed_thing + + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end + + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if placer and itemstack and def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack, pt) + end + + -- check if pointing at jungletree + if under.name ~= "default:jungletree" + or minetest.get_node(pt.above).name ~= "air" then + return + end + + -- is player planting crop? + local name = placer and placer:get_player_name() or "" + + -- check for protection + if minetest.is_protected(pt.above, name) then + return + end + + -- add the node and remove 1 item from the itemstack + minetest.set_node(pt.above, {name = plantname}) + + minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) + + if placer and not farming.is_creative(placer:get_player_name()) then + + itemstack:take_item() + + -- check for refill + if itemstack:get_count() == 0 then + + minetest.after(0.20, + farming.refill_plant, + placer, + "farming:cocoa_beans_raw", + placer:get_wield_index() + ) + end + end + + return itemstack +end + +-- cocoa beans +minetest.register_craftitem("farming:cocoa_beans_raw", { + description = S("Raw Cocoa Beans"), + inventory_image = "farming_cocoa_beans.png^[brighten", + groups = {seed = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1") + end +}) + +minetest.register_craftitem("farming:cocoa_beans", { + description = S("Cocoa Beans"), + inventory_image = "farming_cocoa_beans.png", + groups = {food_cocoa = 1, flammable = 2} +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 5, + output = "farming:cocoa_beans", + recipe = "farming:cocoa_beans_raw" +}) + +minetest.register_craft( { + output = "dye:brown 2", + recipe = {{"farming:cocoa_beans"}} +}) + +-- chocolate cookie +minetest.register_craftitem("farming:cookie", { + description = S("Cookie"), + inventory_image = "farming_cookie.png", + on_use = minetest.item_eat(2) +}) + +minetest.register_craft( { + output = "farming:cookie 8", + recipe = { + {"group:food_wheat", "group:food_cocoa", "group:food_wheat" } + } +}) + +-- bar of dark chocolate (thanks to Ice Pandora for her deviantart.com chocolate tutorial) +minetest.register_craftitem("farming:chocolate_dark", { + description = S("Bar of Dark Chocolate"), + inventory_image = "farming_chocolate_dark.png", + on_use = minetest.item_eat(3) +}) + +minetest.register_craft( { + output = "farming:chocolate_dark", + recipe = { + {"group:food_cocoa", "group:food_cocoa", "group:food_cocoa"} + } +}) + +-- chocolate block +minetest.register_node("farming:chocolate_block", { + description = S("Chocolate Block"), + tiles = {"farming_chocolate_block.png"}, + is_ground_content = false, + groups = {cracky = 2, oddly_breakable_by_hand = 2}, + sounds = default.node_sound_stone_defaults() +}) + +minetest.register_craft({ + output = "farming:chocolate_block", + recipe = { + {"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"}, + {"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"}, + {"farming:chocolate_dark", "farming:chocolate_dark", "farming:chocolate_dark"} + } +}) + +minetest.register_craft({ + output = "farming:chocolate_dark 9", + recipe = {{"farming:chocolate_block"}} +}) + +-- cocoa definition +local def = { + drawtype = "plantlike", + tiles = {"farming_cocoa_1.png"}, + paramtype = "light", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + drop = {}, + groups = { + snappy = 3, flammable = 2, plant = 1, growing = 1, + not_in_creative_inventory = 1, leafdecay = 1, leafdecay_drop = 1 + }, + sounds = default.node_sound_leaves_defaults(), + growth_check = function(pos, node_name) + + if minetest.find_node_near(pos, 1, {"default:jungletree"}) then + return false -- can grow + end + + return true -- cannot grow + end +} + +-- stage 1 +minetest.register_node("farming:cocoa_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_cocoa_2.png"} +minetest.register_node("farming:cocoa_2", table.copy(def)) + +-- stage3 +def.tiles = {"farming_cocoa_3.png"} +def.drop = { + items = { + {items = {"farming:cocoa_beans_raw 1"}, rarity = 1} + } +} +minetest.register_node("farming:cocoa_3", table.copy(def)) + +-- stage 4 (final) +def.tiles = {"farming_cocoa_4.png"} +def.groups.growing = nil +def.growth_check = nil +def.drop = { + items = { + {items = {"farming:cocoa_beans_raw 2"}, rarity = 1}, + {items = {"farming:cocoa_beans_raw 1"}, rarity = 2}, + {items = {"farming:cocoa_beans_raw 1"}, rarity = 4} + } +} +minetest.register_node("farming:cocoa_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:cocoa_beans"] = { + crop = "farming:cocoa", + seed = "farming:cocoa_beans_raw", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 4 +} + +-- add random cocoa pods to jungle tree's +minetest.register_on_generated(function(minp, maxp) + + if maxp.y < 0 then + return + end + + local pos, dir + local cocoa = minetest.find_nodes_in_area(minp, maxp, "default:jungletree") + + for n = 1, #cocoa do + + pos = cocoa[n] + + if minetest.find_node_near(pos, 1, + {"default:jungleleaves", "moretrees:jungletree_leaves_green"}) then + + dir = math.random(1, 40) + + if dir == 1 then pos.x = pos.x + 1 + elseif dir == 2 then pos.x = pos.x - 1 + elseif dir == 3 then pos.z = pos.z + 1 + elseif dir == 4 then pos.z = pos.z -1 + end + + if dir < 5 + and minetest.get_node(pos).name == "air" + and minetest.get_node_light(pos) > 12 then + +--print ("Cocoa Pod added at " .. minetest.pos_to_string(pos)) + + minetest.swap_node(pos, { + name = "farming:cocoa_" .. tostring(math.random(4)) + }) + end + end + end +end) diff --git a/mods/farming/crops/coffee.lua b/mods/farming/crops/coffee.lua new file mode 100644 index 0000000..490547e --- /dev/null +++ b/mods/farming/crops/coffee.lua @@ -0,0 +1,97 @@ + +local S = farming.intllib + +-- coffee +minetest.register_craftitem("farming:coffee_beans", { + description = S("Coffee Beans"), + inventory_image = "farming_coffee_beans.png", + groups = {seed = 2, food_coffee = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1") + end +}) + +-- cup of coffee +minetest.register_node("farming:coffee_cup", { + description = S("Cup of Coffee"), + drawtype = "torchlike", + tiles = {"farming_coffee_cup.png"}, + inventory_image = "farming_coffee_cup.png", + wield_image = "farming_coffee_cup.png", + paramtype = "light", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25} + }, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1, drink = 1}, + on_use = minetest.item_eat(2, "vessels:drinking_glass"), + sounds = default.node_sound_glass_defaults() +}) + +minetest.register_alias("farming:coffee_cup_hot", "farming:coffee_cup") +minetest.register_alias("farming:drinking_cup", "vessels:drinking_glass") + +minetest.register_craft( { + output = "farming:coffee_cup", + recipe = { + {"group:food_saucepan", "group:food_coffee", "group:food_water_glass"} + }, + replacements = { + {"group:food_saucepan", "farming:saucepan"} + } +}) + + +-- coffee definition +local def = { + drawtype = "plantlike", + tiles = {"farming_coffee_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:coffee_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_coffee_2.png"} +minetest.register_node("farming:coffee_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_coffee_3.png"} +minetest.register_node("farming:coffee_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_coffee_4.png"} +minetest.register_node("farming:coffee_4", table.copy(def)) + +-- stage 5 (final) +def.tiles = {"farming_coffee_5.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:coffee_beans 2"}, rarity = 1}, + {items = {"farming:coffee_beans 2"}, rarity = 2}, + {items = {"farming:coffee_beans 2"}, rarity = 3} + } +} +minetest.register_node("farming:coffee_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:coffee"] = { + crop = "farming:coffee", + seed = "farming:coffee_beans", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} diff --git a/mods/farming/crops/corn.lua b/mods/farming/crops/corn.lua new file mode 100644 index 0000000..97bb86a --- /dev/null +++ b/mods/farming/crops/corn.lua @@ -0,0 +1,178 @@ + +--[[ + Original textures from GeMinecraft + http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1440575-1-2-5-generation-minecraft-beta-1-2-farming-and +]] + +local S = farming.intllib + +-- corn +minetest.register_craftitem("farming:corn", { + description = S("Corn"), + inventory_image = "farming_corn.png", + groups = {seed = 2, food_corn = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1") + end, + on_use = minetest.item_eat(3) +}) + +-- corn on the cob (texture by TenPlus1) +minetest.register_craftitem("farming:corn_cob", { + description = S("Corn on the Cob"), + inventory_image = "farming_corn_cob.png", + groups = {food_corn_cooked = 1, flammable = 2}, + on_use = minetest.item_eat(5) +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 10, + output = "farming:corn_cob", + recipe = "group:food_corn" +}) + +-- popcorn +minetest.register_craftitem("farming:popcorn", { + description = S("Popcorn"), + inventory_image = "farming_popcorn.png", + groups = {food_popcorn = 1, flammable = 2}, + on_use = minetest.item_eat(4) +}) + +minetest.register_craft({ + output = "farming:popcorn", + recipe = { + {"group:food_pot", "group:food_oil", "group:food_corn"} + }, + replacements = { + {"group:food_pot", "farming:pot"}, + {"group:food_oil", "vessels:glass_bottle"} + } +}) + +-- cornstarch +minetest.register_craftitem("farming:cornstarch", { + description = S("Cornstarch"), + inventory_image = "farming_cornstarch.png", + groups = {food_cornstarch = 1, food_gelatin = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:cornstarch", + recipe = { + {"group:food_mortar_pestle", "group:food_corn_cooked", "group:food_baking_tray"}, + {"", "group:food_bowl", ""}, + }, + replacements = { + {"group:food_mortar_pestle", "farming:mortar_pestle"}, + {"group:food_baking_tray", "farming:baking_tray"} + } +}) + +-- ethanol (thanks to JKMurray for this idea) +minetest.register_node("farming:bottle_ethanol", { + description = S("Bottle of Ethanol"), + drawtype = "plantlike", + tiles = {"farming_bottle_ethanol.png"}, + inventory_image = "farming_bottle_ethanol.png", + wield_image = "farming_bottle_ethanol.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, + sounds = default.node_sound_glass_defaults() +}) + +minetest.register_craft( { + output = "farming:bottle_ethanol", + recipe = { + {"group:food_corn", "group:food_corn", "group:food_corn"}, + {"group:food_corn", "vessels:glass_bottle", "group:food_corn"}, + {"group:food_corn", "group:food_corn", "group:food_corn"} + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:bottle_ethanol", + burntime = 80, + replacements = {{"farming:bottle_ethanol", "vessels:glass_bottle"}} +}) + +-- corn definition +local def = { + drawtype = "plantlike", + tiles = {"farming_corn_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:corn_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_corn_2.png"} +minetest.register_node("farming:corn_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_corn_3.png"} +minetest.register_node("farming:corn_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_corn_4.png"} +minetest.register_node("farming:corn_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_corn_5.png"} +minetest.register_node("farming:corn_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_corn_6.png"} +def.visual_scale = 1.9 +minetest.register_node("farming:corn_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_corn_7.png"} +def.drop = { + items = { + {items = {"farming:corn"}, rarity = 1}, + {items = {"farming:corn"}, rarity = 2}, + {items = {"farming:corn"}, rarity = 3} + } +} +minetest.register_node("farming:corn_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_corn_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:corn 2"}, rarity = 1}, + {items = {"farming:corn 2"}, rarity = 2}, + {items = {"farming:corn 2"}, rarity = 2} + } +} +minetest.register_node("farming:corn_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:corn"] = { + crop = "farming:corn", + seed = "farming:corn", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/cotton.lua b/mods/farming/crops/cotton.lua new file mode 100644 index 0000000..6ea2e6f --- /dev/null +++ b/mods/farming/crops/cotton.lua @@ -0,0 +1,186 @@ + +local S = farming.intllib + +-- wild cotton as a source of cotton seed and a chance of cotton itself +minetest.register_node("farming:cotton_wild", { + description = S("Wild Cotton"), + drawtype = "plantlike", + waving = 1, + tiles = {"farming_cotton_wild.png"}, + inventory_image = "farming_cotton_wild.png", + wield_image = "farming_cotton_wild.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy = 3, attached_node = 1, flammable = 4}, + drop = { + items = { + {items = {"farming:cotton"}, rarity = 2}, + {items = {"farming:seed_cotton"}, rarity = 1} + } + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-6 / 16, -8 / 16, -6 / 16, 6 / 16, 5 / 16, 6 / 16} + } +}) + +-- cotton seeds +minetest.register_node("farming:seed_cotton", { + description = S("Cotton Seed"), + tiles = {"farming_cotton_seed.png"}, + inventory_image = "farming_cotton_seed.png", + wield_image = "farming_cotton_seed.png", + drawtype = "signlike", + groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4}, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = farming.select, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:cotton_1") + end +}) + +-- cotton +minetest.register_craftitem("farming:cotton", { + description = S("Cotton"), + inventory_image = "farming_cotton.png", + groups = {flammable = 4} +}) + +-- string +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: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 def = { + drawtype = "plantlike", + tiles = {"farming_cotton_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:cotton_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_cotton_2.png"} +minetest.register_node("farming:cotton_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_cotton_3.png"} +minetest.register_node("farming:cotton_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_cotton_4.png"} +minetest.register_node("farming:cotton_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_cotton_5.png"} +def.drop = { + items = { + {items = {"farming:seed_cotton"}, rarity = 1} + } +} +minetest.register_node("farming:cotton_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_cotton_6.png"} +def.drop = { + items = { + {items = {"farming:cotton"}, rarity = 1}, + {items = {"farming:cotton"}, rarity = 2} + } +} +minetest.register_node("farming:cotton_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_cotton_7.png"} +def.drop = { + items = { + {items = {"farming:cotton"}, rarity = 1}, + {items = {"farming:cotton"}, rarity = 2}, + {items = {"farming:seed_cotton"}, rarity = 1}, + {items = {"farming:seed_cotton"}, rarity = 2} + } +} +minetest.register_node("farming:cotton_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_cotton_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {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} + } +} +minetest.register_node("farming:cotton_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:cotton"] = { + crop = "farming:cotton", + seed = "farming:seed_cotton", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} + +--[[ Cotton using api +farming.register_plant("farming:cotton", { + description = "Cotton seed", + inventory_image = "farming_cotton_seed.png", + groups = {flammable = 2}, + steps = 8, +})]] diff --git a/mods/farming/crops/cucumber.lua b/mods/farming/crops/cucumber.lua new file mode 100644 index 0000000..c5e70de --- /dev/null +++ b/mods/farming/crops/cucumber.lua @@ -0,0 +1,65 @@ + +--[[ + Original textures from DocFarming mod + https://forum.minetest.net/viewtopic.php?id=3948 +]] + +local S = farming.intllib + +-- cucumber +minetest.register_craftitem("farming:cucumber", { + description = S("Cucumber"), + inventory_image = "farming_cucumber.png", + groups = {seed = 2, food_cucumber = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1") + end, + on_use = minetest.item_eat(4) +}) + +-- cucumber definition +local def = { + drawtype = "plantlike", + tiles = {"farming_cucumber_1.png"}, + paramtype = "light", + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:cucumber_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_cucumber_2.png"} +minetest.register_node("farming:cucumber_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_cucumber_3.png"} +minetest.register_node("farming:cucumber_3", table.copy(def)) + +-- stage 4 (final) +def.tiles = {"farming_cucumber_4.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:cucumber 2"}, rarity = 1}, + {items = {"farming:cucumber 2"}, rarity = 2} + } +} +minetest.register_node("farming:cucumber_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:cucumber"] = { + crop = "farming:cucumber", + seed = "farming:cucumber", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 4 +} diff --git a/mods/farming/crops/garlic.lua b/mods/farming/crops/garlic.lua new file mode 100644 index 0000000..e141479 --- /dev/null +++ b/mods/farming/crops/garlic.lua @@ -0,0 +1,136 @@ + +--[[ + Original textures from Crops Plus mod + Copyright (C) 2018 Grizzly Adam + https://forum.minetest.net/viewtopic.php?f=9&t=19488 +]] + +local S = farming.intllib + +-- potato +minetest.register_craftitem("farming:garlic_clove", { + description = S("Garlic clove"), + inventory_image = "crops_garlic_clove.png", + groups = {seed = 2, food_garlic_clove = 1, flammable = 3}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:garlic_1") + end +}) + +-- garlic bulb +minetest.register_craftitem("farming:garlic", { + description = S("Garlic"), + inventory_image = "crops_garlic.png", + on_use = minetest.item_eat(1), + groups = {food_garlic = 1, flammable = 3} +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:garlic_clove 8", + recipe = {"farming:garlic"} +}) + +minetest.register_craft({ + output = "farming:garlic", + recipe = { + {"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"}, + {"farming:garlic_clove", "", "farming:garlic_clove"}, + {"farming:garlic_clove", "farming:garlic_clove", "farming:garlic_clove"} + } +}) + +-- garlic braid +minetest.register_node("farming:garlic_braid", { + description = S("Garlic Braid"), + inventory_image = "crops_garlic_braid.png", + wield_image = "crops_garlic_braid.png", + drawtype = "nodebox", + use_texture_alpha = "clip", + paramtype = "light", + paramtype2 = "facedir", + tiles = { + "crops_garlic_braid_side.png","crops_garlic_braid.png", + "crops_garlic_braid_side.png^[transformFx","crops_garlic_braid_side.png", + "crops_garlic_braid.png","crops_garlic_braid.png" + }, + groups = {vessel = 1, dig_immediate = 3, flammable = 3}, + sounds = default.node_sound_leaves_defaults(), + node_box = { + type = "fixed", + fixed = { + {-0.13, -0.45, 0.5, 0.13, 0.45, 0.24} + } + } +}) + +minetest.register_craft({ + output = "farming:garlic_braid", + recipe = { + {"farming:garlic", "farming:garlic", "farming:garlic"}, + {"farming:garlic", "farming:garlic", "farming:garlic"}, + {"farming:garlic", "farming:garlic", "farming:garlic"} + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:garlic 9", + recipe = {"farming:garlic_braid"} +}) + +-- crop definition +local def = { + drawtype = "plantlike", + tiles = {"crops_garlic_plant_1.png"}, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 3, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:garlic_1", table.copy(def)) + +-- stage 2 +def.tiles = {"crops_garlic_plant_2.png"} +minetest.register_node("farming:garlic_2", table.copy(def)) + +-- stage 3 +def.tiles = {"crops_garlic_plant_3.png"} +minetest.register_node("farming:garlic_3", table.copy(def)) + +-- stage 4 +def.tiles = {"crops_garlic_plant_4.png"} +minetest.register_node("farming:garlic_4", table.copy(def)) + +-- stage 5 +def.tiles = {"crops_garlic_plant_5.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:garlic 3"}, rarity = 1}, + {items = {"farming:garlic"}, rarity = 2}, + {items = {"farming:garlic"}, rarity = 5} + } +} +minetest.register_node("farming:garlic_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:garlic"] = { + crop = "farming:garlic", + seed = "farming:garlic_clove", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} diff --git a/mods/farming/crops/grapes.lua b/mods/farming/crops/grapes.lua new file mode 100644 index 0000000..47d64e0 --- /dev/null +++ b/mods/farming/crops/grapes.lua @@ -0,0 +1,261 @@ + +local S = farming.intllib + +-- place trellis +local function place_grapes(itemstack, placer, pointed_thing, plantname) + + local pt = pointed_thing + + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end + + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if placer and itemstack and def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack, pt) + end + + -- is player planting seed? + local name = placer and placer:get_player_name() or "" + + -- check for protection + if minetest.is_protected(pt.under, name) then + return + end + + -- check if pointing at trellis + if under.name ~= "farming:trellis" then + return + end + + -- add the node and remove 1 item from the itemstack + minetest.set_node(pt.under, {name = plantname}) + + minetest.sound_play("default_place_node", {pos = pt.under, gain = 1.0}) + + if placer and not farming.is_creative(placer:get_player_name()) then + + itemstack:take_item() + + -- check for refill + if itemstack:get_count() == 0 then + + minetest.after(0.20, + farming.refill_plant, + placer, + "farming:grapes", + placer:get_wield_index() + ) + end + end + + return itemstack +end + +-- grapes +minetest.register_craftitem("farming:grapes", { + description = S("Grapes"), + inventory_image = "farming_grapes.png", + on_use = minetest.item_eat(2), + groups = {seed = 2, food_grapes = 1, flammable = 3}, + on_place = function(itemstack, placer, pointed_thing) + return place_grapes(itemstack, placer, pointed_thing, "farming:grapes_1") + end +}) + +-- grapes can be used for violet dye +minetest.register_craft({ + output = "dye:violet", + recipe = {{"farming:grapes"}} +}) + +-- trellis +minetest.register_node("farming:trellis", { + description = S("Trellis (place on soil before planting grapes)"), + drawtype = "plantlike", + tiles = {"farming_trellis.png"}, + inventory_image = "farming_trellis.png", + visual_scale = 1.9, + paramtype = "light", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = "farming:trellis", + selection_box = farming.select, + groups = {snappy = 3, flammable = 2, attached_node = 1}, + sounds = default.node_sound_leaves_defaults(), + + on_place = function(itemstack, placer, pointed_thing) + + local pt = pointed_thing + + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + + -- return if any of the nodes are not registered + if not minetest.registered_nodes[under.name] then + return + end + + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack, pt) + end + + if minetest.is_protected(pt.above, placer:get_player_name()) then + return + end + + local nodename = under.name + + if minetest.get_item_group(nodename, "soil") < 2 then + return + end + + local top = { + x = pointed_thing.above.x, + y = pointed_thing.above.y + 1, + z = pointed_thing.above.z + } + + nodename = minetest.get_node(top).name + + if nodename ~= "air" then + return + end + + minetest.set_node(pointed_thing.above, {name = "farming:trellis"}) + + if not farming.is_creative(placer:get_player_name()) then + itemstack:take_item() + end + + return itemstack + end +}) + +minetest.register_craft({ + output = "farming:trellis", + recipe = { + {"default:stick", "default:stick", "default:stick"}, + {"default:stick", "default:stick", "default:stick"}, + {"default:stick", "default:stick", "default:stick"} + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:trellis", + burntime = 15 +}) + +-- grapes definition +local def = { + drawtype = "plantlike", + tiles = {"farming_grapes_1.png"}, + visual_scale = 1.9, + paramtype = "light", + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {"farming:trellis"}, rarity = 1}, + } + }, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 3, not_in_creative_inventory = 1, + attached_node = 1, growing = 1, plant = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:grapes_1", table.copy(def)) + +-- stage2 +def.tiles = {"farming_grapes_2.png"} +minetest.register_node("farming:grapes_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_grapes_3.png"} +minetest.register_node("farming:grapes_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_grapes_4.png"} +minetest.register_node("farming:grapes_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_grapes_5.png"} +minetest.register_node("farming:grapes_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_grapes_6.png"} +minetest.register_node("farming:grapes_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_grapes_7.png"} +minetest.register_node("farming:grapes_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_grapes_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:trellis"}, rarity = 1}, + {items = {"farming:grapes 3"}, rarity = 1}, + {items = {"farming:grapes 1"}, rarity = 2}, + {items = {"farming:grapes 1"}, rarity = 3} + } +} +minetest.register_node("farming:grapes_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:grapes"] = { + crop = "farming:grapes", + seed = "farming:grapes", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} + +-- wild grape vine (this is what you find on the map) +minetest.register_node("farming:grapebush", { + drawtype = "plantlike", + tiles = {"farming_grapebush.png"}, + paramtype = "light", + waving = 1, + walkable = false, + buildable_to = true, + sunlight_propagates = true, + drop = { + items = { + {items = {"farming:grapes 1"}, rarity = 1}, + {items = {"farming:grapes 1"}, rarity = 2}, + {items = {"farming:grapes 1"}, rarity = 3} + } + }, + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1 + }, + sounds = default.node_sound_leaves_defaults() +}) diff --git a/mods/farming/crops/hemp.lua b/mods/farming/crops/hemp.lua new file mode 100644 index 0000000..4cc05e5 --- /dev/null +++ b/mods/farming/crops/hemp.lua @@ -0,0 +1,262 @@ + +local S = farming.intllib + +-- hemp seeds +minetest.register_node("farming:seed_hemp", { + description = S("Hemp Seed"), + tiles = {"farming_hemp_seed.png"}, + inventory_image = "farming_hemp_seed.png", + wield_image = "farming_hemp_seed.png", + drawtype = "signlike", + groups = {seed = 1, snappy = 3, attached_node = 1}, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = farming.select, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:hemp_1") + end +}) + +-- harvested hemp +minetest.register_craftitem("farming:hemp_leaf", { + description = S("Hemp Leaf"), + inventory_image = "farming_hemp_leaf.png" +}) + +-- hemp oil +minetest.register_node("farming:hemp_oil", { + description = S("Bottle of Hemp Oil"), + drawtype = "plantlike", + tiles = {"farming_hemp_oil.png"}, + inventory_image = "farming_hemp_oil.png", + wield_image = "farming_hemp_oil.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, + groups = {food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1}, + sounds = default.node_sound_glass_defaults() +}) + +minetest.register_craft( { + output = "farming:hemp_oil", + recipe = { + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}, + {"", "vessels:glass_bottle", ""} + } +}) + +minetest.register_craft( { + output = "farming:hemp_oil", + recipe = { + {"farming:seed_hemp", "farming:seed_hemp", "farming:seed_hemp"}, + {"farming:seed_hemp", "farming:seed_hemp", "farming:seed_hemp"}, + {"farming:seed_hemp", "vessels:glass_bottle", "farming:seed_hemp"} + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:hemp_oil", + burntime = 20, + replacements = {{"farming:hemp_oil", "vessels:glass_bottle"}} +}) + +-- hemp fibre +minetest.register_craftitem("farming:hemp_fibre", { + description = S("Hemp Fibre"), + inventory_image = "farming_hemp_fibre.png" +}) + +minetest.register_craft( { + output = "farming:hemp_fibre 8", + recipe = { + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "group:water_bucket", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"} + }, + replacements = {{"group:water_bucket", "bucket:bucket_empty"}} +}) + +if minetest.get_modpath("bucket_wooden") then + minetest.register_craft( { + output = "farming:hemp_fibre 8", + recipe = { + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "group:water_bucket_wooden", "farming:hemp_leaf"}, + {"farming:hemp_leaf", "farming:hemp_leaf", "farming:hemp_leaf"} + }, + replacements = {{"group:water_bucket_wooden", "bucket_wooden:bucket_empty"}} + }) +end + +-- hemp block +minetest.register_node("farming:hemp_block", { + description = S("Hemp Block"), + tiles = {"farming_hemp_block.png"}, + paramtype = "light", + groups = {snappy = 1, oddly_breakable_by_hand = 1, flammable = 2} +}) + +minetest.register_craft( { + output = "farming:hemp_block", + recipe = { + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"} + } +}) + +-- check and register stairs +if minetest.global_exists("stairs") then + + if stairs.mod and stairs.mod == "redo" then + + stairs.register_all("hemp_block", "farming:hemp_block", + {snappy = 1, flammable = 2}, + {"farming_hemp_block.png"}, + "Hemp Block", + default.node_sound_leaves_defaults()) + else + + stairs.register_stair_and_slab("hemp_block", "farming:hemp_block", + {snappy = 1, flammable = 2}, + {"farming_hemp_block.png"}, + "Hemp Block Stair", + "Hemp Block Slab", + default.node_sound_leaves_defaults()) + end +end + +-- paper +minetest.register_craft( { + output = "default:paper 3", + recipe = { + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"} + } +}) + +-- string +minetest.register_craft( { + output = "farming:cotton 3", + recipe = { + {"farming:hemp_fibre"}, + {"farming:hemp_fibre"}, + {"farming:hemp_fibre"} + } +}) + +-- hemp rope +minetest.register_node("farming:hemp_rope", { + description = S("Hemp Rope"), + walkable = false, + climbable = true, + sunlight_propagates = true, + paramtype = "light", + tiles = {"farming_hemp_rope.png"}, + wield_image = "farming_hemp_rope.png", + inventory_image = "farming_hemp_rope.png", + drawtype = "plantlike", + groups = {flammable = 2, choppy = 3, oddly_breakable_by_hand = 3}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7} + } +}) + +-- string +minetest.register_craft( { + output = "farming:hemp_rope 6", + recipe = { + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"}, + {"farming:cotton", "farming:cotton", "farming:cotton"}, + {"farming:hemp_fibre", "farming:hemp_fibre", "farming:hemp_fibre"} + } +}) + +-- hemp definition +local def = { + drawtype = "plantlike", + tiles = {"farming_hemp_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:hemp_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_hemp_2.png"} +minetest.register_node("farming:hemp_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_hemp_3.png"} +minetest.register_node("farming:hemp_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_hemp_4.png"} +minetest.register_node("farming:hemp_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_hemp_5.png"} +minetest.register_node("farming:hemp_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_hemp_6.png"} +def.drop = { + items = { + {items = {"farming:hemp_leaf"}, rarity = 2}, + {items = {"farming:seed_hemp"}, rarity = 1} + } +} +minetest.register_node("farming:hemp_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_hemp_7.png"} +def.drop = { + items = { + {items = {"farming:hemp_leaf"}, rarity = 1}, + {items = {"farming:hemp_leaf"}, rarity = 3}, + {items = {"farming:seed_hemp"}, rarity = 1}, + {items = {"farming:seed_hemp"}, rarity = 3} + } +} +minetest.register_node("farming:hemp_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_hemp_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:hemp_leaf 2"}, rarity = 1}, + {items = {"farming:hemp_leaf"}, rarity = 2}, + {items = {"farming:seed_hemp"}, rarity = 1}, + {items = {"farming:seed_hemp"}, rarity = 2} + } +} +minetest.register_node("farming:hemp_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:hemp"] = { + crop = "farming:hemp", + seed = "farming:seed_hemp", + mminlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/lettuce.lua b/mods/farming/crops/lettuce.lua new file mode 100644 index 0000000..bbd7138 --- /dev/null +++ b/mods/farming/crops/lettuce.lua @@ -0,0 +1,63 @@ +local S = farming.intllib + +-- lettuce +minetest.register_craftitem("farming:lettuce", { + description = S("Lettuce"), + inventory_image = "farming_lettuce.png", + groups = {seed = 2, food_lettuce = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:lettuce_1") + end, + on_use = minetest.item_eat(2), +}) + +local def = { + drawtype = "plantlike", + tiles = {"farming_lettuce_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:lettuce_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_lettuce_2.png"} +minetest.register_node("farming:lettuce_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_lettuce_3.png"} +minetest.register_node("farming:lettuce_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_lettuce_4.png"} +minetest.register_node("farming:lettuce_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_lettuce_5.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {'farming:lettuce 2'}, rarity = 1}, + {items = {'farming:lettuce 1'}, rarity = 2} + } +} +minetest.register_node("farming:lettuce_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:lettuce"] = { + crop = "farming:lettuce", + seed = "farming:lettuce", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} diff --git a/mods/farming/crops/melon.lua b/mods/farming/crops/melon.lua new file mode 100644 index 0000000..66decdc --- /dev/null +++ b/mods/farming/crops/melon.lua @@ -0,0 +1,98 @@ + +local S = farming.intllib + +-- melon +minetest.register_craftitem("farming:melon_slice", { + description = S("Melon Slice"), + inventory_image = "farming_melon_slice.png", + groups = {seed = 2, food_melon_slice = 1, flammable = 3}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1") + end, + on_use = minetest.item_eat(2) +}) + +minetest.register_craft({ + output = "farming:melon_8", + recipe = { + {"farming:melon_slice", "farming:melon_slice"}, + {"farming:melon_slice", "farming:melon_slice"} + } +}) + +minetest.register_craft({ + output = "farming:melon_slice 4", + recipe = {{"farming:cutting_board", "farming:melon_8"}}, + replacements = {{"farming:cutting_board", "farming:cutting_board"}} +}) + +-- melon definition +local def = { + drawtype = "plantlike", + tiles = {"farming_melon_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:melon_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_melon_2.png"} +minetest.register_node("farming:melon_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_melon_3.png"} +minetest.register_node("farming:melon_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_melon_4.png"} +minetest.register_node("farming:melon_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_melon_5.png"} +minetest.register_node("farming:melon_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_melon_6.png"} +minetest.register_node("farming:melon_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_melon_7.png"} +minetest.register_node("farming:melon_7", table.copy(def)) + +-- stage 8 (final) +minetest.register_node("farming:melon_8", { + description = S("Melon"), + tiles = { + "farming_melon_top.png", + "farming_melon_bottom.png", + "farming_melon_side.png" + }, + groups = { + food_melon = 1, snappy = 2, oddly_breakable_by_hand = 1, + flammable = 2, plant = 1 + }, + drop = "farming:melon_8", + sounds = default.node_sound_wood_defaults(), + paramtype2 = "facedir", + on_place = minetest.rotate_node +}) + +-- add to registered_plants +farming.registered_plants["farming:melon"] = { + crop = "farming:melon", + seed = "farming:melon_slice", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/mint.lua b/mods/farming/crops/mint.lua new file mode 100644 index 0000000..de4b6b3 --- /dev/null +++ b/mods/farming/crops/mint.lua @@ -0,0 +1,89 @@ + +local S = farming.intllib + +-- mint seed +minetest.register_craftitem("farming:seed_mint", { + description = S("Mint Seeds"), + inventory_image = "farming_mint_seeds.png", + groups = {seed = 2, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed( + itemstack, placer, pointed_thing, "farming:mint_1") + end +}) + +-- mint leaf +minetest.register_craftitem("farming:mint_leaf", { + description = S("Mint Leaf"), + inventory_image = "farming_mint_leaf.png", + groups = {food_mint = 1, flammable = 4} +}) + +-- mint tea +minetest.register_craftitem("farming:mint_tea", { + description = S("Mint Tea"), + inventory_image = "farming_mint_tea.png", + on_use = minetest.item_eat(2, "vessels:drinking_glass"), + groups = {flammable = 4} +}) + +minetest.register_craft({ + output = "farming:mint_tea", + recipe = { + {"group:food_mint", "group:food_mint", "group:food_mint"}, + {"group:food_water_glass", "farming:juicer", ""} + }, + replacements = { + {"group:food_juicer", "farming:juicer"} + } +}) + + +-- mint definition +local def = { + drawtype = "plantlike", + tiles = {"farming_mint_1.png"}, + paramtype = "light", + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:mint_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_mint_2.png"} +minetest.register_node("farming:mint_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_mint_3.png"} +minetest.register_node("farming:mint_3", table.copy(def)) + +-- stage 4 (final) +def.tiles = {"farming_mint_4.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:mint_leaf 2"}, rarity = 1}, + {items = {"farming:mint_leaf 2"}, rarity = 2}, + {items = {"farming:seed_mint 1"}, rarity = 1}, + {items = {"farming:seed_mint 2"}, rarity = 2} + } +} +minetest.register_node("farming:mint_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:mint"] = { + crop = "farming:mint", + seed = "farming:seed_mint", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 4 +} diff --git a/mods/farming/crops/onion.lua b/mods/farming/crops/onion.lua new file mode 100644 index 0000000..63cdbe5 --- /dev/null +++ b/mods/farming/crops/onion.lua @@ -0,0 +1,95 @@ + +--[[ + Original textures from Crops Plus mod + Copyright (C) 2018 Grizzly Adam + https://forum.minetest.net/viewtopic.php?f=9&t=19488 +]] + +local S = farming.intllib + +-- onion +minetest.register_craftitem("farming:onion", { + description = S("Onion"), + inventory_image = "crops_onion.png", + groups = {seed = 2, food_onion = 1, flammable = 3}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1") + end, + on_use = minetest.item_eat(1) +}) + +-- onion soup +minetest.register_craftitem("farming:onion_soup", { + description = S("Onion Soup"), + inventory_image = "farming_onion_soup.png", + groups = {flammable = 2}, + on_use = minetest.item_eat(6, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:onion_soup", + recipe = { + {"group:food_onion", "group:food_onion", "group:food_onion"}, + {"group:food_onion", "group:food_pot", "group:food_onion"}, + {"", "group:food_bowl", ""} + }, + replacements = {{"farming:pot", "farming:pot"}} +}) + +-- crop definition +local def = { + drawtype = "plantlike", + tiles = {"crops_onion_plant_1.png"}, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 3, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:onion_1", table.copy(def)) + +-- stage 2 +def.tiles = {"crops_onion_plant_2.png"} +minetest.register_node("farming:onion_2", table.copy(def)) + +-- stage 3 +def.tiles = {"crops_onion_plant_3.png"} +minetest.register_node("farming:onion_3", table.copy(def)) + +-- stage 4 +def.tiles = {"crops_onion_plant_4.png"} +minetest.register_node("farming:onion_4", table.copy(def)) + +-- stage 5 +def.tiles = {"crops_onion_plant_5.png"} +def.groups.growing = nil +def.drop = { + max_items = 5, items = { + {items = {"farming:onion"}, rarity = 1}, + {items = {"farming:onion"}, rarity = 1}, + {items = {"farming:onion"}, rarity = 2}, + {items = {"farming:onion"}, rarity = 2}, + {items = {"farming:onion"}, rarity = 5} + } +} +minetest.register_node("farming:onion_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:onion"] = { + crop = "farming:onion", + seed = "farming:onion", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} diff --git a/mods/farming/crops/parsley.lua b/mods/farming/crops/parsley.lua new file mode 100644 index 0000000..0bc20eb --- /dev/null +++ b/mods/farming/crops/parsley.lua @@ -0,0 +1,56 @@ +local S = farming.intllib + +-- item definition +minetest.register_craftitem("farming:parsley", { + description = S("Parsley"), + inventory_image = "farming_parsley.png", + groups = {seed = 2, food_parsley = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:parsley_1") + end +}) + +-- crop definition +local def = { + drawtype = "plantlike", + tiles = {"farming_parsley_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:parsley_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_parsley_2.png"} +minetest.register_node("farming:parsley_2", table.copy(def)) + +-- stage 3 (final) +def.tiles = {"farming_parsley_3.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:parsley 2"}, rarity = 1}, + {items = {"farming:parsley"}, rarity = 2}, + {items = {"farming:parsley"}, rarity = 3} + } +} +minetest.register_node("farming:parsley_3", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:parsley"] = { + crop = "farming:parsley", + seed = "farming:parsley", + minlight = 13, + maxlight = 15, + steps = 3 +} diff --git a/mods/farming/crops/peas.lua b/mods/farming/crops/peas.lua new file mode 100644 index 0000000..94053f2 --- /dev/null +++ b/mods/farming/crops/peas.lua @@ -0,0 +1,91 @@ + +local S = farming.intllib + +-- Textures for Pea crop and Peas were done by Andrey01 + +-- pea pod +minetest.register_craftitem("farming:pea_pod", { + description = S("Pea Pod"), + inventory_image = "farming_pea_pod.png", + groups = {seed = 2, food_peas = 1, food_pea_pod = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:pea_1") + end, + on_use = minetest.item_eat(1) +}) + +-- replacement for separate peas item that was removed +minetest.register_alias("farming:peas", "farming:pea_pod") + +-- pea soup +minetest.register_craftitem("farming:pea_soup", { + description = S("Pea Soup"), + inventory_image = "farming_pea_soup.png", + groups = {flammable = 2}, + on_use = minetest.item_eat(4, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:pea_soup", + recipe = { + {"group:food_peas"}, + {"group:food_peas"}, + {"group:food_bowl"} + } +}) + +local def = { + drawtype = "plantlike", + tiles = {"farming_pea_1.png"}, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:pea_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_pea_2.png"} +minetest.register_node("farming:pea_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_pea_3.png"} +minetest.register_node("farming:pea_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_pea_4.png"} +minetest.register_node("farming:pea_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_pea_5.png"} +def.groups.growing = nil +def.drop = { + max_items = 5, items = { + {items = {"farming:pea_pod"}, rarity = 1}, + {items = {"farming:pea_pod"}, rarity = 2}, + {items = {"farming:pea_pod"}, rarity = 3}, + {items = {"farming:pea_pod"}, rarity = 5} + } +} +minetest.register_node("farming:pea_5", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:pea_pod"] = { + crop = "farming:pea", + seed = "farming:pea_pod", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} diff --git a/mods/farming/crops/pepper.lua b/mods/farming/crops/pepper.lua new file mode 100644 index 0000000..bdf6287 --- /dev/null +++ b/mods/farming/crops/pepper.lua @@ -0,0 +1,155 @@ + +--[[ + Original textures from Crops Plus mod + Copyright (C) 2018 Grizzly Adam + https://forum.minetest.net/viewtopic.php?f=9&t=19488 +]] + +local S = farming.intllib + +-- peppercorn (seed) +minetest.register_craftitem("farming:peppercorn", { + description = S("Peppercorn"), + inventory_image = "crops_peppercorn.png", + groups = {seed = 1, food_peppercorn = 1, flammable = 3}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1") + end +}) + +-- green pepper +minetest.register_craftitem("farming:pepper", { + description = S("Green Pepper"), + inventory_image = "crops_pepper.png", + on_use = minetest.item_eat(2), + groups = {food_pepper = 1, flammable = 3} +}) + +-- yellow pepper +minetest.register_craftitem("farming:pepper_yellow", { + description = S("Yellow Pepper"), + inventory_image = "crops_pepper_yellow.png", + on_use = minetest.item_eat(3), + groups = {food_pepper = 1, flammable = 3} +}) + +-- red pepper +minetest.register_craftitem("farming:pepper_red", { + description = S("Red Pepper"), + inventory_image = "crops_pepper_red.png", + on_use = minetest.item_eat(4), + groups = {food_pepper = 1, flammable = 3} +}) + +minetest.register_craft({ + output = "farming:peppercorn", + recipe = {{"group:food_pepper"}} +}) + +-- ground pepper +minetest.register_node("farming:pepper_ground", { + description = S("Ground Pepper"), + inventory_image = "crops_pepper_ground.png", + wield_image = "crops_pepper_ground.png", + drawtype = "plantlike", + visual_scale = 0.8, + paramtype = "light", + tiles = {"crops_pepper_ground.png"}, + groups = { + vessel = 1, food_pepper_ground = 1, + dig_immediate = 3, attached_node = 1 + }, + sounds = default.node_sound_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + } +}) + +minetest.register_craft( { + output = "farming:pepper_ground", + recipe = { + {"group:food_peppercorn"}, + {"farming:mortar_pestle"}, + {"vessels:glass_bottle"} + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}} +}) + +-- crop definition +local def = { + drawtype = "plantlike", + tiles = {"crops_pepper_plant_1.png"}, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 1, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 3, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:pepper_1", table.copy(def)) + +-- stage 2 +def.tiles = {"crops_pepper_plant_2.png"} +minetest.register_node("farming:pepper_2", table.copy(def)) + +-- stage 3 +def.tiles = {"crops_pepper_plant_3.png"} +minetest.register_node("farming:pepper_3", table.copy(def)) + +-- stage 4 +def.tiles = {"crops_pepper_plant_4.png"} +minetest.register_node("farming:pepper_4", table.copy(def)) + +-- stage 5 (green pepper) +def.tiles = {"crops_pepper_plant_5.png"} +def.drop = { + max_items = 2, items = { + {items = {"farming:pepper 2"}, rarity = 1}, + {items = {"farming:pepper"}, rarity = 2}, + {items = {"farming:pepper"}, rarity = 3} + } +} +minetest.register_node("farming:pepper_5", table.copy(def)) + +-- stage 6 (yellow pepper) +def.tiles = {"crops_pepper_plant_6.png"} +def.drop = { + max_items = 2, items = { + {items = {"farming:pepper_yellow 2"}, rarity = 1}, + {items = {"farming:pepper_yellow"}, rarity = 2}, + {items = {"farming:pepper_yellow"}, rarity = 3} + } +} +minetest.register_node("farming:pepper_6", table.copy(def)) + +-- stage 7 (red pepper) +def.tiles = {"crops_pepper_plant_7.png"} +def.groups.growing = nil +def.drop = { + max_items = 2, items = { + {items = {"farming:pepper_red 2"}, rarity = 1}, + {items = {"farming:pepper_red"}, rarity = 2}, + {items = {"farming:pepper_red"}, rarity = 3} + } +} +minetest.register_node("farming:pepper_7", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:pepper"] = { + crop = "farming:pepper", + seed = "farming:peppercorn", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 5 +} diff --git a/mods/farming/crops/pineapple.lua b/mods/farming/crops/pineapple.lua new file mode 100644 index 0000000..6bb1918 --- /dev/null +++ b/mods/farming/crops/pineapple.lua @@ -0,0 +1,141 @@ + +local S = farming.intllib + +-- pineapple top +minetest.register_craftitem("farming:pineapple_top", { + description = S("Pineapple Top"), + inventory_image = "farming_pineapple_top.png", + groups = {seed = 2, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:pineapple_1") + end +}) + +-- pineapple +minetest.register_node("farming:pineapple", { + description = S("Pineapple"), + drawtype = "plantlike", + tiles = {"farming_pineapple.png"}, + inventory_image = "farming_pineapple.png", + wield_image = "farming_pineapple.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27} + }, + groups = {food_pineapple = 1, fleshy = 3, dig_immediate = 3, flammable = 2} +}) + +-- pineapple +minetest.register_craftitem("farming:pineapple_ring", { + description = S("Pineapple Ring"), + inventory_image = "farming_pineapple_ring.png", + groups = {food_pineapple_ring = 1, flammable = 2}, + on_use = minetest.item_eat(1) +}) + +minetest.register_craft( { + output = "farming:pineapple_ring 5", + recipe = {{"group:food_pineapple"}}, + replacements = {{"farming:pineapple", "farming:pineapple_top"}} +}) + +-- pineapple juice +minetest.register_craftitem("farming:pineapple_juice", { + description = S("Pineapple Juice"), + inventory_image = "farming_pineapple_juice.png", + on_use = minetest.item_eat(4, "vessels:drinking_glass"), + groups = {vessel = 1, drink = 1} +}) + +minetest.register_craft({ + output = "farming:pineapple_juice", + recipe = { + {"group:food_pineapple_ring", "group:food_pineapple_ring", + "group:food_pineapple_ring"}, + {"", "farming:juicer", ""}, + {"", "vessels:drinking_glass", ""} + }, + replacements = { + {"group:food_juicer", "farming:juicer"} + } +}) + +minetest.register_craft({ + output = "farming:pineapple_juice 2", + recipe = { + {"group:food_pineapple", ""}, + {"farming:juicer", ""}, + {"vessels:drinking_glass", "vessels:drinking_glass"} + }, + replacements = { + {"group:food_juicer", "farming:juicer"} + } +}) + +-- crop definition +local def = { + drawtype = "plantlike", + visual_scale = 1.5, + tiles = {"farming_pineapple_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:pineapple_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_pineapple_2.png"} +minetest.register_node("farming:pineapple_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_pineapple_3.png"} +minetest.register_node("farming:pineapple_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_pineapple_4.png"} +minetest.register_node("farming:pineapple_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_pineapple_5.png"} +minetest.register_node("farming:pineapple_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_pineapple_6.png"} +minetest.register_node("farming:pineapple_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_pineapple_7.png"} +minetest.register_node("farming:pineapple_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_pineapple_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:pineapple"}, rarity = 1}, + {items = {"farming:pineapple"}, rarity = 10} + } +} +minetest.register_node("farming:pineapple_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:pineapple"] = { + crop = "farming:pineapple", + seed = "farming:pineapple_top", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/potato.lua b/mods/farming/crops/potato.lua new file mode 100644 index 0000000..a55ab29 --- /dev/null +++ b/mods/farming/crops/potato.lua @@ -0,0 +1,112 @@ + +--[[ + Original textures from DocFarming mod + https://forum.minetest.net/viewtopic.php?id=3948 +]] + +local S = farming.intllib + +-- potato +minetest.register_craftitem("farming:potato", { + description = S("Potato"), + inventory_image = "farming_potato.png", + groups = {seed = 2, food_potato = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1") + end, + -- 1 in 3 chance of being poisoned + on_use = function(itemstack, user, pointed_thing) + if user then + if math.random(3) == 1 then + return minetest.do_item_eat(-1, nil, itemstack, user, pointed_thing) + else + return minetest.do_item_eat(1, nil, itemstack, user, pointed_thing) + end + end + end +}) + +-- baked potato +minetest.register_craftitem("farming:baked_potato", { + description = S("Baked Potato"), + inventory_image = "farming_baked_potato.png", + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 10, + output = "farming:baked_potato", + recipe = "group:food_potato" +}) + +-- Potato and cucumber Salad +minetest.register_craftitem("farming:potato_salad", { + description = S("Cucumber and Potato Salad"), + inventory_image = "farming_potato_salad.png", + on_use = minetest.item_eat(10, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:potato_salad", + recipe = { + {"group:food_cucumber"}, + {"farming:baked_potato"}, + {"group:food_bowl"} + } +}) + +-- potato definition +local def = { + drawtype = "plantlike", + tiles = {"farming_potato_1.png"}, + paramtype = "light", + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:potato_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_potato_2.png"} +minetest.register_node("farming:potato_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_potato_3.png"} +def.drop = { + items = { + {items = {"farming:potato"}, rarity = 1}, + {items = {"farming:potato"}, rarity = 3} + } +} +minetest.register_node("farming:potato_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_potato_4.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:potato 2"}, rarity = 1}, + {items = {"farming:potato 3"}, rarity = 2} + } +} +minetest.register_node("farming:potato_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:potato"] = { + crop = "farming:potato", + seed = "farming:potato", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 4 +} diff --git a/mods/farming/crops/pumpkin.lua b/mods/farming/crops/pumpkin.lua new file mode 100644 index 0000000..2829d47 --- /dev/null +++ b/mods/farming/crops/pumpkin.lua @@ -0,0 +1,208 @@ + +--[[ + Big thanks to PainterlyPack.net for allowing me to use these textures +]] + +local S = farming.intllib + +-- pumpkin slice +minetest.register_craftitem("farming:pumpkin_slice", { + description = S("Pumpkin Slice"), + inventory_image = "farming_pumpkin_slice.png", + groups = {seed = 2, food_pumpkin_slice = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1") + end, + on_use = minetest.item_eat(2) +}) + +minetest.register_craft({ + output = "farming:pumpkin", + recipe = { + {"farming:pumpkin_slice", "farming:pumpkin_slice"}, + {"farming:pumpkin_slice", "farming:pumpkin_slice"} + } +}) + +minetest.register_craft({ + output = "farming:pumpkin_slice 4", + recipe = {{"farming:cutting_board", "farming:pumpkin"}}, + replacements = {{"farming:cutting_board", "farming:cutting_board"}} +}) + +-- jack 'o lantern +minetest.register_node("farming:jackolantern", { + description = S("Jack 'O Lantern (punch to turn on and off)"), + tiles = { + "farming_pumpkin_top.png", "farming_pumpkin_top.png", + "farming_pumpkin_side.png", "farming_pumpkin_side.png", + "farming_pumpkin_side.png", "farming_pumpkin_face_off.png" + }, + paramtype2 = "facedir", + groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2}, + sounds = default.node_sound_wood_defaults(), + on_punch = function(pos, node, puncher) + local name = puncher:get_player_name() or "" + if minetest.is_protected(pos, name) then return end + node.name = "farming:jackolantern_on" + minetest.swap_node(pos, node) + end +}) + +minetest.register_node("farming:jackolantern_on", { + tiles = { + "farming_pumpkin_top.png", "farming_pumpkin_top.png", + "farming_pumpkin_side.png", "farming_pumpkin_side.png", + "farming_pumpkin_side.png", "farming_pumpkin_face_on.png" + }, + light_source = default.LIGHT_MAX - 1, + paramtype2 = "facedir", + groups = { + choppy = 1, oddly_breakable_by_hand = 1, flammable = 2, + not_in_creative_inventory = 1 + }, + sounds = default.node_sound_wood_defaults(), + drop = "farming:jackolantern", + on_punch = function(pos, node, puncher) + local name = puncher:get_player_name() or "" + if minetest.is_protected(pos, name) then return end + node.name = "farming:jackolantern" + minetest.swap_node(pos, node) + end +}) + +minetest.register_craft({ + output = "farming:jackolantern", + recipe = { + {"default:torch"}, + {"group:food_pumpkin"} + } +}) + +--- wooden scarecrow base +minetest.register_node("farming:scarecrow_bottom", { + description = S("Scarecrow Bottom"), + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "facedir", + tiles = {"default_wood.png"}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16}, + {-12/16, 4/16, -1/16, 12/16, 2/16, 1/16}, + } + }, + groups = {snappy = 3, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:scarecrow_bottom", + recipe = { + {"", "group:stick", ""}, + {"group:stick", "group:stick", "group:stick"}, + {"", "group:stick", ""} + } +}) + +-- pumpkin bread +minetest.register_craftitem("farming:pumpkin_bread", { + description = S("Pumpkin Bread"), + inventory_image = "farming_pumpkin_bread.png", + on_use = minetest.item_eat(8), + groups = {food_bread = 1, flammable = 2} +}) + +minetest.register_craftitem("farming:pumpkin_dough", { + description = S("Pumpkin Dough"), + inventory_image = "farming_pumpkin_dough.png" +}) + +minetest.register_craft({ + output = "farming:pumpkin_dough", + recipe = { + {"group:food_pumpkin_slice", "group:food_flour", "group:food_pumpkin_slice"} + } +}) + +minetest.register_craft({ + type = "cooking", + output = "farming:pumpkin_bread", + recipe = "farming:pumpkin_dough", + cooktime = 10 +}) + +-- pumpkin definition +local def = { + drawtype = "plantlike", + tiles = {"farming_pumpkin_1.png"}, + paramtype = "light", + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:pumpkin_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_pumpkin_2.png"} +minetest.register_node("farming:pumpkin_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_pumpkin_3.png"} +minetest.register_node("farming:pumpkin_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_pumpkin_4.png"} +minetest.register_node("farming:pumpkin_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_pumpkin_5.png"} +minetest.register_node("farming:pumpkin_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_pumpkin_6.png"} +minetest.register_node("farming:pumpkin_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_pumpkin_7.png"} +minetest.register_node("farming:pumpkin_7", table.copy(def)) + +-- stage 8 (final) +minetest.register_node("farming:pumpkin_8", { + description = S("Pumpkin"), + tiles = { + "farming_pumpkin_top.png", + "farming_pumpkin_bottom.png", + "farming_pumpkin_side.png" + }, + groups = { + food_pumpkin = 1, choppy = 2, oddly_breakable_by_hand = 1, + flammable = 2, plant = 1 + }, + drop = "farming:pumpkin_8", + sounds = default.node_sound_wood_defaults(), + paramtype2 = "facedir", + on_place = minetest.rotate_node +}) + +minetest.register_alias("farming:pumpkin", "farming:pumpkin_8") + +-- add to registered_plants +farming.registered_plants["farming:pumpkin"] = { + crop = "farming:pumpkin", + seed = "farming:pumpkin_slice", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/raspberry.lua b/mods/farming/crops/raspberry.lua new file mode 100644 index 0000000..df1d3d9 --- /dev/null +++ b/mods/farming/crops/raspberry.lua @@ -0,0 +1,80 @@ + +local S = farming.intllib + +-- raspberries +minetest.register_craftitem("farming:raspberries", { + description = S("Raspberries"), + inventory_image = "farming_raspberries.png", + groups = {seed = 2, food_raspberries = 1, food_raspberry = 1, + food_berry = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1") + end, + on_use = minetest.item_eat(1) +}) + +-- raspberry smoothie +minetest.register_craftitem("farming:smoothie_raspberry", { + description = S("Raspberry Smoothie"), + inventory_image = "farming_raspberry_smoothie.png", + on_use = minetest.item_eat(2, "vessels:drinking_glass"), + groups = {vessel = 1, drink = 1} +}) + +minetest.register_craft({ + output = "farming:smoothie_raspberry", + recipe = { + {"default:snow"}, + {"group:food_raspberries"}, + {"vessels:drinking_glass"} + } +}) + +-- raspberries definition +local def = { + drawtype = "plantlike", + tiles = {"farming_raspberry_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:raspberry_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_raspberry_2.png"} +minetest.register_node("farming:raspberry_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_raspberry_3.png"} +minetest.register_node("farming:raspberry_3", table.copy(def)) + +-- stage 4 (final) +def.tiles = {"farming_raspberry_4.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:raspberries 2"}, rarity = 1}, + {items = {"farming:raspberries"}, rarity = 2}, + {items = {"farming:raspberries"}, rarity = 3} + } +} +minetest.register_node("farming:raspberry_4", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:raspberries"] = { + crop = "farming:raspberry", + seed = "farming:raspberries", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 4 +} diff --git a/mods/farming/crops/rhubarb.lua b/mods/farming/crops/rhubarb.lua new file mode 100644 index 0000000..d0ac58a --- /dev/null +++ b/mods/farming/crops/rhubarb.lua @@ -0,0 +1,77 @@ + +local S = farming.intllib + +-- rhubarb +minetest.register_craftitem("farming:rhubarb", { + description = S("Rhubarb"), + inventory_image = "farming_rhubarb.png", + groups = {seed = 2, food_rhubarb = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1") + end, + on_use = minetest.item_eat(1) +}) + +-- rhubarb pie +minetest.register_craftitem("farming:rhubarb_pie", { + description = S("Rhubarb Pie"), + inventory_image = "farming_rhubarb_pie.png", + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + output = "farming:rhubarb_pie", + recipe = { + {"farming:baking_tray", "group:food_sugar", ""}, + {"group:food_rhubarb", "group:food_rhubarb", "group:food_rhubarb"}, + {"group:food_wheat", "group:food_wheat", "group:food_wheat"} + }, + replacements = {{"group:food_baking_tray", "farming:baking_tray"}} +}) + +-- rhubarb definition +local def = { + drawtype = "plantlike", + tiles = {"farming_rhubarb_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults(), + minlight = 10, + maxlight = 12 +} + +-- stage 1 +minetest.register_node("farming:rhubarb_1", table.copy(def)) + +-- stage2 +def.tiles = {"farming_rhubarb_2.png"} +minetest.register_node("farming:rhubarb_2", table.copy(def)) + +-- stage 3 (final) +def.tiles = {"farming_rhubarb_3.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:rhubarb 2"}, rarity = 1}, + {items = {"farming:rhubarb"}, rarity = 2}, + {items = {"farming:rhubarb"}, rarity = 3} + } +} +minetest.register_node("farming:rhubarb_3", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:rhubarb"] = { + crop = "farming:rhubarb", + seed = "farming:rhubarb", + minlight = 10, + maxlight = 12, + steps = 3 +} diff --git a/mods/farming/crops/rice.lua b/mods/farming/crops/rice.lua new file mode 100644 index 0000000..6b8e2be --- /dev/null +++ b/mods/farming/crops/rice.lua @@ -0,0 +1,139 @@ + +local S = farming.intllib + +-- rice +minetest.register_craftitem("farming:rice", { + description = S("Rice"), + inventory_image = "farming_rice.png", + groups = {seed = 2, food_rice = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:rice_1") + end +}) + +-- replacement for rice seeds that was removed +minetest.register_alias("farming:seed_rice", "farming:rice") + +minetest.register_craftitem("farming:rice_bread", { + description = S("Rice Bread"), + inventory_image = "farming_rice_bread.png", + on_use = minetest.item_eat(5), + groups = {food_rice_bread = 1, flammable = 2} +}) + +minetest.register_craftitem("farming:rice_flour", { + description = S("Rice Flour"), + inventory_image = "farming_rice_flour.png", + groups = {food_rice_flour = 1, flammable = 1} +}) + +minetest.register_craft({ + output = "farming:rice_flour", + recipe = { + {"farming:rice", "farming:rice", "farming:rice"}, + {"farming:rice", "farming:mortar_pestle", ""} + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}} +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 15, + output = "farming:rice_bread", + recipe = "farming:rice_flour" +}) + +-- rice definition +local def = { + drawtype = "plantlike", + tiles = {"farming_rice_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 = 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:rice_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_rice_2.png"} +minetest.register_node("farming:rice_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_rice_3.png"} +minetest.register_node("farming:rice_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_rice_4.png"} +minetest.register_node("farming:rice_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_rice_5.png"} +def.drop = { + items = { + {items = {"farming:rice"}, rarity = 2} + } +} +minetest.register_node("farming:rice_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_rice_6.png"} +def.drop = { + items = { + {items = {"farming:rice"}, rarity = 2} + } +} +minetest.register_node("farming:rice_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_rice_7.png"} +def.drop = { + items = { + {items = {"farming:rice"}, rarity = 1}, + {items = {"farming:rice"}, rarity = 3} + } +} +minetest.register_node("farming:rice_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_rice_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:rice 2"}, rarity = 1}, + {items = {"farming:rice"}, rarity = 2} + } +} +minetest.register_node("farming:rice_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:rice"] = { + crop = "farming:rice", + seed = "farming:rice", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} + +-- fuels +minetest.register_craft({ + type = "fuel", + recipe = "farming:rice", + burntime = 1 +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:rice_bread", + burntime = 1 +}) diff --git a/mods/farming/crops/ryeoatrice.lua b/mods/farming/crops/ryeoatrice.lua new file mode 100644 index 0000000..ad2d5bc --- /dev/null +++ b/mods/farming/crops/ryeoatrice.lua @@ -0,0 +1,114 @@ + +local S = farming.intllib + +--= A nice addition from Ademant's grain mod :) + +-- Rye + +farming.register_plant("farming:rye", { + description = S("Rye seed"), + paramtype2 = "meshoptions", + inventory_image = "farming_rye_seed.png", + steps = 8, + place_param2 = 3 +}) + +minetest.override_item("farming:rye", { + description = S("Rye"), + groups = {food_rye = 1, flammable = 4} +}) + +minetest.override_item("farming:rye_1", {drop = {}}) +minetest.override_item("farming:rye_2", {drop = {}}) +minetest.override_item("farming:rye_3", {drop = {}}) + +minetest.register_craft({ + output = "farming:flour", + recipe = { + {"farming:rye", "farming:rye", "farming:rye"}, + {"farming:rye", "farming:mortar_pestle", ""} + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}} +}) + +-- Oats + +farming.register_plant("farming:oat", { + description = S("Oat seed"), + paramtype2 = "meshoptions", + inventory_image = "farming_oat_seed.png", + steps = 8, + place_param2 = 3 +}) + +minetest.override_item("farming:oat", { + description = S("Oats"), + groups = {food_oats = 1, flammable = 4} +}) + +minetest.override_item("farming:oat_1", {drop = {}}) +minetest.override_item("farming:oat_2", {drop = {}}) +minetest.override_item("farming:oat_3", {drop = {}}) + +minetest.register_craft({ + output = "farming:flour", + recipe = { + {"farming:oat", "farming:oat", "farming:oat"}, + {"farming:oat", "farming:mortar_pestle", ""} + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}} +}) + +-- Multigrain flour + +minetest.register_craftitem("farming:flour_multigrain", { + description = S("Multigrain Flour"), + inventory_image = "farming_flour_multigrain.png", + groups = {food_flour = 1, flammable = 1}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:flour_multigrain", + recipe = { + "farming:wheat", "farming:barley", "farming:oat", + "farming:rye", "farming:mortar_pestle" + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}} +}) + +-- Multigrain bread + +minetest.register_craftitem("farming:bread_multigrain", { + description = S("Multigrain Bread"), + inventory_image = "farming_bread_multigrain.png", + on_use = minetest.item_eat(7), + groups = {food_bread = 1, flammable = 2} +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 15, + output = "farming:bread_multigrain", + recipe = "farming:flour_multigrain" +}) + +-- Fuels + +minetest.register_craft({ + type = "fuel", + recipe = "farming:bread_multigrain", + burntime = 1 +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:rye", + burntime = 1 +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:oat", + burntime = 1 +}) diff --git a/mods/farming/crops/soy.lua b/mods/farming/crops/soy.lua new file mode 100644 index 0000000..e0ed093 --- /dev/null +++ b/mods/farming/crops/soy.lua @@ -0,0 +1,192 @@ + +local S = farming.intllib + +-- soy pod +minetest.register_craftitem("farming:soy_pod", { + description = S("Soy Pod"), + inventory_image = "farming_soy_pod.png", + groups = {seed = 2, food_soy = 1, food_soy_pod = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:soy_1") + end +}) + +-- replacement for soy beans that was removed +minetest.register_alias("farming:soy_beans", "farming:soy_pod") + +-- soy sauce +minetest.register_node("farming:soy_sauce", { + description = S("Soy Sauce"), + drawtype = "plantlike", + tiles = {"farming_soy_sauce.png"}, + inventory_image = "farming_soy_sauce.png", + wield_image = "farming_soy_sauce.png", + paramtype = "light", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + groups = { + vessel = 1, food_soy_sauce = 1, dig_immediate = 3, attached_node = 1 + }, + sounds = default.node_sound_glass_defaults() +}) + +-- soy sauce recipe +minetest.register_craft( { + output = "farming:soy_sauce", + recipe = { + {"group:food_soy", "group:food_salt", "group:food_soy"}, + {"", "group:food_juicer", ""}, + {"", "bucket:bucket_water", "vessels:glass_bottle"} + }, + replacements = { + {"bucket:bucket_water", "bucket:bucket_empty"}, + {"group:food_juicer", "farming:juicer"} + } +}) + +-- soy milk +minetest.register_node("farming:soy_milk", { + description = S("Soy Milk"), + drawtype = "plantlike", + tiles = {"farming_soy_milk_glass.png"}, + inventory_image = "farming_soy_milk_glass.png", + wield_image = "farming_soy_milk_glass.png", + paramtype = "light", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + on_use = minetest.item_eat(2, "vessels:drinking_glass"), + groups = { + vessel = 1, food_milk_glass = 1, dig_immediate = 3, + attached_node = 1, drink = 1 + }, + sounds = default.node_sound_glass_defaults() +}) + +minetest.register_craft( { + output = "farming:soy_milk", + recipe = { + {"group:food_soy", "group:food_soy", "group:food_soy"}, + {"farming:vanilla_extract", "bucket:bucket_water", "vessels:drinking_glass"} + }, + replacements = { + {"bucket:bucket_water", "bucket:bucket_empty"}, + {"farming:vanilla_extract", "vessels:glass_bottle"} + } +}) + +-- tofu +minetest.register_craftitem("farming:tofu", { + description = S("Tofu"), + inventory_image = "farming_tofu.png", + groups = {food_tofu = 1, food_meat_raw = 1, flammable = 2}, + on_use = minetest.item_eat(3) +}) + +minetest.register_craft({ + output = "farming:tofu", + recipe = { + {"farming:baking_tray", "group:food_soy", "group:food_soy"}, + {"group:food_soy", "group:food_soy", "group:food_soy"} + }, + replacements = {{"farming:baking_tray", "farming:baking_tray"}} +}) + +-- cooked tofu +minetest.register_craftitem("farming:tofu_cooked", { + description = S("Cooked Tofu"), + inventory_image = "farming_tofu_cooked.png", + groups = {food_meat = 1, flammable = 2}, + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + type = "cooking", + output = "farming:tofu_cooked", + recipe = "farming:tofu", + cooktime = 5 +}) + +-- crop definition + +local def = { + drawtype = "plantlike", + tiles = {"farming_soy_1.png"}, + paramtype = "light", + paramtype2 = "meshoptions", + place_param2 = 3, + sunlight_propagates = true, + waving = 1, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:soy_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_soy_2.png"} +minetest.register_node("farming:soy_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_soy_3.png"} +minetest.register_node("farming:soy_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_soy_4.png"} +minetest.register_node("farming:soy_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_soy_5.png"} +def.drop = { + max_items = 1, items = { + {items = {"farming:soy_pod"}, rarity = 1}, + } +} +minetest.register_node("farming:soy_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_soy_6.png"} +def.drop = { + max_items = 3, items = { + {items = {"farming:soy_pod"}, rarity = 1}, + {items = {"farming:soy_pod"}, rarity = 2}, + {items = {"farming:soy_pod"}, rarity = 3} + } +} +minetest.register_node("farming:soy_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_soy_7.png"} +def.groups.growing = nil +def.drop = { + max_items = 5, items = { + {items = {"farming:soy_pod"}, rarity = 1}, + {items = {"farming:soy_pod"}, rarity = 2}, + {items = {"farming:soy_pod"}, rarity = 3}, + {items = {"farming:soy_pod"}, rarity = 4}, + {items = {"farming:soy_pod"}, rarity = 5} + } +} +minetest.register_node("farming:soy_7", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:soy_pod"] = { + crop = "farming:soy", + seed = "farming:soy_pod", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 7 +} diff --git a/mods/farming/crops/sunflower.lua b/mods/farming/crops/sunflower.lua new file mode 100644 index 0000000..1a45054 --- /dev/null +++ b/mods/farming/crops/sunflower.lua @@ -0,0 +1,155 @@ +local S = farming.intllib + +-- sunflower +minetest.register_craftitem("farming:sunflower", { + description = S("Sunflower"), + inventory_image = "farming_sunflower.png", + groups = {flammable = 2} +}) + +-- sunflower seeds +minetest.register_craftitem("farming:seed_sunflower", { + description = S("Sunflower Seeds"), + inventory_image = "farming_sunflower_seeds.png", + groups = {seed = 2, food_sunflower_seeds = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:sunflower_1") + end +}) + +minetest.register_alias("farming:sunflower_seeds", "farming:seed_sunflower") + +minetest.register_craft({ + output = "farming:seed_sunflower 5", + recipe = {{"farming:sunflower"}} +}) + +-- sunflower seeds (toasted) +minetest.register_craftitem("farming:sunflower_seeds_toasted", { + description = S("Toasted Sunflower Seeds"), + inventory_image = "farming_sunflower_seeds_toasted.png", + groups = {food_sunflower_seeds_toasted = 1, flammable = 2}, + on_use = minetest.item_eat(1) +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 10, + output = "farming:sunflower_seeds_toasted", + recipe = "farming:seed_sunflower" +}) + +-- sunflower oil +minetest.register_node("farming:sunflower_oil", { + description = S("Bottle of Sunflower Oil"), + drawtype = "plantlike", + tiles = {"farming_sunflower_oil.png"}, + inventory_image = "farming_sunflower_oil.png", + wield_image = "farming_sunflower_oil.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, + groups = { + food_oil = 1, vessel = 1, dig_immediate = 3, attached_node = 1, + flammable = 2 + }, + sounds = default.node_sound_glass_defaults() +}) + +minetest.register_craft( { + output = "farming:sunflower_oil", + recipe = { + {"group:food_sunflower_seeds", "group:food_sunflower_seeds", "group:food_sunflower_seeds"}, + {"group:food_sunflower_seeds", "group:food_sunflower_seeds", "group:food_sunflower_seeds"}, + {"group:food_sunflower_seeds", "vessels:glass_bottle", "group:food_sunflower_seeds"} + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:sunflower_oil", + burntime = 30, + replacements = {{"farming:sunflower_oil", "vessels:glass_bottle"}} +}) + +-- sunflower seed bread +minetest.register_craftitem("farming:sunflower_bread", { + description = S("Sunflower Seed Bread"), + inventory_image = "farming_sunflower_bread.png", + on_use = minetest.item_eat(8), + groups = {food_bread = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:sunflower_bread", + recipe = {{"group:food_sunflower_seeds_toasted", "group:food_bread", "group:food_sunflower_seeds_toasted"}} +}) + +-- sunflower definition +local def = { + drawtype = "plantlike", + tiles = {"farming_sunflower_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:sunflower_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_sunflower_2.png"} +minetest.register_node("farming:sunflower_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_sunflower_3.png"} +minetest.register_node("farming:sunflower_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_sunflower_4.png"} +minetest.register_node("farming:sunflower_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_sunflower_5.png"} +minetest.register_node("farming:sunflower_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_sunflower_6.png"} +def.visual_scale = 1.9 +minetest.register_node("farming:sunflower_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_sunflower_7.png"} +minetest.register_node("farming:sunflower_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_sunflower_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:sunflower"}, rarity = 1}, + {items = {"farming:sunflower"}, rarity = 6} + } +} +minetest.register_node("farming:sunflower_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:sunflower"] = { + crop = "farming:sunflower", + seed = "farming:seed_sunflower", + minlight = 14, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/tomato.lua b/mods/farming/crops/tomato.lua new file mode 100644 index 0000000..6eff7c6 --- /dev/null +++ b/mods/farming/crops/tomato.lua @@ -0,0 +1,106 @@ + +--[[ + Textures edited from: + http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1288375-food-plus-mod-more-food-than-you-can-imagine-v2-9) +]] + +local S = farming.intllib + +-- tomato +minetest.register_craftitem("farming:tomato", { + description = S("Tomato"), + inventory_image = "farming_tomato.png", + groups = {seed = 2, food_tomato = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1") + end, + on_use = minetest.item_eat(4) +}) + +-- tomato soup +minetest.register_craftitem("farming:tomato_soup", { + description = S("Tomato Soup"), + inventory_image = "farming_tomato_soup.png", + groups = {flammable = 2}, + on_use = minetest.item_eat(8, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:tomato_soup", + recipe = { + {"group:food_tomato"}, + {"group:food_tomato"}, + {"group:food_bowl"} + } +}) + +-- tomato definition +local def = { + drawtype = "plantlike", + tiles = {"farming_tomato_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- stage 1 +minetest.register_node("farming:tomato_1", table.copy(def)) + +-- stage2 +def.tiles = {"farming_tomato_2.png"} +minetest.register_node("farming:tomato_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_tomato_3.png"} +minetest.register_node("farming:tomato_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_tomato_4.png"} +minetest.register_node("farming:tomato_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_tomato_5.png"} +minetest.register_node("farming:tomato_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_tomato_6.png"} +minetest.register_node("farming:tomato_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_tomato_7.png"} +def.drop = { + items = { + {items = {"farming:tomato"}, rarity = 1}, + {items = {"farming:tomato"}, rarity = 3} + } +} +minetest.register_node("farming:tomato_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_tomato_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:tomato 3"}, rarity = 1}, + {items = {"farming:tomato 2"}, rarity = 2}, + {items = {"farming:tomato 1"}, rarity = 3} + } +} +minetest.register_node("farming:tomato_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:tomato"] = { + crop = "farming:tomato", + seed = "farming:tomato", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/vanilla.lua b/mods/farming/crops/vanilla.lua new file mode 100644 index 0000000..f014a8d --- /dev/null +++ b/mods/farming/crops/vanilla.lua @@ -0,0 +1,122 @@ +local S = farming.intllib + +-- vanilla +minetest.register_craftitem("farming:vanilla", { + description = S("Vanilla"), + inventory_image = "farming_vanilla.png", + groups = {seed = 2, food_vanilla = 1, flammable = 2}, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:vanilla_1") + end, + on_use = minetest.item_eat(1) +}) + +-- crop definition +local def = { + drawtype = "plantlike", + tiles = {"farming_vanilla_1.png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = "", + selection_box = farming.select, + groups = { + snappy = 3, flammable = 2, plant = 1, attached_node = 1, + not_in_creative_inventory = 1, growing = 1 + }, + sounds = default.node_sound_leaves_defaults() +} + +-- vanilla extract +minetest.register_node("farming:vanilla_extract", { + description = S("Vanilla Extract"), + drawtype = "plantlike", + tiles = {"farming_vanilla_extract.png"}, + inventory_image = "farming_vanilla_extract.png", + wield_image = "farming_vanilla_extract.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_craft( { + output = "farming:vanilla_extract", + recipe = { + {"group:food_vanilla", "group:food_vanilla", "group:food_vanilla"}, + {"group:food_vanilla", "farming:bottle_ethanol", "group:food_water_glass"}, + }, + replacements = { + {"group:food_water_glass", "vessels:drinking_glass"} + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:vanilla_extract", + burntime = 25, + replacements = {{"farming:vanilla_extract", "vessels:glass_bottle"}} +}) + +-- stage 1 +minetest.register_node("farming:vanilla_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_vanilla_2.png"} +minetest.register_node("farming:vanilla_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_vanilla_3.png"} +minetest.register_node("farming:vanilla_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_vanilla_4.png"} +minetest.register_node("farming:vanilla_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_vanilla_5.png"} +minetest.register_node("farming:vanilla_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_vanilla_6.png"} +def.visual_scale = 1.9 +minetest.register_node("farming:vanilla_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_vanilla_7.png"} +def.drop = { + items = { + {items = {"farming:vanilla"}, rarity = 1}, + {items = {"farming:vanilla"}, rarity = 2}, + {items = {"farming:vanilla"}, rarity = 3} + } +} +minetest.register_node("farming:vanilla_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_vanilla_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:vanilla 2"}, rarity = 1}, + {items = {"farming:vanilla 2"}, rarity = 2}, + {items = {"farming:vanilla 2"}, rarity = 2}, + {items = {"farming:vanilla 2"}, rarity = 3} + } +} +minetest.register_node("farming:vanilla_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:vanilla"] = { + crop = "farming:vanilla", + seed = "farming:vanilla", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} diff --git a/mods/farming/crops/wheat.lua b/mods/farming/crops/wheat.lua new file mode 100644 index 0000000..1a7de8a --- /dev/null +++ b/mods/farming/crops/wheat.lua @@ -0,0 +1,249 @@ + +local S = farming.intllib + +-- wheat seeds +minetest.register_node("farming:seed_wheat", { + description = S("Wheat Seed"), + tiles = {"farming_wheat_seed.png"}, + inventory_image = "farming_wheat_seed.png", + wield_image = "farming_wheat_seed.png", + drawtype = "signlike", + groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 4}, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = farming.select, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, "farming:wheat_1") + end +}) + +-- harvested wheat +minetest.register_craftitem("farming:wheat", { + description = S("Wheat"), + inventory_image = "farming_wheat.png", + groups = {food_wheat = 1, flammable = 4} +}) + +-- straw +minetest.register_node("farming:straw", { + description = S("Straw"), + tiles = {"farming_straw.png"}, + is_ground_content = false, + groups = {snappy = 3, flammable = 4, fall_damage_add_percent = -30}, + sounds = default.node_sound_leaves_defaults() +}) + +minetest.register_craft({ + output = "farming:straw 3", + recipe = { + {"farming:wheat", "farming:wheat", "farming:wheat"}, + {"farming:wheat", "farming:wheat", "farming:wheat"}, + {"farming:wheat", "farming:wheat", "farming:wheat"} + } +}) + +minetest.register_craft({ + output = "farming:wheat 3", + recipe = {{"farming:straw"}} +}) + +-- check and register stairs +if minetest.global_exists("stairs") then + + if stairs.mod and stairs.mod == "redo" then + + stairs.register_all("straw", "farming:straw", + {snappy = 3, flammable = 4}, + {"farming_straw.png"}, + "Straw", + default.node_sound_leaves_defaults()) + else + + stairs.register_stair_and_slab("straw", "farming:straw", + {snappy = 3, flammable = 4}, + {"farming_straw.png"}, + "Straw Stair", + "Straw Slab", + default.node_sound_leaves_defaults()) + end +end + +-- flour +minetest.register_craftitem("farming:flour", { + description = S("Flour"), + inventory_image = "farming_flour.png", + groups = {food_flour = 1, flammable = 1} +}) + +minetest.register_craft({ + output = "farming:flour", + recipe = { + {"farming:wheat", "farming:wheat", "farming:wheat"}, + {"farming:wheat", "farming:mortar_pestle", ""} + }, + replacements = {{"group:food_mortar_pestle", "farming:mortar_pestle"}} +}) + +-- bread +minetest.register_craftitem("farming:bread", { + description = S("Bread"), + inventory_image = "farming_bread.png", + on_use = minetest.item_eat(5), + groups = {food_bread = 1, flammable = 2} +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 15, + output = "farming:bread", + recipe = "farming:flour" +}) + +-- sliced bread +minetest.register_craftitem("farming:bread_slice", { + description = S("Sliced Bread"), + inventory_image = "farming_bread_slice.png", + on_use = minetest.item_eat(1), + groups = {food_bread_slice = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:bread_slice 5", + recipe = {{"group:food_cutting_board", "farming:bread"}}, + replacements = {{"group:food_cutting_board", "farming:cutting_board"}} +}) + +-- toast +minetest.register_craftitem("farming:toast", { + description = S("Toast"), + inventory_image = "farming_toast.png", + on_use = minetest.item_eat(1), + groups = {food_toast = 1, flammable = 2} +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 3, + output = "farming:toast", + recipe = "farming:bread_slice" +}) + +-- toast sandwich +minetest.register_craftitem("farming:toast_sandwich", { + description = S("Toast Sandwich"), + inventory_image = "farming_toast_sandwich.png", + on_use = minetest.item_eat(4), + groups = {flammable = 2} +}) + +minetest.register_craft({ + output = "farming:toast_sandwich", + recipe = { + {"farming:bread_slice"}, + {"farming:toast"}, + {"farming:bread_slice"} + } +}) + +-- wheat definition +local 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 = 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:wheat_1", table.copy(def)) + +-- stage 2 +def.tiles = {"farming_wheat_2.png"} +minetest.register_node("farming:wheat_2", table.copy(def)) + +-- stage 3 +def.tiles = {"farming_wheat_3.png"} +minetest.register_node("farming:wheat_3", table.copy(def)) + +-- stage 4 +def.tiles = {"farming_wheat_4.png"} +minetest.register_node("farming:wheat_4", table.copy(def)) + +-- stage 5 +def.tiles = {"farming_wheat_5.png"} +def.drop = { + items = { + {items = {"farming:wheat"}, rarity = 2}, + {items = {"farming:seed_wheat"}, rarity = 2} + } +} +minetest.register_node("farming:wheat_5", table.copy(def)) + +-- stage 6 +def.tiles = {"farming_wheat_6.png"} +def.drop = { + items = { + {items = {"farming:wheat"}, rarity = 2}, + {items = {"farming:seed_wheat"}, rarity = 1} + } +} +minetest.register_node("farming:wheat_6", table.copy(def)) + +-- stage 7 +def.tiles = {"farming_wheat_7.png"} +def.drop = { + items = { + {items = {"farming:wheat"}, rarity = 1}, + {items = {"farming:wheat"}, rarity = 3}, + {items = {"farming:seed_wheat"}, rarity = 1}, + {items = {"farming:seed_wheat"}, rarity = 3} + } +} +minetest.register_node("farming:wheat_7", table.copy(def)) + +-- stage 8 (final) +def.tiles = {"farming_wheat_8.png"} +def.groups.growing = nil +def.drop = { + items = { + {items = {"farming:wheat"}, rarity = 1}, + {items = {"farming:wheat"}, rarity = 3}, + {items = {"farming:seed_wheat"}, rarity = 1}, + {items = {"farming:seed_wheat"}, rarity = 3} + } +} +minetest.register_node("farming:wheat_8", table.copy(def)) + +-- add to registered_plants +farming.registered_plants["farming:wheat"] = { + crop = "farming:wheat", + seed = "farming:seed_wheat", + minlight = farming.min_light, + maxlight = farming.max_light, + steps = 8 +} + +-- fuels +minetest.register_craft({ + type = "fuel", + recipe = "farming:straw", + burntime = 3 +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:wheat", + burntime = 1 +}) diff --git a/mods/farming/depends.txt b/mods/farming/depends.txt index 301d971..650885b 100644 --- a/mods/farming/depends.txt +++ b/mods/farming/depends.txt @@ -1,3 +1,5 @@ default -wool -stairs +stairs? +intllib? +lucky_block? +toolranks? diff --git a/mods/farming/description.txt b/mods/farming/description.txt new file mode 100644 index 0000000..58bdc81 --- /dev/null +++ b/mods/farming/description.txt @@ -0,0 +1 @@ +Adds many plants and food to Minetest \ No newline at end of file diff --git a/mods/farming/farming.conf_example b/mods/farming/farming.conf_example new file mode 100644 index 0000000..7f103cd --- /dev/null +++ b/mods/farming/farming.conf_example @@ -0,0 +1,49 @@ + +--[[ + Farming settings can be changed here and kept inside mod folder + even after the mod has been updated, or you can place inside + world folder for map specific settings. +--]] + +-- true to enable crop/food in-game and on mapgen set spawn rarety +farming.carrot = 0.001 +farming.potato = 0.001 +farming.tomato = 0.001 +farming.cucumber = 0.001 +farming.corn = 0.001 +farming.coffee = 0.001 +farming.melon = 0.001 +farming.pumpkin = 0.001 +farming.cocoa = true -- true or false only +farming.raspberry = 0.001 +farming.blueberry = 0.001 +farming.rhubarb = 0.001 +farming.beans = 0.001 +farming.grapes = 0.001 +farming.barley = true -- true or false only +farming.chili = 0.003 +farming.hemp = 0.003 +farming.garlic = 0.001 +farming.onion = 0.001 +farming.pepper = 0.002 +farming.pineapple = 0.001 +farming.peas = 0.001 +farming.beetroot = 0.001 +farming.mint = 0.005 +farming.cabbage = 0.001 +farming.blackberry = 0.002 +farming.lettuce = 0.001 +farming.soy = 0.001 +farming.vanilla = 0.001 +farming.artichoke = 0.001 +farming.parsley = 0.002 +farming.sunflower = 0.001 +farming.grains = true -- true or false only +farming.rice = true + +-- default rarety of crops on map (higher number = more crops) +farming.rarety = 0.002 + +-- default minimum and maximum light levels crops need to grow +farming.min_light = 12 +farming.max_light = 15 diff --git a/mods/farming/food.lua b/mods/farming/food.lua new file mode 100644 index 0000000..8665625 --- /dev/null +++ b/mods/farming/food.lua @@ -0,0 +1,689 @@ + +local S = farming.intllib + +--= filter sea water into river water +minetest.register_craft({ + output = "bucket:bucket_river_water", + recipe = { + {"farming:hemp_fibre"}, + {"farming:hemp_fibre"}, + {"bucket:bucket_water"} + } +}) + +--= glass of water + +minetest.register_craftitem("farming:glass_water", { + description = S("Glass of Water"), + inventory_image = "farming_water_glass.png", + groups = {food_water_glass = 1, flammable = 3, vessel = 1} +}) + +minetest.register_craft({ + output = "farming:glass_water 4", + recipe = { + {"vessels:drinking_glass", "vessels:drinking_glass"}, + {"vessels:drinking_glass", "vessels:drinking_glass"}, + {"bucket:bucket_river_water", ""} + }, + replacements = {{"bucket:bucket_river_water", "bucket:bucket_empty"}} +}) + +minetest.register_craft({ + output = "farming:glass_water 4", + recipe = { + {"vessels:drinking_glass", "vessels:drinking_glass"}, + {"vessels:drinking_glass", "vessels:drinking_glass"}, + {"bucket:bucket_water", "farming:hemp_fibre"} + }, + replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} +}) + +if minetest.get_modpath("bucket_wooden") then + + minetest.register_craft({ + output = "farming:glass_water 4", + recipe = { + {"vessels:drinking_glass", "vessels:drinking_glass"}, + {"vessels:drinking_glass", "vessels:drinking_glass"}, + {"group:water_bucket_wooden", "farming:hemp_fibre"} + }, + replacements = {{"group:water_bucket_wooden", "bucket_wooden:bucket_empty"}} + }) +end + +--= Sugar + +minetest.register_craftitem("farming:sugar", { + description = S("Sugar"), + inventory_image = "farming_sugar.png", + groups = {food_sugar = 1, flammable = 3} +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 3, + output = "farming:sugar 2", + recipe = "default:papyrus" +}) + +--= Sugar caramel + +minetest.register_craftitem("farming:caramel", { + description = S("Caramel"), + inventory_image = "farming_caramel.png", +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 6, + output = "farming:caramel", + recipe = "group:food_sugar", +}) + +--= Salt + +minetest.register_node("farming:salt", { + description = S("Salt"), + inventory_image = "farming_salt.png", + wield_image = "farming_salt.png", + drawtype = "plantlike", + visual_scale = 0.8, + paramtype = "light", + tiles = {"farming_salt.png"}, + groups = {food_salt = 1, vessel = 1, dig_immediate = 3, + attached_node = 1}, + sounds = default.node_sound_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, + -- special function to make salt crystals form inside water + dropped_step = function(self, pos, dtime) + + self.ctimer = (self.ctimer or 0) + dtime + if self.ctimer < 15.0 then return end + self.ctimer = 0 + + local needed + + if self.node_inside + and self.node_inside.name == "default:water_source" then + needed = 8 + + elseif self.node_inside + and self.node_inside.name == "default:river_water_source" then + needed = 9 + end + + if not needed then return end + + local objs = core.get_objects_inside_radius(pos, 0.5) + + if not objs or #objs ~= 1 then return end + + local salt, ent = nil, nil + + for k, obj in pairs(objs) do + + ent = obj:get_luaentity() + + if ent and ent.name == "__builtin:item" + and ent.itemstring == "farming:salt " .. needed then + + obj:remove() + + core.add_item(pos, "farming:salt_crystal") + + return false -- return with no further action + end + end + end +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 15, + output = "farming:salt", + recipe = "bucket:bucket_water", + replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}} +}) + +--= Salt Crystal + +minetest.register_node("farming:salt_crystal", { + description = ("Salt crystal"), + inventory_image = "farming_salt_crystal.png", + wield_image = "farming_salt_crystal.png", + drawtype = "plantlike", + visual_scale = 0.8, + paramtype = "light", + light_source = 1, + tiles = {"farming_salt_crystal.png"}, + groups = { dig_immediate = 3, attached_node = 1}, + sounds = default.node_sound_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, +}) +minetest.register_craft({ + output = "farming:salt 9", + recipe = { + {"farming:salt_crystal", "farming:mortar_pestle"} + }, + replacements = {{"farming:mortar_pestle", "farming:mortar_pestle"}} +}) + +minetest.register_craft({ + output = "farming:salt_crystal", + recipe = { + {"farming:salt", "farming:salt", "farming:salt"}, + {"farming:salt", "farming:salt", "farming:salt"}, + {"farming:salt", "farming:salt", "farming:salt"} + } +}) + +--= Rose Water + +minetest.register_node("farming:rose_water", { + description = S("Rose Water"), + inventory_image = "farming_rose_water.png", + wield_image = "farming_rose_water.png", + drawtype = "plantlike", + visual_scale = 0.8, + paramtype = "light", + tiles = {"farming_rose_water.png"}, + groups = {food_rose_water = 1, vessel = 1, dig_immediate = 3, + attached_node = 1}, + sounds = default.node_sound_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + } +}) + +minetest.register_craft({ + output = "farming:rose_water", + recipe = { + {"flowers:rose", "flowers:rose", "flowers:rose"}, + {"flowers:rose", "flowers:rose", "flowers:rose"}, + {"group:food_water_glass", "group:food_pot", "vessels:glass_bottle"} + }, + replacements = { + {"group:food_water_glass", "vessels:drinking_glass"}, + {"group:food_pot", "farming:pot"} + } +}) + +--= Turkish Delight + +minetest.register_craftitem("farming:turkish_delight", { + description = S("Turkish Delight"), + inventory_image = "farming_turkish_delight.png", + groups = {flammable = 3}, + on_use = minetest.item_eat(2) +}) + +minetest.register_craft({ + output = "farming:turkish_delight 4", + recipe = { + {"group:food_gelatin", "group:food_sugar", "group:food_gelatin"}, + {"group:food_sugar", "group:food_rose_water", "group:food_sugar"}, + {"group:food_sugar", "dye:pink", "group:food_sugar"} + }, + replacements = { + {"group:food_cornstarch", "farming:bowl"}, + {"group:food_rose_water", "vessels:glass_bottle"} + } +}) + +--= Garlic Bread + +minetest.register_craftitem("farming:garlic_bread", { + description = S("Garlic Bread"), + inventory_image = "farming_garlic_bread.png", + groups = {flammable = 3}, + on_use = minetest.item_eat(2) +}) + +minetest.register_craft({ + output = "farming:garlic_bread", + recipe = { + {"group:food_toast", "group:food_garlic_clove", "group:food_garlic_clove"} + } +}) + +--= Donuts (thanks to Bockwurst for making the donut images) + +minetest.register_craftitem("farming:donut", { + description = S("Donut"), + inventory_image = "farming_donut.png", + on_use = minetest.item_eat(4) +}) + +minetest.register_craft({ + output = "farming:donut 3", + recipe = { + {"", "group:food_wheat", ""}, + {"group:food_wheat", "group:food_sugar", "group:food_wheat"}, + {"", "group:food_wheat", ""} + } +}) + +minetest.register_craftitem("farming:donut_chocolate", { + description = S("Chocolate Donut"), + inventory_image = "farming_donut_chocolate.png", + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + output = "farming:donut_chocolate", + recipe = { + {"group:food_cocoa"}, + {"farming:donut"} + } +}) + +minetest.register_craftitem("farming:donut_apple", { + description = S("Apple Donut"), + inventory_image = "farming_donut_apple.png", + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + output = "farming:donut_apple", + recipe = { + {"default:apple"}, + {"farming:donut"} + } +}) + +--= Porridge Oats + +minetest.register_craftitem("farming:porridge", { + description = S("Porridge"), + inventory_image = "farming_porridge.png", + on_use = minetest.item_eat(6, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:porridge", + recipe = { + {"group:food_oats", "group:food_oats", "group:food_oats"}, + {"group:food_oats", "group:food_bowl", "group:food_milk_glass"} + }, + replacements = { + {"mobs:glass_milk", "vessels:drinking_glass"}, + {"farming:soy_milk", "vessels:drinking_glass"} + } +}) + +--= Jaffa Cake + +minetest.register_craftitem("farming:jaffa_cake", { + description = S("Jaffa Cake"), + inventory_image = "farming_jaffa_cake.png", + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + output = "farming:jaffa_cake", + recipe = { + {"farming:baking_tray", "group:food_egg", "group:food_sugar"}, + {"group:food_flour", "group:food_cocoa", "group:food_orange"}, + {"group:food_milk", "", ""} + }, + replacements = { + {"farming:baking_tray", "farming:baking_tray"}, + {"mobs:bucket_milk", "bucket:bucket_empty"}, + {"farming:soy_milk", "vessels:drining_glass"} + } +}) + +-- Apple Pie + +minetest.register_craftitem("farming:apple_pie", { + description = S("Apple Pie"), + inventory_image = "farming_apple_pie.png", + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + output = "farming:apple_pie", + recipe = { + {"group:food_flour", "group:food_sugar", "group:food_apple"}, + {"", "group:food_baking_tray", ""} + }, + replacements = {{"group:food_baking_tray", "farming:baking_tray"}} +}) + +-- Cactus Juice + +minetest.register_craftitem("farming:cactus_juice", { + description = S("Cactus Juice"), + inventory_image = "farming_cactus_juice.png", + groups = {vessel = 1, drink = 1}, + on_use = function(itemstack, user, pointed_thing) + if user then + if math.random(5) == 1 then + return minetest.do_item_eat(-1, "vessels:drinking_glass", + itemstack, user, pointed_thing) + else + return minetest.do_item_eat(2, "vessels:drinking_glass", + itemstack, user, pointed_thing) + end + end + end +}) + +minetest.register_craft({ + output = "farming:cactus_juice", + recipe = { + {"default:cactus"}, + {"farming:juicer"}, + {"vessels:drinking_glass"} + }, + replacements = { + {"group:food_juicer", "farming:juicer"} + } +}) + +-- Pasta + +minetest.register_craftitem("farming:pasta", { + description = S("Pasta"), + inventory_image = "farming_pasta.png", + groups = {food_pasta = 1} +}) + +minetest.register_craft({ + output = "farming:pasta", + recipe = { + {"group:food_flour", "group:food_butter", "group:food_mixing_bowl"} + }, + replacements = {{"group:food_mixing_bowl", "farming:mixing_bowl"}} +}) + +minetest.register_craft({ + output = "farming:pasta", + recipe = { + {"group:food_flour", "group:food_oil", "group:food_mixing_bowl"} + }, + replacements = { + {"group:food_mixing_bowl", "farming:mixing_bowl"}, + {"group:food_oil", "vessels:glass_bottle"} + } +}) + +-- Spaghetti + +minetest.register_craftitem("farming:spaghetti", { + description = S("Spaghetti"), + inventory_image = "farming_spaghetti.png", + on_use = minetest.item_eat(8) +}) + +minetest.register_craft({ + output = "farming:spaghetti", + recipe = { + {"group:food_pasta", "group:food_saucepan", "group:food_tomato"}, + {"group:food_garlic_clove", "group:food_garlic_clove", ""} + }, + replacements = {{"group:food_saucepan", "farming:saucepan"}} +}) + +-- Korean Bibimbap + +minetest.register_craftitem("farming:bibimbap", { + description = S("Bibimbap"), + inventory_image = "farming_bibimbap.png", + on_use = minetest.item_eat(8, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:bibimbap", + recipe = { + {"group:food_skillet", "group:food_bowl", "group:food_egg"}, + {"group:food_rice", "group:food_chicken_raw", "group:food_cabbage"}, + {"group:food_carrot", "group:food_chili_pepper", ""} + }, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) + +minetest.register_craft({ + output = "farming:bibimbap", + type = "shapeless", + recipe = { + "group:food_skillet", "group:food_bowl", "group:food_mushroom", + "group:food_rice", "group:food_cabbage", "group:food_carrot", + "group:food_mushroom", "group:food_chili_pepper" + }, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) + +-- Burger + +minetest.register_craftitem("farming:burger", { + description = S("Burger"), + inventory_image = "farming_burger.png", + on_use = minetest.item_eat(16), +}) + +minetest.register_craft({ + output = "farming:burger", + recipe = { + {"farming:bread", "group:food_meat", "group:food_cheese"}, + {"group:food_tomato", "group:food_cucumber", "group:food_onion"}, + {"group:food_lettuce", "", ""} + } +}) + +-- Salad + +minetest.register_craftitem("farming:salad", { + description = S("Salad"), + inventory_image = "farming_salad.png", + on_use = minetest.item_eat(8, "farming:bowl") +}) + +minetest.register_craft({ + output = "farming:salad", + type = "shapeless", + recipe = { + "group:food_bowl", "group:food_tomato", "group:food_cucumber", + "group:food_lettuce", "group:food_oil" + } +}) + +-- Triple Berry Smoothie + +minetest.register_craftitem("farming:smoothie_berry", { + description = S("Triple Berry Smoothie"), + inventory_image = "farming_berry_smoothie.png", + on_use = minetest.item_eat(6, "vessels:drinking_glass"), + groups = {vessel = 1, drink = 1} +}) + +minetest.register_craft({ + output = "farming:smoothie_berry", + type = "shapeless", + recipe = { + "group:food_raspberries", "group:food_blackberries", + "group:food_strawberry", "group:food_banana", + "vessels:drinking_glass" + } +}) + +-- Patatas a la importancia + +minetest.register_craftitem("farming:spanish_potatoes", { + description = S("Spanish Potatoes"), + inventory_image = "farming_spanish_potatoes.png", + on_use = minetest.item_eat(8, "farming:bowl"), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:spanish_potatoes", + recipe = { + "farming:potato", "group:food_parsley", "farming:potato", + "group:food_egg", "group:food_flour", "farming:onion", + "farming:garlic_clove", "group:food_bowl", "group:food_skillet" + }, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) + +-- Potato omelet + +minetest.register_craftitem("farming:potato_omelet", { + description = S("Potato omelet"), + inventory_image = "farming_potato_omelet.png", + on_use = minetest.item_eat(6, "farming:bowl") +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:potato_omelet", + recipe = { + "group:food_egg", "farming:potato", "group:food_onion", + "group:food_skillet", "group:food_bowl"}, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) + +-- Paella + +minetest.register_craftitem("farming:paella", { + description = S("Paella"), + inventory_image = "farming_paella.png", + on_use = minetest.item_eat(8, "farming:bowl") +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:paella", + recipe = { + "group:food_rice", "dye:orange", "farming:pepper_red", + "group:food_peas", "group:food_chicken", "group:food_bowl", "group:food_skillet" + }, + replacements = {{"group:food_skillet", "farming:skillet"}} +}) + +-- Flan + +minetest.register_craftitem("farming:flan", { + description = S("Vanilla Flan"), + inventory_image = "farming_vanilla_flan.png", + on_use = minetest.item_eat(6) +}) + +minetest.register_craft({ + output = "farming:flan", + recipe = { + {"group:food_sugar", "group:food_milk", "farming:caramel"}, + {"group:food_egg", "group:food_egg", "farming:vanilla_extract"} + }, + replacements = { + {"cucina_vegana:soy_milk", "vessels:drinking_glass"}, + {"group:food_milk", "bucket:bucket_empty"}, + {"farming:vanilla_extract", "vessels:glass_bottle"} + } +}) + +-- Vegan Cheese + +minetest.register_craftitem("farming:cheese_vegan", { + description = S("Vegan Cheese"), + inventory_image = "farming_cheese_vegan.png", + on_use = minetest.item_eat(2), + groups = {food_cheese = 1, flammable = 2} +}) + + +minetest.register_craft({ + output = "farming:cheese_vegan", + recipe = { + {"farming:soy_milk", "farming:soy_milk", "farming:soy_milk"}, + {"group:food_salt", "group:food_peppercorn", "farming:bottle_ethanol"}, + {"group:food_gelatin", "group:food_pot", ""} + }, + replacements = { + {"farming:soy_milk", "vessels:drinking_glass 3"}, + {"farming:pot", "farming:pot"}, + {"farming:bottle_ethanol", "vessels:glass_bottle"} + } +}) + +minetest.register_craft({ + output = "farming:cheese_vegan", + recipe = { + {"farming:soy_milk", "farming:soy_milk", "farming:soy_milk"}, + {"group:food_salt", "group:food_peppercorn", "group:food_lemon"}, + {"group:food_gelatin", "group:food_pot", ""} + }, + replacements = { + {"farming:soy_milk", "vessels:drinking_glass 3"}, + {"farming:pot", "farming:pot"} + } +}) + +-- Onigiri + +minetest.register_craftitem("farming:onigiri", { + description = S("Onirigi"), + inventory_image = "farming_onigiri.png", + on_use = minetest.item_eat(2), + groups = {flammable = 2} +}) + +minetest.register_craft({ + output = "farming:onigiri", + recipe = { + {"group:food_rice", "group:food_salt", "group:food_rice"}, + {"", "group:food_seaweed", ""} + } +}) + +-- Gyoza + +minetest.register_craftitem("farming:gyoza", { + description = S("Gyoza"), + inventory_image = "farming_gyoza.png", + on_use = minetest.item_eat(4), + groups = {flammable = 2} +}) + +minetest.register_craft({ + output = "farming:gyoza 4", + recipe = { + {"group:food_cabbage", "group:food_garlic_clove", "group:food_onion"}, + {"group:food_meat_raw", "group:food_salt", "group:food_flour"}, + {"", "group:food_skillet", ""} + + }, + replacements = { + {"group:food_skillet", "farming:skillet"} + } +}) + +-- Mochi + +minetest.register_craftitem("farming:mochi", { + description = S("Mochi"), + inventory_image = "farming_mochi.png", + on_use = minetest.item_eat(3), + groups = {flammable = 2} +}) + +minetest.register_craft({ + output = "farming:mochi", + recipe = { + {"group:food_rice", "group:food_sugar", "group:food_rice"}, + {"", "group:food_mortar_pestle", ""}, + {"", "farming:glass_water", ""} + }, + replacements = { + {"group:food_mortar_pestle", "farming:mortar_pestle"}, + {"farming:glass_water", "vessels:drinking_glass"} + } +}) diff --git a/mods/farming/grass.lua b/mods/farming/grass.lua new file mode 100644 index 0000000..a52ace9 --- /dev/null +++ b/mods/farming/grass.lua @@ -0,0 +1,46 @@ + +for i = 4, 5 do + + -- Override default grass and have it drop Wheat and Oat Seeds + + minetest.override_item("default:grass_" .. i, { + drop = { + max_items = 1, + items = { + {items = {"farming:seed_wheat"}, rarity = 5}, + {items = {"farming:seed_oat"},rarity = 5}, + {items = {"default:grass_1"}} + } + } + }) + + -- Override default dry grass and have it drop Barley and Rye Seeds + + if minetest.registered_nodes["default:dry_grass_1"] then + + minetest.override_item("default:dry_grass_" .. i, { + drop = { + max_items = 1, + items = { + {items = {"farming:seed_barley"}, rarity = 5}, + {items = {"farming:seed_rye"},rarity = 5}, + {items = {"default:dry_grass_1"}} + } + } + }) + end + +end + +-- Override default Jungle Grass and have it drop Cotton and Rice Seeds + +minetest.override_item("default:junglegrass", { + drop = { + max_items = 1, + items = { + {items = {"farming:seed_cotton"}, rarity = 8}, + {items = {"farming:rice"},rarity = 8}, + {items = {"default:junglegrass"}} + } + } +}) diff --git a/mods/farming/hoes.lua b/mods/farming/hoes.lua index 5aae390..9340d55 100644 --- a/mods/farming/hoes.lua +++ b/mods/farming/hoes.lua @@ -1,42 +1,514 @@ + +local S = farming.intllib +local tr = minetest.get_modpath("toolranks") + +-- Hoe registration function + +farming.register_hoe = function(name, def) + + -- Check for : prefix (register new hoes in your mod's namespace) + if name:sub(1,1) ~= ":" then + name = ":" .. name + end + + -- Check def table + if def.description == nil then + def.description = S("Hoe") + end + + if def.inventory_image == nil then + def.inventory_image = "unknown_item.png" + end + + if def.max_uses == nil then + def.max_uses = 30 + end + + -- add hoe group + def.groups = def.groups or {} + def.groups.hoe = 1 + + -- Register the tool + minetest.register_tool(name, { + description = def.description, + inventory_image = def.inventory_image, + on_use = function(itemstack, user, pointed_thing) + return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses) + end, + groups = def.groups, + sound = {breaks = "default_tool_breaks"} + }) + + -- Register its recipe + if def.recipe then + minetest.register_craft({ + output = name:sub(2), + recipe = def.recipe + }) + elseif def.material then + minetest.register_craft({ + output = name:sub(2), + recipe = { + {def.material, def.material, ""}, + {"", "group:stick", ""}, + {"", "group:stick", ""} + } + }) + end +end + +-- Turns dirt with group soil=1 into soil + +function farming.hoe_on_use(itemstack, user, pointed_thing, uses) + + local pt = pointed_thing + + -- am I going to hoe the top of a dirt node? + if not pt or pt.type ~= "node" + or pt.above.y ~= pt.under.y + 1 then + return + end + + local under = minetest.get_node(pt.under) + local upos = pointed_thing.under + + if minetest.is_protected(upos, user:get_player_name()) then + minetest.record_protection_violation(upos, user:get_player_name()) + return + end + + local p = {x = pt.under.x, y = pt.under.y + 1, z = pt.under.z} + local above = minetest.get_node(p) + + -- return if any of the nodes is not registered + if not minetest.registered_nodes[under.name] + or not minetest.registered_nodes[above.name] then + return + end + + -- check if the node above the pointed thing is air + if above.name ~= "air" then + return + end + + -- check if pointing at dirt + if minetest.get_item_group(under.name, "soil") ~= 1 then + return + end + + -- check if (wet) soil defined + local ndef = minetest.registered_nodes[under.name] + if ndef.soil == nil or ndef.soil.wet == nil or ndef.soil.dry == nil then + return + end + + if minetest.is_protected(pt.under, user:get_player_name()) then + minetest.record_protection_violation(pt.under, user:get_player_name()) + return + end + + -- turn the node into soil, wear out item and play sound + minetest.set_node(pt.under, {name = ndef.soil.dry}) + + minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5}) + + local wdef = itemstack:get_definition() + local wear = 65535 / (uses - 1) + + if farming.is_creative(user:get_player_name()) then + if tr then + wear = 1 + else + wear = 0 + end + end + + if tr then + itemstack = toolranks.new_afteruse(itemstack, user, under, {wear = wear}) + else + itemstack:add_wear(wear) + end + + if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then + minetest.sound_play(wdef.sound.breaks, {pos = pt.above, + gain = 0.5}, true) + end + + return itemstack +end + +-- Define Hoes + farming.register_hoe(":farming:hoe_wood", { - description = "Wooden Hoe", + description = S("Wooden Hoe"), inventory_image = "farming_tool_woodhoe.png", max_uses = 30, - material = "group:wood", - groups = {flammable = 2}, + material = "group:wood" +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:hoe_wood", + burntime = 5 }) farming.register_hoe(":farming:hoe_stone", { - description = "Stone Hoe", + description = S("Stone Hoe"), inventory_image = "farming_tool_stonehoe.png", max_uses = 90, material = "group:stone" }) farming.register_hoe(":farming:hoe_steel", { - description = "Steel Hoe", + description = S("Steel Hoe"), inventory_image = "farming_tool_steelhoe.png", max_uses = 200, material = "default:steel_ingot" }) farming.register_hoe(":farming:hoe_bronze", { - description = "Bronze Hoe", + description = S("Bronze Hoe"), inventory_image = "farming_tool_bronzehoe.png", - max_uses = 220, - material = "default:bronze_ingot" + max_uses = 500, + groups = {not_in_creative_inventory = 1} }) farming.register_hoe(":farming:hoe_mese", { - description = "Mese Hoe", + description = S("Mese Hoe"), inventory_image = "farming_tool_mesehoe.png", max_uses = 350, - material = "default:mese_crystal" + groups = {not_in_creative_inventory = 1}, }) farming.register_hoe(":farming:hoe_diamond", { - description = "Diamond Hoe", + description = S("Diamond Hoe"), inventory_image = "farming_tool_diamondhoe.png", max_uses = 500, - material = "default:diamond" + groups = {not_in_creative_inventory = 1} }) + +-- Toolranks support +if tr then + +minetest.override_item("farming:hoe_wood", { + original_description = "Wood Hoe", + description = toolranks.create_description("Wood Hoe")}) + +minetest.override_item("farming:hoe_stone", { + original_description = "Stone Hoe", + description = toolranks.create_description("Stone Hoe")}) + +minetest.override_item("farming:hoe_steel", { + original_description = "Steel Hoe", + description = toolranks.create_description("Steel Hoe")}) + +minetest.override_item("farming:hoe_bronze", { + original_description = "Bronze Hoe", + description = toolranks.create_description("Bronze Hoe")}) + +minetest.override_item("farming:hoe_mese", { + original_description = "Mese Hoe", + description = toolranks.create_description("Mese Hoe")}) + +minetest.override_item("farming:hoe_diamond", { + original_description = "Diamond Hoe", + description = toolranks.create_description("Diamond Hoe")}) +end + + +-- hoe bomb function +local function hoe_area(pos, player) + + -- check for protection + if minetest.is_protected(pos, player:get_player_name()) then + minetest.record_protection_violation(pos, player:get_player_name()) + return + end + + local r = 5 -- radius + + -- remove flora (grass, flowers etc.) + local res = minetest.find_nodes_in_area( + {x = pos.x - r, y = pos.y - 1, z = pos.z - r}, + {x = pos.x + r, y = pos.y + 2, z = pos.z + r}, + {"group:flora"}) + + for n = 1, #res do + minetest.swap_node(res[n], {name = "air"}) + end + + -- replace dirt with tilled soil + res = nil + res = minetest.find_nodes_in_area_under_air( + {x = pos.x - r, y = pos.y - 1, z = pos.z - r}, + {x = pos.x + r, y = pos.y + 2, z = pos.z + r}, + {"group:soil"}) + + for n = 1, #res do + minetest.swap_node(res[n], {name = "farming:soil"}) + end +end + + +-- throwable hoe bomb +minetest.register_entity("farming:hoebomb_entity", { + physical = true, + visual = "sprite", + visual_size = {x = 1.0, y = 1.0}, + textures = {"farming_hoe_bomb.png"}, + collisionbox = {-0.1,-0.1,-0.1,0.1,0.1,0.1}, + lastpos = {}, + player = "", + + on_step = function(self, dtime) + + if not self.player then + + self.object:remove() + + return + end + + local pos = self.object:get_pos() + + if self.lastpos.x ~= nil then + + local vel = self.object:getvelocity() + + -- only when potion hits something physical + if vel.x == 0 + or vel.y == 0 + or vel.z == 0 then + + if self.player ~= "" then + + -- round up coords to fix glitching through doors + self.lastpos = vector.round(self.lastpos) + + hoe_area(self.lastpos, self.player) + end + + self.object:remove() + + return + + end + end + + self.lastpos = pos + end +}) + + +-- actual throwing function +local function throw_potion(itemstack, player) + + local playerpos = player:get_pos() + + local obj = minetest.add_entity({ + x = playerpos.x, + y = playerpos.y + 1.5, + z = playerpos.z + }, "farming:hoebomb_entity") + + local dir = player:get_look_dir() + local velocity = 20 + + obj:setvelocity({ + x = dir.x * velocity, + y = dir.y * velocity, + z = dir.z * velocity + }) + + obj:setacceleration({ + x = dir.x * -3, + y = -9.5, + z = dir.z * -3 + }) + + obj:get_luaentity().player = player +end + + +-- hoe bomb item +minetest.register_craftitem("farming:hoe_bomb", { + description = S("Hoe Bomb (use or throw on grassy areas to hoe land)"), + inventory_image = "farming_hoe_bomb.png", + groups = {flammable = 2, not_in_creative_inventory = 1}, + on_use = function(itemstack, user, pointed_thing) + + if pointed_thing.type == "node" then + hoe_area(pointed_thing.above, user) + else + throw_potion(itemstack, user) + + if not farming.is_creative(user:get_player_name()) then + + itemstack:take_item() + + return itemstack + end + end + end, +}) + +-- Mithril Scythe (special item) + +farming.scythe_not_drops = {"farming:trellis", "farming:beanpole"} + +farming.add_to_scythe_not_drops = function(item) + table.insert(farming.scythe_not_drops, item) +end + +minetest.register_tool("farming:scythe_mithril", { + description = S("Mithril Scythe (Use to harvest and replant crops)"), + inventory_image = "farming_scythe_mithril.png", + sound = {breaks = "default_tool_breaks"}, + + on_use = function(itemstack, placer, pointed_thing) + + if pointed_thing.type ~= "node" then + return + end + + local pos = pointed_thing.under + local name = placer:get_player_name() + + if minetest.is_protected(pos, name) then + return + end + + local node = minetest.get_node_or_nil(pos) + + if not node then + return + end + + local def = minetest.registered_nodes[node.name] + + if not def then + return + end + + if not def.drop then + return + end + + if not def.groups + or not def.groups.plant then + return + end + + local drops = minetest.get_node_drops(node.name, "") + + if not drops + or #drops == 0 + or (#drops == 1 and drops[1] == "") then + return + end + + -- get crop name + local mname = node.name:split(":")[1] + local pname = node.name:split(":")[2] + local sname = tonumber(pname:split("_")[2]) + pname = pname:split("_")[1] + + if not sname then + return + end + + -- add dropped items + for _, dropped_item in pairs(drops) do + + -- dont drop items on this list + for _, not_item in pairs(farming.scythe_not_drops) do + + if dropped_item == not_item then + dropped_item = nil + end + end + + if dropped_item then + + local obj = minetest.add_item(pos, dropped_item) + + if obj then + + obj:set_velocity({ + x = math.random(-10, 10) / 9, + y = 3, + z = math.random(-10, 10) / 9 + }) + end + end + end + + -- Run script hook + for _, callback in pairs(core.registered_on_dignodes) do + callback(pos, node, placer) + end + + -- play sound + minetest.sound_play("default_grass_footstep", {pos = pos, gain = 1.0}) + + local replace = mname .. ":" .. pname .. "_1" + + if minetest.registered_nodes[replace] then + + local p2 = minetest.registered_nodes[replace].place_param2 or 1 + + minetest.set_node(pos, {name = replace, param2 = p2}) + else + minetest.set_node(pos, {name = "air"}) + end + + if not farming.is_creative(name) then + + itemstack:add_wear(65535 / 150) -- 150 uses + + return itemstack + end + end, +}) + +if minetest.get_modpath("moreores") then + + minetest.register_craft({ + output = "farming:scythe_mithril", + recipe = { + {"", "moreores:mithril_ingot", "moreores:mithril_ingot"}, + {"moreores:mithril_ingot", "", "group:stick"}, + {"", "", "group:stick"} + } + }) +--[[ + farming.register_hoe(":moreores:hoe_silver", { + description = S("%s Hoe"):format(S("Silver")), + inventory_image = "moreores_tool_silverhoe.png", + max_uses = 300, + material = "moreores:silver_ingot" + }) + + farming.register_hoe(":moreores:hoe_mithril", { + description = S("%s Hoe"):format(S("Mithril")), + inventory_image = "moreores_tool_mithrilhoe.png", + max_uses = 1000, + material = "moreores:mithril_ingot" + }) + + -- Toolranks support + if tr then + + local desc = S("%s Hoe"):format(S("Silver")) + + minetest.override_item("moreores:hoe_silver", { + original_description = desc, + description = toolranks.create_description(desc)}) + + desc = S("%s Hoe"):format(S("Mithril")) + + minetest.override_item("moreores:hoe_mithril", { + original_description = desc, + description = toolranks.create_description(desc)}) + end]] +end diff --git a/mods/farming/init.lua b/mods/farming/init.lua index fff48fa..fddbc59 100644 --- a/mods/farming/init.lua +++ b/mods/farming/init.lua @@ -1,139 +1,736 @@ --- Global farming namespace +--[[ + Farming Redo Mod + by TenPlus1 + NEW growing routine by prestidigitator + auto-refill by crabman77 +]] -farming = {} -farming.path = minetest.get_modpath("farming") +farming = { + mod = "redo", + version = "20211204", + path = minetest.get_modpath("farming"), + select = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5} + }, + registered_plants = {}, + min_light = 12, + max_light = 15 +} --- Load files +local creative_mode_cache = minetest.settings:get_bool("creative_mode") -dofile(farming.path .. "/api.lua") -dofile(farming.path .. "/nodes.lua") -dofile(farming.path .. "/hoes.lua") +function farming.is_creative(name) + return creative_mode_cache or minetest.check_player_privs(name, {creative = true}) +end --- WHEAT +local statistics = dofile(farming.path .. "/statistics.lua") -farming.register_plant("farming:wheat", { - description = "Wheat Seed", - paramtype2 = "meshoptions", - inventory_image = "farming_wheat_seed.png", - steps = 8, - minlight = 13, - maxlight = default.LIGHT_MAX, - fertility = {"grassland"}, - groups = {flammable = 4}, - place_param2 = 3, -}) +-- Intllib +local S +if minetest.get_translator ~= nil then + S = minetest.get_translator("farming") -- 5.x translation function +else + if minetest.get_modpath("intllib") then + dofile(minetest.get_modpath("intllib") .. "/init.lua") + if intllib.make_gettext_pair then + gettext, ngettext = intllib.make_gettext_pair() -- new gettext method + else + gettext = intllib.Getter() -- old text file method + end + S = gettext + else -- boilerplate function + S = function(str, ...) + local args = {...} + return str:gsub("@%d+", function(match) + return args[tonumber(match:sub(2))] + end) + end + end +end -minetest.register_craftitem("farming:flour", { - description = "Flour", - inventory_image = "farming_flour.png", - groups = {flammable = 1}, -}) +farming.intllib = S -minetest.register_craftitem("farming:bread", { - description = "Bread", - inventory_image = "farming_bread.png", - on_use = minetest.item_eat(5), - groups = {flammable = 2}, -}) -minetest.register_craft({ - type = "shapeless", - output = "farming:flour", - recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"} -}) +-- Utility Function +local time_speed = tonumber(minetest.settings: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 -minetest.register_craft({ - type = "cooking", - cooktime = 15, - output = "farming:bread", - recipe = "farming:flour" + +-- 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) + + if count_day then + + if t_day < 0.25 then + t1_c = t1_day + 0.75 -- Relative to sunup, yesterday + t2_c = t_day + 0.75 + else + t1_c = t1_day - 0.25 -- Relative to sunup, today + t2_c = t_day - 0.25 + end + else + if t_day < 0.75 then + t1_c = t1_day + 0.25 -- Relative to sundown, yesterday + t2_c = t_day + 0.25 + else + t1_c = t1_day - 0.75 -- Relative to sundown, today + t2_c = t_day - 0.75 + end + end + + local dt_c = clamp(t2_c, 0, 0.5) - clamp(t1_c, 0, 0.5) -- this cycle + + if t1_c < -0.5 then + local nc = math.floor(-t1_c) + t1_c = t1_c + nc + dt_c = dt_c + 0.5 * nc + clamp(-t1_c - 0.5, 0, 0.5) + end + + return dt_c * SECS_PER_CYCLE +end + + +-- Growth Logic +local STAGE_LENGTH_AVG = tonumber( + minetest.settings:get("farming_stage_length")) or 200 -- 160 +local STAGE_LENGTH_DEV = STAGE_LENGTH_AVG / 6 + + +-- return plant name and stage from node provided +local function plant_name_stage(node) + + local name + + if type(node) == "table" then + + if node.name then + name = node.name + elseif node.x and node.y and node.z then + node = minetest.get_node_or_nil(node) + name = node and node.name + end + else + name = tostring(node) + end + + if not name or name == "ignore" then + return nil + end + + local sep_pos = name:find("_[^_]+$") + + if sep_pos and sep_pos > 1 then + + local stage = tonumber(name:sub(sep_pos + 1)) + + if stage and stage >= 0 then + return name:sub(1, sep_pos - 1), stage + end + end + + return name, 0 +end + + +-- Map from node name to +-- { plant_name = ..., name = ..., stage = n, stages_left = { node_name, ... } } + +local plant_stages = {} + +farming.plant_stages = plant_stages + +--- Registers the stages of growth of a (possible plant) node. + -- + -- @param node + -- Node or position table, or node name. + -- @return + -- The (possibly zero) number of stages of growth the plant will go through + -- before being fully grown, or nil if not a plant. + +local register_plant_node + +-- Recursive helper +local function reg_plant_stages(plant_name, stage, force_last) + + local node_name = plant_name and plant_name .. "_" .. stage + local node_def = node_name and minetest.registered_nodes[node_name] + + if not node_def then + return nil + end + + local stages = plant_stages[node_name] + + if stages then + return stages + end + + if minetest.get_item_group(node_name, "growing") > 0 then + + local ns = reg_plant_stages(plant_name, stage + 1, true) + local stages_left = (ns and { ns.name, unpack(ns.stages_left) }) or {} + + stages = { + plant_name = plant_name, + name = node_name, + stage = stage, + stages_left = stages_left + } + + if #stages_left > 0 then + + local old_constr = node_def.on_construct + local old_destr = node_def.on_destruct + + minetest.override_item(node_name, + { + on_construct = function(pos) + + if old_constr then + old_constr(pos) + end + + farming.handle_growth(pos) + end, + + on_destruct = function(pos) + + minetest.get_node_timer(pos):stop() + + if old_destr then + old_destr(pos) + end + end, + + on_timer = function(pos, elapsed) + return farming.plant_growth_timer(pos, elapsed, node_name) + end, + }) + end + + elseif force_last then + + stages = { + plant_name = plant_name, + name = node_name, + stage = stage, + stages_left = {} + } + else + return nil + end + + plant_stages[node_name] = stages + + return stages +end + + +local register_plant_node = function(node) + + local plant_name, stage = plant_name_stage(node) + + if plant_name then + + local stages = reg_plant_stages(plant_name, stage, false) + return stages and #stages.stages_left + else + return nil + end +end + + +local function set_growing(pos, stages_left) + + if not stages_left then + return + end + + local timer = minetest.get_node_timer(pos) + + if stages_left > 0 then + + if not timer:is_started() then + + local stage_length = statistics.normal(STAGE_LENGTH_AVG, STAGE_LENGTH_DEV) + + stage_length = clamp(stage_length, 0.5 * STAGE_LENGTH_AVG, 3.0 * STAGE_LENGTH_AVG) + + timer:set(stage_length, -0.5 * math.random() * STAGE_LENGTH_AVG) + end + + elseif timer:is_started() then + timer:stop() + end +end + + +-- detects a crop at given position, starting or stopping growth timer when needed +function farming.handle_growth(pos, node) + + if not pos then + return + end + + local stages_left = register_plant_node(node or pos) + + if stages_left then + set_growing(pos, stages_left) + end +end + + +minetest.after(0, function() + + for _, node_def in pairs(minetest.registered_nodes) do + register_plant_node(node_def) + end +end) + + +-- 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, + chance = 1, + catch_up = false, + action = function(pos, node) + farming.handle_growth(pos, node) + end }) --- Cotton +-- Plant timer function that grows plants under the right conditions. +function farming.plant_growth_timer(pos, elapsed, node_name) -farming.register_plant("farming:cotton", { - description = "Cotton Seed", - inventory_image = "farming_cotton_seed.png", - steps = 8, - minlight = 13, - maxlight = default.LIGHT_MAX, - fertility = {"grassland", "desert"}, - groups = {flammable = 4}, -}) + local stages = plant_stages[node_name] -minetest.register_craftitem("farming:string", { - description = "String", - inventory_image = "farming_string.png", - groups = {flammable = 2}, -}) + if not stages then + return false + end -minetest.register_craft({ - output = "wool:white", - recipe = { - {"farming:cotton", "farming:cotton"}, - {"farming:cotton", "farming:cotton"}, - } -}) + local max_growth = #stages.stages_left -minetest.register_craft({ - output = "farming:string 2", - recipe = { - {"farming:cotton"}, - {"farming:cotton"}, - } -}) + if max_growth <= 0 then + return false + end + + -- custom growth check + local chk = minetest.registered_nodes[node_name].growth_check + + if chk then + + if chk(pos, node_name) then + return true + end + + -- otherwise check for wet soil beneath crop + else + local under = minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}) + + if minetest.get_item_group(under.name, "soil") < 3 then + return true + end + end + + local growth + local light_pos = {x = pos.x, y = pos.y, z = pos.z} + local lambda = elapsed / STAGE_LENGTH_AVG + + if lambda < 0.1 then + return true + end + + local MIN_LIGHT = minetest.registered_nodes[node_name].minlight or farming.min_light + local MAX_LIGHT = minetest.registered_nodes[node_name].maxlight or farming.max_light + + if max_growth == 1 or lambda < 2.0 then + + local light = (minetest.get_node_light(light_pos) or 0) + + if light < MIN_LIGHT or light > MAX_LIGHT then + return true + end + + growth = 1 + 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 = 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 + + if not day_growth then + return true + end + + lambda = day_or_night_time(elapsed, true) / STAGE_LENGTH_AVG + + elseif not day_growth then + + lambda = day_or_night_time(elapsed, false) / STAGE_LENGTH_AVG + end + + growth = statistics.poisson(lambda, max_growth) + + if growth < 1 then + return true + end + end + + if minetest.registered_nodes[stages.stages_left[growth]] then + + 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 + + return growth ~= max_growth +end --- Straw +-- refill placed plant by crabman (26/08/2015) updated by TenPlus1 +function farming.refill_plant(player, plantname, index) -minetest.register_craft({ - output = "farming:straw 3", - recipe = { - {"farming:wheat", "farming:wheat", "farming:wheat"}, - {"farming:wheat", "farming:wheat", "farming:wheat"}, - {"farming:wheat", "farming:wheat", "farming:wheat"}, - } -}) + local inv = player:get_inventory() + local old_stack = inv:get_stack("main", index) -minetest.register_craft({ - output = "farming:wheat 3", - recipe = { - {"farming:straw"}, - } -}) + if old_stack:get_name() ~= "" then + return + end + + for i, stack in ipairs(inv:get_list("main")) do + + if stack:get_name() == plantname and i ~= index then + + inv:set_stack("main", index, stack) + stack:clear() + inv:set_stack("main", i, stack) + + return + end + end +end --- Fuels +-- Place Seeds on Soil +function farming.place_seed(itemstack, placer, pointed_thing, plantname) -minetest.register_craft({ - type = "fuel", - recipe = "farming:straw", - burntime = 3, -}) + local pt = pointed_thing -minetest.register_craft({ - type = "fuel", - recipe = "farming:wheat", - burntime = 1, -}) + -- check if pointing at a node + if not pt or pt.type ~= "node" then + return + end -minetest.register_craft({ - type = "fuel", - recipe = "farming:cotton", - burntime = 1, -}) + local under = minetest.get_node(pt.under) -minetest.register_craft({ - type = "fuel", - recipe = "farming:string", - burntime = 1, -}) + -- am I right-clicking on something that has a custom on_place set? + -- thanks to Krock for helping with this issue :) + local def = minetest.registered_nodes[under.name] + if placer and itemstack and def and def.on_rightclick then + return def.on_rightclick(pt.under, under, placer, itemstack, pt) + end -minetest.register_craft({ - type = "fuel", - recipe = "farming:hoe_wood", - burntime = 5, -}) + local above = minetest.get_node(pt.above) + + -- check if pointing at the top of the node + if pt.above.y ~= pt.under.y + 1 then + return + end + + -- return if any of the nodes is not registered + if not minetest.registered_nodes[under.name] + or not minetest.registered_nodes[above.name] then + return + end + + -- can I replace above node, and am I pointing at soil + if not minetest.registered_nodes[above.name].buildable_to + or minetest.get_item_group(under.name, "soil") < 2 + -- avoid multiple seed placement bug + or minetest.get_item_group(above.name, "plant") ~= 0 then + return + end + + -- is player planting seed? + local name = placer and placer:get_player_name() or "" + + -- if not protected then add node and remove 1 item from the itemstack + if not minetest.is_protected(pt.above, name) then + + local p2 = minetest.registered_nodes[plantname].place_param2 or 1 + + minetest.set_node(pt.above, {name = plantname, param2 = p2}) + +--minetest.get_node_timer(pt.above):start(1) +--farming.handle_growth(pt.above)--, node) + + minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0}) + + if placer and itemstack + and 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 then + + minetest.after(0.10, + farming.refill_plant, + placer, + name, + placer:get_wield_index() + ) + end + end + + return itemstack + end +end + + +-- Function to register plants (default farming compatibility) +farming.register_plant = function(name, def) + + 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 12 + def.maxlight = def.maxlight or 15 + + -- Register seed + minetest.register_node(":" .. mname .. ":seed_" .. pname, { + + description = def.description, + tiles = {def.inventory_image}, + inventory_image = def.inventory_image, + wield_image = def.inventory_image, + drawtype = "signlike", + groups = {seed = 1, snappy = 3, attached_node = 1, flammable = 2}, + paramtype = "light", + paramtype2 = "wallmounted", + 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, + pointed_thing, mname .. ":" .. pname .. "_1") + end, + }) + + -- Register harvest + minetest.register_craftitem(":" .. mname .. ":" .. pname, { + description = pname:gsub("^%l", string.upper), + inventory_image = mname .. "_" .. pname .. ".png", + groups = def.groups or {flammable = 2}, + }) + + -- Register growing steps + for i = 1, def.steps do + + local base_rarity = 1 + if def.steps ~= 1 then + base_rarity = 8 - (i - 1) * 7 / (def.steps - 1) + end + local drop = { + items = { + {items = {mname .. ":" .. pname}, rarity = base_rarity}, + {items = {mname .. ":" .. pname}, rarity = base_rarity * 2}, + {items = {mname .. ":seed_" .. pname}, rarity = base_rarity}, + {items = {mname .. ":seed_" .. pname}, rarity = base_rarity * 2}, + } + } + + 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 + g.growing = 0 + end + + 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, + place_param2 = def.place_param2, + walkable = false, + buildable_to = true, + sunlight_propagates = 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 + }) + end + +-- add to farming.registered_plants +farming.registered_plants[mname .. ":" .. pname] = { + crop = mname .. ":" .. pname, + seed = mname .. ":seed_" .. pname, + steps = def.steps, + minlight = def.minlight, + maxlight = def.maxlight +} +--print(dump(farming.registered_plants[mname .. ":" .. pname])) + -- Return info + return {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname} +end + + +-- default settings +farming.carrot = 0.001 +farming.potato = 0.001 +farming.tomato = 0.001 +farming.cucumber = 0.001 +farming.corn = 0.001 +farming.coffee = 0.001 +farming.melon = 0.001 +farming.pumpkin = 0.001 +farming.cocoa = true +farming.raspberry = 0.001 +farming.blueberry = 0.001 +farming.rhubarb = 0.001 +farming.beans = 0.001 +farming.grapes = 0.001 +farming.barley = true +farming.chili = 0.003 +farming.hemp = 0.003 +farming.garlic = 0.001 +farming.onion = 0.001 +farming.pepper = 0.002 +farming.pineapple = 0.001 +farming.peas = 0.001 +farming.beetroot = 0.001 +farming.mint = 0.005 +farming.cabbage = 0.001 +farming.blackberry = 0.002 +farming.soy = 0.001 +farming.vanilla = 0.001 +farming.lettuce = 0.001 +farming.artichoke = 0.001 +farming.parsley = 0.002 +farming.sunflower = 0.001 +farming.grains = true +farming.rice = true +farming.rarety = 0.002 + + +-- Load new global settings if found inside mod folder +local input = io.open(farming.path.."/farming.conf", "r") +if input then + dofile(farming.path .. "/farming.conf") + input:close() +end + +-- load new world-specific settings if found inside world folder +local worldpath = minetest.get_worldpath() +input = io.open(worldpath.."/farming.conf", "r") +if input then + dofile(worldpath .. "/farming.conf") + input:close() +end + + +-- important items +dofile(farming.path.."/soil.lua") +dofile(farming.path.."/hoes.lua") +dofile(farming.path.."/grass.lua") +dofile(farming.path.."/utensils.lua") + +-- default crops +dofile(farming.path.."/crops/wheat.lua") +dofile(farming.path.."/crops/cotton.lua") + + +-- helper function +local function ddoo(file, check) + + if check then + dofile(farming.path .. "/crops/" .. file) + end +end + +-- add additional crops and food (if enabled) +ddoo("carrot.lua", farming.carrot) +ddoo("potato.lua", farming.potato) +ddoo("tomato.lua", farming.tomato) +ddoo("cucumber.lua", farming.cucumber) +ddoo("corn.lua", farming.corn) +ddoo("coffee.lua", farming.coffee) +ddoo("melon.lua", farming.melon) +ddoo("pumpkin.lua", farming.pumpkin) +ddoo("cocoa.lua", farming.cocoa) +ddoo("raspberry.lua", farming.raspberry) +ddoo("blueberry.lua", farming.blueberry) +ddoo("rhubarb.lua", farming.rhubarb) +ddoo("beans.lua", farming.beans) +ddoo("grapes.lua", farming.grapes) +ddoo("barley.lua", farming.barley) +ddoo("hemp.lua", farming.hemp) +ddoo("garlic.lua", farming.garlic) +ddoo("onion.lua", farming.onion) +ddoo("pepper.lua", farming.pepper) +ddoo("pineapple.lua", farming.pineapple) +ddoo("peas.lua", farming.peas) +ddoo("beetroot.lua", farming.beetroot) +ddoo("chili.lua", farming.chili) +ddoo("ryeoatrice.lua", farming.grains) +ddoo("rice.lua", farming.rice) +ddoo("mint.lua", farming.mint) +ddoo("cabbage.lua", farming.cabbage) +ddoo("blackberry.lua", farming.blackberry) +ddoo("soy.lua", farming.soy) +ddoo("vanilla.lua", farming.vanilla) +ddoo("lettuce.lua", farming.lettuce) +ddoo("artichoke.lua", farming.artichoke) +ddoo("parsley.lua", farming.parsley) +ddoo("sunflower.lua", farming.sunflower) + +dofile(farming.path .. "/food.lua") +dofile(farming.path .. "/mapgen.lua") +dofile(farming.path .. "/compatibility.lua") -- Farming Plus compatibility +dofile(farming.path .. "/lucky_block.lua") diff --git a/mods/farming/license.txt b/mods/farming/license.txt index 8cbb63a..961a49f 100644 --- a/mods/farming/license.txt +++ b/mods/farming/license.txt @@ -1,61 +1,182 @@ -License of source code ----------------------- - The MIT License (MIT) -Copyright (C) 2012-2016 PilzAdam -Copyright (C) 2014-2016 webdesigner97 -Copyright (C) 2012-2016 Various Minetest developers and contributors -Permission is hereby granted, free of charge, to any person obtaining a copy of this -software and associated documentation files (the "Software"), to deal in the Software -without restriction, including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following conditions: +Copyright (c) 2016 TenPlus1 -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -For more details: -https://opensource.org/licenses/MIT +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. -License of media (textures) ---------------------------- +License of media (textures): +---------------------------- +Created by PilzAdam (License: CC BY 3.0): + farming_bread.png + farming_soil.png + farming_soil_wet.png + farming_soil_wet_side.png + farming_string.png -Attribution 3.0 Unported (CC BY 3.0) -Copyright (C) 2012-2016 PilzAdam -Copyright (C) 2014-2016 BlockMen -Copyright (C) 2015-2016 MasterGollum -Copyright (C) 2015-2016 Gambit +Created by Napiophelios (CC BY-SA 3.0): + farming_cotton.png -You are free to: -Share — copy and redistribute the material in any medium or format. -Adapt — remix, transform, and build upon the material for any purpose, even commercially. -The licensor cannot revoke these freedoms as long as you follow the license terms. +Created by Calinou (License: CC BY-SA): + farming_tool_bronzehoe.png + farming_tool_steelhoe.png + farming_tool_stonehoe.png + farming_tool_woodhoe.png + farming_tool_mesehoe.png + farming_tool_diamondhoe.png -Under the following terms: +Created by VanessaE (License: CC BY 3.0): + farming_cotton_seed.png + farming_wheat_seed.png + farming_flour.png + farming_wheat.png + farming_wheat_1.png + farming_wheat_2.png + farming_wheat_3.png + farming_wheat_4.png + farming_wheat_5.png + farming_wheat_5.png + farming_wheat_7.png + farming_wheat_8.png + farming_cotton_1.png + farming_cotton_2.png + farming_cotton_3.png + farming_cotton_4.png + farming_cotton_5.png + farming_cotton_6.png + farming_cotton_7.png + farming_cotton_8.png -Attribution — You must give appropriate credit, provide a link to the license, and -indicate if changes were made. You may do so in any reasonable manner, but not in any way -that suggests the licensor endorses you or your use. +Created by 7eventy7 (https://www.planetminecraft.com/member/7eventy7/) + farming_melon_top.png + farming_melon_side.png + farming_melon_bottom.png -No additional restrictions — You may not apply legal terms or technological measures that -legally restrict others from doing anything the license permits. +Created by Doc (License: CC BY 3.0): + farming_cucumber.png + farming_cucumber_1.png + farming_cucumber_2.png + farming_cucumber_3.png + farming_cucumber_4.png + farming_potato.png + farming_potato_1.png + farming_potato_2.png + farming_potato_3.png + farming_potato_4.png + farming_raspberries.png + farming_raspberry_1.png + farming_raspberry_2.png + farming_raspberry_3.png + farming_raspberry_4.png -Notices: +Created by Gambit (License: CC BY 3.0): + default_junglegrass.png + farming_carrot.png + farming_carrot_1.png + farming_carrot_2.png + farming_carrot_3.png + farming_carrot_4.png + farming_carrot_5.png + farming_carrot_6.png + farming_carrot_7.png + farming_carrot_8.png -You do not have to comply with the license for elements of the material in the public -domain or where your use is permitted by an applicable exception or limitation. -No warranties are given. The license may not give you all of the permissions necessary -for your intended use. For example, other rights such as publicity, privacy, or moral -rights may limit how you use the material. +Created by JoseTheCrafter and edited by TenPlus1 (CC BY 3.0): + farming_tomato.png + farming_tomato_1.png + farming_tomato_2.png + farming_tomato_3.png + farming_tomato_4.png + farming_tomato_5.png + farming_tomato_6.png + farming_tomato_7.png + farming_tomato_8.png -For more details: -http://creativecommons.org/licenses/by/3.0/ +Created by GeMinecraft and edited by TenPlus1 (CC BY 3.0): + farming_corn.png + farming_corn_cob.png + farming_corn_1.png + farming_corn_2.png + farming_corn_3.png + farming_corn_4.png + farming_corn_5.png + farming_corn_6.png + farming_corn_7.png + farming_corn_8.png + +Created by TenPlus1 (CC BY 3.0) + farming_cocoa_1.png + farming_cocoa_2.png + farming_cocoa_3.png + farming_cocoa_beans.png + farming_cookie.png + farming_raspberry_smoothie.png + farming_rhubarb_1.png + farming_rhubarb_2.png + farming_rhubarb_3.png + farming_rhubarb.png + farming_rhubarb_pie.png + farming_hemp*.png + farming_tofu*.png + +Created by ademant (CC-BY-3.0) + farming_rye*.png + farming_oat*.png + farming_rice*.png + +Created by PilzAdam and edited by SpaghettiToastBook (CC0): + farming_bread_multigrain.png + +Created by VanessaE and edited by SpaghettiToastBook (CC0): + farming_flour_multigrain.png + +Created by mDiyo (Natura), modified by TenPlus1 (License: CC BY-SA 3.0): + farming_barley.png + +Created by OgelGames (CC BY-SA 4.0) + farming_berry_smoothie.png + farming_cactus_juice.png + farming_salad.png + +Created by Felfa (CC0) + farming_blackberry*.png + farming_lettuce*.png + farming_burger.png + farming_soy*.png + farming_vanilla*.png + farming_artichoke*.png + farming_parsley*.png + farming_paella.png + farming_potato_omelette.png + farming_spanish_potatoes.png + farming_vanilla_flan.png + farming_sunflower*.png + +Created by gorlock (CC0) + farming_salt_crystal.png + +Created by sirrobzeroone (CC0) + farming_gyoza.png + farming_pineapple_ring.png + +Created by TechM8 (https://www.deviantart.com/techm8) + farming_popcorn.png + +Created by RZR0 (CC-BY-NC-SA) + farming_blueberry_pie.png diff --git a/mods/farming/locale/de.txt b/mods/farming/locale/de.txt new file mode 100644 index 0000000..a18f79e --- /dev/null +++ b/mods/farming/locale/de.txt @@ -0,0 +1,195 @@ +# German translation of the farming mod by TenPlus1 +# textdomain: farming +# author: Xanthin +# author: TheDarkTiger +# last update: 2020/Apr/26 + +###### folder . ###### + +### init.lua ### +Seed=Saatgut + +### compatibility.lua ### +Banana= +Banana Leaves= +Orange= +Strawberry= + +### food.lua ### +Sugar=Zucker +Salt= +Rose Water= +Turkish Delight= +Garlic Bread= +Donut=Donut +Chocolate Donut=Schokodonut +Apple Donut=Apfeldonut +Porridge= +Jaffa Cake= + +### hoes.lua ### +Hoe=Hacke +Wooden Hoe=Holzhacke +Stone Hoe=Steinhacke +Steel Hoe=Stahlhacke +Bronze Hoe=Bronzehacke +Mese Hoe=Mesehacke +Diamond Hoe=Diamanthacke +# Surcharge du mod [Toolranks] à faire # +Hoe Bomb (use or throw on grassy areas to hoe land)= +Mithril Scythe (Right-click to harvest and replant crops)= +# Surcharge du mod [Toolranks] à faire # + +### soil.lua ### +Soil=Ackerboden +Wet Soil=Bewässerter Ackerboden + +### utensils.lua ### +Wooden Bowl= +Saucepan= +Cooking Pot= +Baking Tray= +Skillet= +Mortar and Pestle= +Cutting Board= +Juicer= +Glass Mixing Bowl= + + +###### folder ./crops ###### + +### barley.lua ### +Barley Seed=Gerstenkörner +Barley=Gerste + +### beans.lua ### +Green Beans=Grüne Bohnen +Bean Pole (place on soil before planting beans)=Bohnenstange (vor dem Pflanzen der Bohnen auf den\nAckerboden stellen) + +### beetroot.lua ### +Beetroot= +Beetroot Soup= + +### blueberry.lua ### +Blueberries=Blaubeeren +Blueberry Muffin=Blaubeermuffin +Blueberry Pie= + +### carrot.lua ## +Carrot=Möhre +Carrot Juice= +Golden Carrot=Goldene Möhre + +### chili.lua ### +Chili Pepper= +Bowl of Chili= + +### cocoa.lua ### +Cocoa Beans=Kakaobohne +Cookie=Keks +Bar of Dark Chocolate=Tafel Zartbitterschokolade +Chocolate Block= + +### coffee.lua ### +Coffee Beans=Kaffeebohnen +Cup of Coffee=Tasse Kaffee + +### corn.lua ### +Corn=Mais +Corn on the Cob=Maiskolben +Cornstarch= +Bottle of Ethanol=Flasche Ethanol + +### cotton.lua ### +Cotton Seed=Baumwollsamen +Cotton=Baumwolle +String= + +### cucumber.lua ### +Cucumber=Gurke + +### garlic.lua ### +Garlic clove= +Garlic= +Garlic Braid= + +### grapes.lua ### +Grapes=Weintrauben +Trellis (place on soil before planting grapes)=Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen) + +### hemp.lua ### +Hemp Seed=Hanfsamen +Hemp Leaf=Hanfblatt +Bottle of Hemp Oil=Flasche mit Hanföl +Hemp Fibre=Hanffaser +Hemp Block= +Hemp Rope=Hanfseil + +### melon.lua ### +Melon Slice=Melonenscheibe +Melon=Melone + +### onion.lua ### +Onion= + +### peas.lua ### +Pea Pod= +Peas= +Pea Soup= + +### pepper.lua ### +Peppercorn= +Pepper= +Ground Pepper= + +### pinapple.lua ### +Pineapple Top= +Pineapple= +Pineapple Ring= +Pineapple Juice= + +### potato.lua ### +Potato=Kartoffel +Baked Potato=Ofenkartoffel +Cucumber and Potato Salad= + +### pumpkin.lua ### +Pumpkin Slice=Kürbisscheibe +Jack 'O Lantern (punch to turn on and off)=Kürbislaterne (Punch zum Ein- und Ausschalten) +Scarecrow Bottom= +Pumpkin Bread=Kürbisbrot +Pumpkin Dough=Kürbisteig +Pumpkin=Kürbis + +### raspberry.lua ### +Raspberries=Himbeeren +Raspberry Smoothie=Himbeersmoothie + +### rhubarb.lua ### +Rhubarb=Rhabarber +Rhubarb Pie=Rhabarberkuchen + +### ryeoatrice.lua ### +Rye= +Rye seed= +Oat= +Oat seed= +Rice= +Rice grains= +Rice Bread= +Rice Flour= +Multigrain Flour= +Multigrain Bread= + +### tomato.lua ### +Tomato=Tomate + +### wheat.lua ### +Wheat Seed=Weizenkörner +Wheat=Weizen +Straw=Stroh +Flour=Mehl +Bread=Brot +Sliced Bread= +Toast= +Toast Sandwich= diff --git a/mods/farming/locale/es.txt b/mods/farming/locale/es.txt new file mode 100644 index 0000000..185261b --- /dev/null +++ b/mods/farming/locale/es.txt @@ -0,0 +1,194 @@ +# Translation of the farming mod by TenPlus1 +# textdomain: farming +# author: PICCORO Lenz McKAY +# last update: 2022/Feb/16 + +###### folder . ###### + +### init.lua ### +Seed=Semillas + +### compatibility.lua ### +Banana=Banana +Banana Leaves=Hojas de banana +Orange=Naranja +Strawberry=Fresas + +### food.lua ### +Sugar=Azucar +Salt=Sal +Rose Water=Agua de rosa +Turkish Delight=Delicia turca +Garlic Bread=Pan de Ajo +Donut=Dona +Chocolate Donut=Dona de Chocolate +Apple Donut=Dona de Manzana +Porridge=Papilla +Jaffa Cake=Pastel de Jaffa + +### hoes.lua ### +Hoe=Azadon +Wooden Hoe=Azadon de Madera +Stone Hoe=Azadon de Piedra +Steel Hoe=Azadon de Acero +Bronze Hoe=Azadon de Bronze +Mese Hoe=Azadon de Mese +Diamond Hoe=Azadon de Diamante +# Surcharge du mod [Toolranks] à faire # +Hoe Bomb (use or throw on grassy areas to hoe land)=Bomba de azada (usar o arrojar en áreas verdes para cavar tierra) +Mithril Scythe (Right-click to harvest and replant crops)=Guadaña de mithril (clic derecho para cosechar y replantar cultivos) +# Surcharge du mod [Toolranks] à faire # + +### soil.lua ### +Soil=Suelo +Wet Soil=Suelo Seco + +### utensils.lua ### +Wooden Bowl=Cuenco de Madera +Saucepan=Cacerola +Cooking Pot=Olla +Baking Tray=Bandeja Hornear +Skillet=Sarten +Mortar and Pestle=Mortero y Maza +Cutting Board=Tabla de cortar +Juicer=Exprimidor +Glass Mixing Bowl=Tazón de mezcla de vidrio + + +###### folder ./crops ###### + +### barley.lua ### +Barley Seed=Semillas de Cevada +Barley=Cevada + +### beans.lua ### +Green Beans=Frijoles Verdes +Bean Pole (place on soil before planting beans)=Base de frijol (colocar en el suelo antes de plantar frijoles) + +### beetroot.lua ### +Beetroot=Remolacha +Beetroot Soup=Sopa de Remolacha + +### blueberry.lua ### +Blueberries=Arándanos +Blueberry Muffin=Muffin de Arándanos +Blueberry Pie=Pastel de Arándanos + +### carrot.lua ## +Carrot=Zanahoria +Carrot Juice=Jugo de Zanahoria +Golden Carrot=Zanahoria Dorada + +### chili.lua ### +Chili Pepper=Chile o ajies +Bowl of Chili=Tazon de Chile o ajies + +### cocoa.lua ### +Cocoa Beans=Amendras de Cacao +Cookie=Galleta +Bar of Dark Chocolate=Barra de Chocolate Negro +Chocolate Block=Bloque de Chocolate + +### coffee.lua ### +Coffee Beans=Grano de Cafe +Cup of Coffee=Taza de Cafe + +### corn.lua ### +Corn=Maiz +Corn on the Cob=Mazorca de Maiz +Cornstarch=Almidon +Bottle of Ethanol=Garrafa de Etanol + +### cotton.lua ### +Cotton Seed=Sementes de Algodon +Cotton=Algodon +String=Cadena + +### cucumber.lua ### +Cucumber=Pepino + +### garlic.lua ### +Garlic clove=Diente de Ajo +Garlic=Ajo +Garlic Braid=Trenza de Ajo + +### grapes.lua ### +Grapes=Uvas +Trellis (place on soil before planting grapes)=Grade de Ripas (colocar en el suelo antes de plantar las uvas) + +### hemp.lua ### +Hemp Seed=Semilla de Caniamo +Hemp Leaf=Folha de Caniamo +Bottle of Hemp Oil=Garrafa de Aceite de Caniamo +Hemp Fibre=Fibra de Caniamo +Hemp Block=Bloque de Caniamo +Hemp Rope=Corda de Caniamo + +### melon.lua ### +Melon Slice=Rebanada de Melon +Melon=Melon + +### onion.lua ### +Onion=Cebolla + +### peas.lua ### +Pea Pod=Vaina de guisante +Peas=Gisantes +Pea Soup=Sopa de Guisantes + +### pepper.lua ### +Peppercorn=Grano de Pimienta +Pepper=Pimienta +Ground Pepper=Pimienta Molida + +### pinapple.lua ### +Pineapple Top=Tope de Piña +Pineapple=Pinia +Pineapple Ring=Anillo de pinia +Pineapple Juice=Jugo de pinia + +### potato.lua ### +Potato=Batata +Baked Potato=Batata Cocida +Cucumber and Potato Salad=Ensalada de Pepino y Patatas + +### pumpkin.lua ### +Pumpkin Slice=Pedazo de Calabaza +Jack 'O Lantern (punch to turn on and off)=Jack 'O Lantern (golpea para encender o apagar) +Scarecrow Bottom=Espantapajaros abajo +Pumpkin Bread=Pan de Calabaza +Pumpkin Dough=Masa de Calabaza +Pumpkin=Calabaza + +### raspberry.lua ### +Raspberries=Frambuesa +Raspberry Smoothie=Batida de Frambuesa + +### rhubarb.lua ### +Rhubarb=Ruibarbo +Rhubarb Pie=Torta de Ruibarbo + +### ryeoatrice.lua ### +Rye=Centeno +Rye seed=Semilla de centeno +Oat=Avena +Oat seed=Semilla de avena +Rice=Arroz +Rice grains=Granos de arroz +Rice Bread=PAn de arroz +Rice Flour=Harina de arroz +Multigrain Flour=Harina multicereal +Multigrain Bread=Pan multicereal + +### tomato.lua ### +Tomato=Tomate + +### wheat.lua ### +Wheat Seed=Semillas de Trigo +Wheat=Trigo +Straw=Paja +Flour=Harina +Bread=Pan +Sliced Bread=Pan rebanado +Toast=Tostadas +Toast Sandwich=Emparedado de tostadas diff --git a/mods/farming/locale/farming.de.tr b/mods/farming/locale/farming.de.tr new file mode 100644 index 0000000..175990e --- /dev/null +++ b/mods/farming/locale/farming.de.tr @@ -0,0 +1,134 @@ +# textdomain:farming +%s Hoe=%s Hacke +Apple Donut=Apfeldonut +Apple Pie=Apfelkuchen +Baked Potato=Ofenkartoffel +Baking Tray=Kuchenblech +Banana=Banane +Banana Leaves=Bananenblatt +Bar of Dark Chocolate=Tafel Zartbitterschokolade +Barley=Gerste +Barley Seed=Gerstenkörner +Bean Pole (place on soil before planting beans)=Bohnenstange (vor dem Pflanzen der Bohnen auf den\nAckerboden stellen) +Beetroot=Rote Beete +Beetroot Soup=Rote Beete Suppe +Bibimbap=Bibimbap +Wild Blueberries=Wilde Blaubeeren +Blueberry Muffin=Blaubeermuffin +Blueberry Pie=Blaubeerkuchen +Bottle of Ethanol=Flasche Ethanol +Bottle of Hemp Oil=Flasche mit Hanföl +Bowl of Chili=Chili Schale +Bread=Brot +Bronze Hoe=Bronzehacke +Cabbage=Weißkohl +Cactus Juice=Kaktussaft +Carrot=Möhre +Carrot Juice=Möhrensaft +Chili Pepper=Chili +Chocolate Block=Schokoladenstück +Chocolate Donut=Schokodonut +Cocoa Beans=Kakaobohne +Coffee Beans=Kaffeebohnen +Cookie=Keks +Cooking Pot=Kochtopf +Corn=Mais +Corn on the Cob=Maiskolben +Cornstarch=Speisestärke +Cotton=Baumwolle +Cotton Seed=Baumwollsamen +Cucumber=Gurke +Cucumber and Potato Salad=Gurken und Tomatensalat +Cup of Coffee=Tasse Kaffee +Cutting Board=Schneidebrett +Diamond Hoe=Diamanthacke +Donut=Donut +Flour=Mehl +Garlic=Knoblauch +Garlic Braid=Knoblauchzopf +Garlic Bread=Knoblauchbrot +Garlic clove=Knoblauchzehe +Glass Mixing Bowl=Glasschlüssel +Golden Carrot=Goldene Möhre +Grapes=Weintrauben +Green Beans=Grüne Bohnen +Ground Pepper=Gemahlener Pfeffer +Hemp Block=Hanfblock +Hemp Fibre=Hanffaser +Hemp Leaf=Hanfblatt +Hemp Rope=Hanfseil +Hemp Seed=Hanfsamen +Hoe=Hacke +Hoe Bomb (use or throw on grassy areas to hoe land)=Hackbombe (Auf Grasland werfen oder benutzen) +Jack 'O Lantern (punch to turn on and off)=Kürbislaterne (Punch zum Ein- und Ausschalten) +Jaffa Cake=Jaffakeks +Juicer=Entsafter +Melon=Melone +Melon Slice=Melonenscheibe +Mese Hoe=Mesehacke +Mint Leaf=Minzblatt +Mint Seeds=Minzsamen +Mint Tea=Minztee +Mithril Scythe (Right-click to harvest and replant crops)=Mithril-Sense (Rechts-Klick zum Ernten und Wiedereinpflanzen) +Mortar and Pestle=Mörser und Stößel +Multigrain Bread=Mehrkornbrot +Multigrain Flour=Mehrkornmehl +Oat seed=Hafersamen +Oats=Hafer +Onion=Zwiebel +Onion Soup=Zwiebelsuppe +Orange=Apfelsine +Pasta=Pasta +Pea Pod=Erbsenschote +Pea Soup=Erbsensuppe +Peas=Erbsen +Pepper=Pfeffer +Peppercorn=Pfefferkorn +Pineapple=Ananas +Pineapple Juice=Ananassaft +Pineapple Ring=Ananasscheibe +Pineapple Top=Ananasdeckel +Porridge=Haferbrei +Potato=Kartoffel +Pumpkin=Kürbis +Pumpkin Bread=Kürbisbrot +Pumpkin Dough=Kürbisteig +Pumpkin Slice=Kürbisscheibe +Raspberries=Himbeeren +Raspberry Smoothie=Himbeersmoothie +Rhubarb=Rhabarber +Rhubarb Pie=Rhabarberkuchen +Rice=Reis +Rice Bread=Reiswaffel +Rice Flour=Reismehl +Rice grains=Reissaat +Rose Water=Rosenwasser +Rye=Roggen +Rye seed=Roggensaat +Salt=Salz +Saucepan=Kasserolle +Savanna Soil=Savannaerde +Scarecrow Bottom=Vogelscheuchengestell +Seed=Saatgut +Skillet=Bratpfanne +Sliced Bread=Geschnittenes Brot +Soil=Ackerboden +Spaghetti=Spaghetti +Steel Hoe=Stahlhacke +Stone Hoe=Steinhacke +Straw=Stroh +Strawberry=Erdbeere +String=Faden +Sugar=Zucker +Toast=Toast +Toast Sandwich=Toast Sandwich +Tomato=Tomate +Trellis (place on soil before planting grapes)=Spalier (vor dem Pflanzen der Weintrauben auf den\nAckerboden stellen) +Turkish Delight=Lokum +Wet Savanna Soil=Feuchte Savannaerde +Wet Soil=Bewässerter Ackerboden +Wheat=Weizen +Wheat Seed=Weizenkörner +Wild Cotton=Wilde Baumwolle +Wooden Bowl=Holzschale +Wooden Hoe=Holzhacke diff --git a/mods/farming/locale/farming.en.tr b/mods/farming/locale/farming.en.tr new file mode 100644 index 0000000..22df74a --- /dev/null +++ b/mods/farming/locale/farming.en.tr @@ -0,0 +1,134 @@ +# textdomain:farming +#%s Hoe= +#Apple Donut= +#Apple Pie= +#Baked Potato= +#Baking Tray= +#Banana= +#Banana Leaves= +#Bar of Dark Chocolate= +#Barley= +#Barley Seed= +#Bean Pole (place on soil before planting beans)= +#Beetroot= +#Beetroot Soup= +#Bibimbap= +#Wild Blueberries= +#Blueberry Muffin= +#Blueberry Pie= +#Bottle of Ethanol= +#Bottle of Hemp Oil= +#Bowl of Chili= +#Bread= +#Bronze Hoe= +#Cabbage= +#Cactus Juice= +#Carrot= +#Carrot Juice= +#Chili Pepper= +#Chocolate Block= +#Chocolate Donut= +#Cocoa Beans= +#Coffee Beans= +#Cookie= +#Cooking Pot= +#Corn= +#Corn on the Cob= +#Cornstarch= +#Cotton= +#Cotton Seed= +#Cucumber= +#Cucumber and Potato Salad= +#Cup of Coffee= +#Cutting Board= +#Diamond Hoe= +#Donut= +#Flour= +#Garlic= +#Garlic Braid= +#Garlic Bread= +#Garlic clove= +#Glass Mixing Bowl= +#Golden Carrot= +#Grapes= +#Green Beans= +#Ground Pepper= +#Hemp Block= +#Hemp Fibre= +#Hemp Leaf= +#Hemp Rope= +#Hemp Seed= +#Hoe= +#Hoe Bomb (use or throw on grassy areas to hoe land)= +#Jack 'O Lantern (punch to turn on and off)= +#Jaffa Cake= +#Juicer= +#Melon= +#Melon Slice= +#Mese Hoe= +#Mint Leaf= +#Mint Seeds= +#Mint Tea= +#Mithril Scythe (Right-click to harvest and replant crops)= +#Mortar and Pestle= +#Multigrain Bread= +#Multigrain Flour= +#Oat seed= +#Oats= +#Onion= +#Onion Soup= +#Orange= +#Pasta= +#Pea Pod= +#Pea Soup= +#Peas= +#Pepper= +#Peppercorn= +#Pineapple= +#Pineapple Juice= +#Pineapple Ring= +#Pineapple Top= +#Porridge= +#Potato= +#Pumpkin= +#Pumpkin Bread= +#Pumpkin Dough= +#Pumpkin Slice= +#Raspberries= +#Raspberry Smoothie= +#Rhubarb= +#Rhubarb Pie= +#Rice= +#Rice Bread= +#Rice Flour= +#Rice grains= +#Rose Water= +#Rye= +#Rye seed= +#Salt= +#Saucepan= +#Savanna Soil= +#Scarecrow Bottom= +#Seed= +#Skillet= +#Sliced Bread= +#Soil= +#Spaghetti= +#Steel Hoe= +#Stone Hoe= +#Straw= +#Strawberry= +#String= +#Sugar= +#Toast= +#Toast Sandwich= +#Tomato= +#Trellis (place on soil before planting grapes)= +#Turkish Delight= +#Wet Savanna Soil= +#Wet Soil= +#Wheat= +#Wheat Seed= +#Wild Cotton= +#Wooden Bowl= +#Wooden Hoe= diff --git a/mods/farming/locale/farming.es.tr b/mods/farming/locale/farming.es.tr new file mode 100644 index 0000000..09a86f3 --- /dev/null +++ b/mods/farming/locale/farming.es.tr @@ -0,0 +1,134 @@ +# textdomain:farming +%s Hoe=%s Azadon +Apple Donut=Dona de Manzana +Apple Pie=Pastel de Manzana +Baked Potato=Papa al Horno +Baking Tray=Bandeja Hornear +Banana=Platano +Banana Leaves=Hojas de Platano +Bar of Dark Chocolate=Barra de Chocolate amargo +Barley=Cebada +Barley Seed=Semilla de Cebada +Bean Pole (place on soil before planting beans)=Base de frijol (colocar en el suelo antes de plantar los frijoles) +Beetroot=Remolacha +Beetroot Soup=Sopa de Remolacha +#Bibimbap= +Wild Blueberries=Arándanos Silvestres +Blueberry Muffin=Muffin de Arándanos +Blueberry Pie=Pastel de arándanos +Bottle of Ethanol=Botella de Etanol +Bottle of Hemp Oil=Botella de aceite de cáñamo +Bowl of Chili=Tazón de Chili +Bread=Pan +Bronze Hoe=Azadon de Bronze +Cabbage=Repollo +Cactus Juice=Jugo de Cactus +Carrot=Zanahoria +Carrot Juice=Jugo de Zanahoria +Chili Pepper=Aji Picante +Chocolate Block=Bloque de chocolate +Chocolate Donut=Dona de chocolate +Cocoa Beans=Granos De Cacao +Coffee Beans=Granos de café +Cookie=Galleta +Cooking Pot=Olla de cocinar +Corn=Maiz +Corn on the Cob=Mazorca +Cornstarch=Maicena +Cotton=Algodon +Cotton Seed=Semilla de Algodon +Cucumber=Ensalada +Cucumber and Potato Salad=Ensalada de Pepino y Papas +Cup of Coffee=Taza de Cafe +Cutting Board=Tabla de Cortar +Diamond Hoe=Azado de Diamante +Donut=Dona +Flour=Harina +Garlic=Ajo +Garlic Braid=Trenza de Ajo +Garlic Bread=Pan de Ajo +Garlic clove=Diente de Ajo +Glass Mixing Bowl=Cuenco de vidrio +Golden Carrot=Zanahoria Dorada +Grapes=Uvas +Green Beans=Arvejas Verdes +Ground Pepper=Pimienta Molida +Hemp Block=Bloque de Canamo +Hemp Fibre=Fibra de Canamo +Hemp Leaf=Hoja de Canamo +Hemp Rope=Cuerda de Canamo +Hemp Seed=Semilla de Canamo +Hoe=Azadon +Hoe Bomb (use or throw on grassy areas to hoe land)=Azado Bomba (usar o tirar en áreas verdes para cavar) +Jack 'O Lantern (punch to turn on and off)=Lampara de Jack (pulsar para encender o apagar) +Jaffa Cake=Pastel de Jaffa +Juicer=Licuadora +Melon=Melon +Melon Slice=Rebanada de Melon +Mese Hoe=Azada de Mese +Mint Leaf=Hoja de Menta +Mint Seeds=Semilla de Menta +Mint Tea=Te de Menta +Mithril Scythe (Right-click to harvest and replant crops)=Hoz de Mithril (clic derecho para cosechar y replantar cultivos) +Mortar and Pestle=Mortero y Maja +Multigrain Bread=Pan Multicereales +Multigrain Flour=Harina multigrano +Oat seed=Semilla de Avena +Oats=Avena +Onion=Cebolla +Onion Soup=Sopa de Cebolla +Orange=Naranja +Pasta=Pasta +Pea Pod=Vaina de Guisantes +Pea Soup=Sopa de Guisantes +Peas=Gisantes +Pepper=Pimienta +Peppercorn=Vaina de Pimienta +Pineapple=Piña +Pineapple Juice=Jugo de piña +Pineapple Ring=Anillo de piña +Pineapple Top=Hojas de piña +Porridge=Avena hojuelas +Potato=Patata +Pumpkin=Calabaza +Pumpkin Bread=Pan de Calabaza +Pumpkin Dough=Batido de Calabaza +Pumpkin Slice=Rebanada de Calabaza +Raspberries=Frambuesa +Raspberry Smoothie=Batido de Frambuesa +Rhubarb=Ruibardo +Rhubarb Pie=Pastel de ruibarbo +Rice=Arroz +Rice Bread=pan de arroz +Rice Flour=harina de arroz +Rice grains=Granos de arroz +Rose Water=Agua de rosas +Rye=Centeno +Rye seed=Semilla de Centeno +Salt=Sal +Saucepan=Cacerola +Savanna Soil=Suelo de sabana +Scarecrow Bottom=Espantapajaros abajo +Seed=Semilla +Skillet=Sarten +Sliced Bread=Pan Rebanado +Soil=Suelo +Spaghetti=Espagueti +Steel Hoe=Azado de Acero +Stone Hoe=Azado de Piedra +Straw=Paja +Strawberry=Fresa +String=Cadena +Sugar=Azucar +Toast=Tostadas +Toast Sandwich=Emparedado Tostados +Tomato=Tomate +Trellis (place on soil before planting grapes)=Enrejado (colocar en el suelo antes de plantar las uvas) +Turkish Delight=Delicia Turca +Wet Savanna Soil=Suelo humedo de savana +Wet Soil=Suelo mojado +Wheat=Trigo +Wheat Seed=Semilla de Trigo +Wild Cotton=Algodón Salvaje +Wooden Bowl=Cuenco de madera +Wooden Hoe=Azada de madera diff --git a/mods/farming/locale/farming.fr.tr b/mods/farming/locale/farming.fr.tr new file mode 100644 index 0000000..528ba21 --- /dev/null +++ b/mods/farming/locale/farming.fr.tr @@ -0,0 +1,134 @@ +# textdomain:farming +%s Hoe=Binette de %s +Apple Donut=Beignet aux pommes +Apple Pie=Tarte aux pommes +Baked Potato=Pomme de terre cuite +Baking Tray=Lèche-frite +Banana=Banane +Banana Leaves=Feuilles de banane +Bar of Dark Chocolate=Tablette de chocolat noir +Barley=Orge +Barley Seed=Graine d'orge +Bean Pole (place on soil before planting beans)=Tuteur pour haricots (placer sur le sol avant de planter des haricots) +Beetroot=Betterave +Beetroot Soup=Soupe de betterave +Bibimbap=Bibimbap +Wild Blueberries=Myrtilles Sauvages +Blueberry Muffin=Muffin aux myrtilles +Blueberry Pie=Tarte aux myrtilles +Bottle of Ethanol=Bouteille d'éthanol +Bottle of Hemp Oil=Bouteille d'huile de chanvre +Bowl of Chili=Bol de chilli +Bread=Pain +Bronze Hoe=Binette en bronze +Cabbage=Chou +Cactus Juice=Jus de cactus +Carrot=Carotte +Carrot Juice=Jus de carotte +Chili Pepper=Piment fort +Chocolate Block=Bloc de chocolat +Chocolate Donut=Beignet au chocolat +Cocoa Beans=Fèves de cacao +Coffee Beans=Grains de café +Cookie=Biscuit +Cooking Pot=Marmitte +Corn=Maïs +Corn on the Cob=Maïs cuit +Cornstarch=Fécule de maïs +Cotton=Coton +Cotton Seed=Graines de coton +Cucumber=Concombre +Cucumber and Potato Salad=Salade de pomme de terre et concombre +Cup of Coffee=Tasse de café +Cutting Board=Planche à découper +Diamond Hoe=Binette en diamant +Donut=Beignet +Flour=Farine +Garlic=Tête d'ail +Garlic Braid=Ail tressé +Garlic Bread=Pain à l'ail +Garlic clove=Gousse d'ail +Glass Mixing Bowl=Terrine en verre +Golden Carrot=Carotte dorée +Grapes=Raisins +Green Beans=Haricots verts +Ground Pepper=Poivre moulu +Hemp Block=Bloc de chanvre +Hemp Fibre=Fibre de chanvre +Hemp Leaf=Feuille de chanvre +Hemp Rope=Corde de chanvre +Hemp Seed=Graines de chanvre +Hoe=Binette +Hoe Bomb (use or throw on grassy areas to hoe land)=Bombe à binnage (Actionner ou lancer sur une zone herbeuse pour la binner) +Jack 'O Lantern (punch to turn on and off)=Jack 'O Lantern (Frapper pour allumer et éteindre) +Jaffa Cake=Petit gâteau à l'orange "Jaffa" +Juicer=Presse-agrumes +Melon=Melon +Melon Slice=Tranche de melon +Mese Hoe=Binette en mese +Mint Leaf=Feuille de menthe +Mint Seeds=Graine de menthe +Mint Tea=Thé à la menthe +Mithril Scythe (Right-click to harvest and replant crops)=Faux en mithril (Récolte et replante des graines) +Mortar and Pestle=Mortier et pilon +Multigrain Bread=Pain aux céréales +Multigrain Flour=Farine multi-céréales +Oat seed=Grains d'orge +Oats=Avoine +Onion=Oignon +Onion Soup=Soupe à l'oignon +Orange=Orange +Pasta=Pâtes +Pea Pod=Cosse de petit-pois +Pea Soup=Soupe de petit-pois +Peas=Petit-pois +Pepper=Poivron +Peppercorn=Grain de poivre +Pineapple=Ananas +Pineapple Juice=Jus d'ananas +Pineapple Ring=Tranche d'ananas +Pineapple Top=Pousse d'ananas +Porridge=Gruau de céréales +Potato=Pomme de terre +Pumpkin=Citrouille +Pumpkin Bread=Pain à la citrouille +Pumpkin Dough=Pâton de pain à la citrouille +Pumpkin Slice=Tranche de citrouille +Raspberries=Framboises +Raspberry Smoothie=Smoothie aux framboises +Rhubarb=Rhubarbe +Rhubarb Pie=Tarte à la rhubarbe +Rice=Riz +Rice Bread=Pain de riz +Rice Flour=Farine de riz +Rice grains=Grain de riz +Rose Water=Eau de rose +Rye=Seigle +Rye seed=Grains de seigle +Salt=Sel +Saucepan=Casserole +Savanna Soil=Terre de la savane binnée +Scarecrow Bottom=Base d'épouventail +Seed=Graine +Skillet=Poêle +Sliced Bread=Tranche de Pain +Soil=Terre binnée +Spaghetti=Spaghetti +Steel Hoe=Binette en acier +Stone Hoe=Binette en pierre +Straw=Paille +Strawberry=Fraise +String=Ficelle +Sugar=Sucre +Toast=Pain grillé +Toast Sandwich=Sandwich au pain grillé +Tomato=Tomate +Trellis (place on soil before planting grapes)=Treillis (placer sur le sol avant de planter la vigne) +Turkish Delight=Douceur turque +Wet Savanna Soil=Terre humide et binnée de la savane +Wet Soil=Terre humide et binnée +Wheat=Blé +Wheat Seed=Grain de blé +Wild Cotton=Coton sauvage +Wooden Bowl=Bol en bois +Wooden Hoe=Binette en bois diff --git a/mods/farming/locale/farming.it.tr b/mods/farming/locale/farming.it.tr new file mode 100644 index 0000000..d041ac2 --- /dev/null +++ b/mods/farming/locale/farming.it.tr @@ -0,0 +1,134 @@ +# textdomain:farming +#%s Hoe= +Apple Donut=Ciambella alla mela +#Apple Pie= +Baked Potato=Patata arrostita +Baking Tray=Teglia da forno +Banana=Banana +Banana Leaves=Foglie di banano +Bar of Dark Chocolate=Barra di cioccolato fondente +Barley=Orzo +Barley Seed=Seme d'orzo +Bean Pole (place on soil before planting beans)=Palina per fagiolini (mettila sul terreno coltivabile prima di piantare i fagiolini) +Beetroot=Barbabietola +Beetroot Soup=Zuppa di barbabietola +#Bibimbap= +Wild Blueberries=Mirtilli Selvatici +Blueberry Muffin=Focaccina di mirtilli +Blueberry Pie=Tortino di mirtilli +Bottle of Ethanol=Bottiglia di alcol etilico +Bottle of Hemp Oil=Bottiglia d'olio di canapa +Bowl of Chili=Ciotola di peperoncino +Bread=Pane +Bronze Hoe=Zappa di bronzo +#Cabbage= +#Cactus Juice= +Carrot=Carota +Carrot Juice=Succo di carota +Chili Pepper=Peperoncino +Chocolate Block=Blocco di cioccolato +Chocolate Donut=Ciambella al cioccolato +Cocoa Beans=Chicchi di cacao +Coffee Beans=Chicchi di caffè +Cookie=Biscotto +Cooking Pot=Pentola da cottura +Corn=Mais +Corn on the Cob=Pannocchia arrostita +Cornstarch=Amido di mais +Cotton=Cotone +Cotton Seed=Seme di cotone +Cucumber=Cetriolo +Cucumber and Potato Salad=Insalata di patate e cetrioli +Cup of Coffee=Tazza di caffè +Cutting Board=Tagliere +Diamond Hoe=Zappa di diamante +Donut=Ciambella +Flour=Farina +Garlic=Aglio +Garlic Braid=Treccia d'aglio +Garlic Bread=Pane all'aglio +Garlic clove=Spicchio d'aglio +Glass Mixing Bowl=Terrina di vetro +Golden Carrot=Carota d'oro +Grapes=Chicchi d'uva +Green Beans=Fagiolini +Ground Pepper=Pepe macinato +Hemp Block=Blocco di canapa +Hemp Fibre=Fibra di canapa +Hemp Leaf=Foglia di canapa +Hemp Rope=Corda di canapa +Hemp Seed=Seme di canapa +Hoe=Zappa +Hoe Bomb (use or throw on grassy areas to hoe land)=Bomba zappa (usala o lanciala sulle aree erbose per zappare il terreno) +Jack 'O Lantern (punch to turn on and off)=Jack Lanterna (colpirlo per accenderlo e spegnerlo) +Jaffa Cake=Torta di jaffa +Juicer=Spremiagrumi +Melon=Anguria +Melon Slice=Fetta d'anguria +Mese Hoe=Zappa di mese +#Mint Leaf= +#Mint Seeds= +#Mint Tea= +Mithril Scythe (Right-click to harvest and replant crops)=Falce di mithril (clicca col destro per raccogliere e ripiantare le prose) +Mortar and Pestle=Mortaio e pestello +Multigrain Bread=Pane multicereale +Multigrain Flour=Farina multicereale +Oat seed=Seme d'avena +#Oats= +Onion=Cipolla +#Onion Soup= +Orange=Arancia +#Pasta= +Pea Pod=Baccello di piselli +Pea Soup=Zuppa di piselli +Peas=Piselli +Pepper=Pepe +Peppercorn=Grano di pepe +Pineapple=Ananas +Pineapple Juice=Succo d'ananas +Pineapple Ring=Anello d'ananas +Pineapple Top=Cima d'ananas +Porridge=Porridge +Potato=Patata +Pumpkin=Zucca +Pumpkin Bread=Pane alla zucca +Pumpkin Dough=Pasta di zucca +Pumpkin Slice=Fetta di zucca +Raspberries=Lamponi +Raspberry Smoothie=Purea di lamponi +Rhubarb=Rabarbaro +Rhubarb Pie=Tortino al rabarbaro +Rice=Riso +Rice Bread=Pane di riso +Rice Flour=Farina di riso +Rice grains=Chicchi di riso +Rose Water=Acqua di rose +Rye=Segale +Rye seed=Seme di segale +Salt=Sale +Saucepan=Casseruola +#Savanna Soil= +Scarecrow Bottom=Fondo dello spaventapasseri +Seed=Seme +Skillet=Padella +Sliced Bread=Pane a fette +Soil=Terreno coltivabile +#Spaghetti= +Steel Hoe=Zappa d'acciaio +Stone Hoe=Zappa di pietra +Straw=Paglia +Strawberry=Fragola +String=Filo +Sugar=Zucchero +Toast=Pane tostato +Toast Sandwich=Panino di pane tostato +Tomato=Pomodoro +Trellis (place on soil before planting grapes)=Graticcio (mettilo sul terreno coltivabile prima di piantare i chicchi d'uva) +Turkish Delight=Lokum +#Wet Savanna Soil= +Wet Soil=Terreno coltivabile bagnato +Wheat=Grano +Wheat Seed=Seme di grano +#Wild Cotton= +Wooden Bowl=Ciotola di legno +Wooden Hoe=Zappa di legno diff --git a/mods/farming/locale/farming.pt.tr b/mods/farming/locale/farming.pt.tr new file mode 100644 index 0000000..c2c2248 --- /dev/null +++ b/mods/farming/locale/farming.pt.tr @@ -0,0 +1,134 @@ +# textdomain:farming +#%s Hoe= +Apple Donut=Donut de Maça +#Apple Pie= +Baked Potato=Batata Cozida +#Baking Tray= +#Banana= +#Banana Leaves= +Bar of Dark Chocolate=Barra de Chocolate Preto +Barley=Cevada +Barley Seed=Sementes de Cevada +Bean Pole (place on soil before planting beans)=Apoio de feijao (coloque no solo antes de plantar feijao) +#Beetroot= +#Beetroot Soup= +#Bibimbap= +Wild Blueberries=Mirtilos Selvagens +Blueberry Muffin=Muffin de Mirtilos +#Blueberry Pie= +Bottle of Ethanol=Garrafa de Etanol +Bottle of Hemp Oil=Garrafa de Oleo de Canhamo +#Bowl of Chili= +Bread=Pao +Bronze Hoe=Enxada de Bronze +#Cabbage= +#Cactus Juice= +Carrot=Cenoura +#Carrot Juice= +#Chili Pepper= +#Chocolate Block= +Chocolate Donut=Donut de Chocolate +Cocoa Beans=Amendoas de Cacau +Coffee Beans=Grao de Cafe +Cookie=Cookie +#Cooking Pot= +Corn=Milho +Corn on the Cob=Espiga de Milho +#Cornstarch= +Cotton=Algodao +Cotton Seed=Sementes de Algodao +Cucumber=Pepino +#Cucumber and Potato Salad= +Cup of Coffee=Xicara de Cafe +#Cutting Board= +Diamond Hoe=Enxada de Diamante +Donut=Donut +Flour=Farinha +#Garlic= +#Garlic Braid= +#Garlic Bread= +#Garlic clove= +#Glass Mixing Bowl= +Golden Carrot=Cenoura Dourada +Grapes=Uvas +Green Beans=Feijoes Verdes +#Ground Pepper= +#Hemp Block= +Hemp Fibre=Fibra de Canhamo +Hemp Leaf=Folha de Canhamo +Hemp Rope=Corda de Canhamo +Hemp Seed=Sementes de Canhamo +Hoe=Enxada +#Hoe Bomb (use or throw on grassy areas to hoe land)= +Jack 'O Lantern (punch to turn on and off)=Jack 'O Lantern (Socos para ligar e desligar) +#Jaffa Cake= +#Juicer= +Melon=Melancia +Melon Slice=Sementes de Melancia +Mese Hoe=Enxada de Mese +#Mint Leaf= +#Mint Seeds= +#Mint Tea= +#Mithril Scythe (Right-click to harvest and replant crops)= +#Mortar and Pestle= +#Multigrain Bread= +#Multigrain Flour= +#Oat seed= +#Oats= +#Onion= +#Onion Soup= +#Orange= +#Pasta= +#Pea Pod= +#Pea Soup= +#Peas= +#Pepper= +#Peppercorn= +#Pineapple= +#Pineapple Juice= +#Pineapple Ring= +#Pineapple Top= +#Porridge= +Potato=Batata +Pumpkin=Abobora +Pumpkin Bread=Pao de Abobora +Pumpkin Dough=Massa de Abobora +Pumpkin Slice=Pedaço de Abobora +Raspberries=Framboesa +Raspberry Smoothie=Batida de Framboesa +Rhubarb=Ruibarbo +Rhubarb Pie=Torta de Ruibarbo +#Rice= +#Rice Bread= +#Rice Flour= +#Rice grains= +#Rose Water= +#Rye= +#Rye seed= +#Salt= +#Saucepan= +#Savanna Soil= +#Scarecrow Bottom= +Seed=Sementes +#Skillet= +#Sliced Bread= +Soil=Solo +#Spaghetti= +Steel Hoe=Enxada de Aço +Stone Hoe=Enxada de Pedra +Straw=Palha +#Strawberry= +#String= +Sugar=Açucar +#Toast= +#Toast Sandwich= +Tomato=Tomate +Trellis (place on soil before planting grapes)=Grade de Ripas (colocar no solo antes de plantar uvas) +#Turkish Delight= +#Wet Savanna Soil= +Wet Soil=Solo Seco +Wheat=Trigo +Wheat Seed=Sementes de Trigo +#Wild Cotton= +#Wooden Bowl= +Wooden Hoe=Enxada de Madeira diff --git a/mods/farming/locale/farming.ru.tr b/mods/farming/locale/farming.ru.tr new file mode 100644 index 0000000..dce5eb1 --- /dev/null +++ b/mods/farming/locale/farming.ru.tr @@ -0,0 +1,134 @@ +# textdomain:farming +%s Hoe=%s мотыга +Apple Donut=Яблочный пончик +Apple Pie=Яблочный пирог +Baked Potato=Печеный картофель +Baking Tray=Противень +Banana=Банан +Banana Leaves=Листья банана +Bar of Dark Chocolate=Плитка темного шоколада +Barley=Ячмень +Barley Seed=Семена ячменя +Bean Pole (place on soil before planting beans)=Жердь для бобовых (установите на почву перед посадкой бобовых) +Beetroot=Свекла +Beetroot Soup=Борщ +#Bibimbap= +Wild Blueberries=Голубика +Blueberry Muffin=Кекс с голубикой +Blueberry Pie=Пирог с голубикой +Bottle of Ethanol=Бутылка спирта +Bottle of Hemp Oil=Бутылка конопляного масла +Bowl of Chili=Миска чили +Bread=Хлеб +Bronze Hoe=Бронзовая мотыга +#Cabbage= +Cactus Juice=Кактусовый сок +Carrot=Морковь +Carrot Juice=Морковный сок +Chili Pepper=Перец чили +Chocolate Block=Шоколадный блок +Chocolate Donut=Шоколадный пончик +Cocoa Beans=Какао-бобы +Coffee Beans=Кофейные зерна +Cookie=Печенье +Cooking Pot=Котел +Corn=Кукуруза +Corn on the Cob=Початок кукурузы +Cornstarch=Кукурузный крахмал +Cotton=Хлопок +Cotton Seed=Семена хлопка +Cucumber=Огурец +Cucumber and Potato Salad=Салат из огурцов и картофеля +Cup of Coffee=Чашка кофе +Cutting Board=Разделочная доска +Diamond Hoe=Алмазная мотыга +Donut=Пончик +Flour=Мука +Garlic=Чеснок +Garlic Braid=Связка чеснока +Garlic Bread=Чесночный хлеб +Garlic clove=Зубчик чеснока +Glass Mixing Bowl=Стеклянная чаша +Golden Carrot=Золотая морковь +Grapes=Виноград +Green Beans=Зеленая фасоль +Ground Pepper=Молотый перец +Hemp Block=Блок конопли +Hemp Fibre=Конопляное волокно +Hemp Leaf=Лист конопли +Hemp Rope=Пеньковая веревка +Hemp Seed=Семена конопли +Hoe=Мотыга +Hoe Bomb (use or throw on grassy areas to hoe land)=Мотыгобомба (используйте или бросьте на траву для ее обработки) +Jack 'O Lantern (punch to turn on and off)=Светильник джека (удар для включения и выключения) +Jaffa Cake=Яффский пирог +Juicer=Соковыжималка +Melon=Арбуз +Melon Slice=Долька арбуза +Mese Hoe=Магическая мотыга +Mint Leaf=Лист мяты +Mint Seeds=Семена мяты +Mint Tea=Чай с мятой +Mithril Scythe (Right-click to harvest and replant crops)=Мифриловая коса (Щелкните правой кнопкой мыши для сбора и пересадки растений) +Mortar and Pestle=Ступка и пестик +Multigrain Bread=Мультизерновой хлеб +Multigrain Flour=Мультизерновая мука +Oat seed=Семена овса +#Oats= +Onion=Лук +Onion Soup=Луковый суп +Orange=Апельсин +#Pasta= +Pea Pod=Стручок гороха +Pea Soup=Гороховый суп +Peas=Горох +Pepper=Перец +Peppercorn=Перчинка +Pineapple=Ананас +Pineapple Juice=Ананасовый сок +Pineapple Ring=Кольцо ананаса +Pineapple Top=Верхушка ананаса +Porridge=Каша +Potato=Картофель +Pumpkin=Тыква +Pumpkin Bread=Тыквенный хлеб +Pumpkin Dough=Тыквенное тесто +Pumpkin Slice=Ломтик тыквы +Raspberries=Малина +Raspberry Smoothie=Малиновый смузи +Rhubarb=Ревень +Rhubarb Pie=Пирог с ревенем +Rice=Рис +Rice Bread=Рисовый хлеб +Rice Flour=Рисовая мука +Rice grains=Зёрна риса +Rose Water=Розовая вода +Rye=Рожь +Rye seed=Зёрна ржи +Salt=Соль +Saucepan=Кастрюля +Savanna Soil=Земля саванны +Scarecrow Bottom=Основание пугала +Seed=Семена +Skillet=Сковорода +Sliced Bread=Нарезанный хлеб +Soil=Земля +#Spaghetti= +Steel Hoe=Стальная мотыга +Stone Hoe=Каменная мотыга +Straw=Солома +Strawberry=Земляника +String=Нить +Sugar=Сахар +Toast=Тост +Toast Sandwich=Сэндвич +Tomato=Помидор +Trellis (place on soil before planting grapes)=Решетка (поставьте на почву перед посадкой винограда) +Turkish Delight=Рахат-лукум +Wet Savanna Soil=Увлажненная земля саванны +Wet Soil=Увлажненная земля +Wheat=Пшеница +Wheat Seed=Зёрна пшеницы +Wild Cotton=Дикорастущий хлопок +Wooden Bowl=Деревянная миска +Wooden Hoe=Деревянная мотыга diff --git a/mods/farming/locale/farming.zh_CN.tr b/mods/farming/locale/farming.zh_CN.tr new file mode 100644 index 0000000..8820705 --- /dev/null +++ b/mods/farming/locale/farming.zh_CN.tr @@ -0,0 +1,134 @@ +# textdomain:farming +#%s Hoe= +Apple Donut=苹果甜甜圈 +#Apple Pie= +Baked Potato=焗马铃薯 +Baking Tray=烤盘 +Banana=香蕉 +Banana Leaves=香蕉叶 +Bar of Dark Chocolate=黑巧克力条 +Barley=大麦 +Barley Seed=大麦种子 +Bean Pole (place on soil before planting beans)=豆杆(种豆前先放在土上) +Beetroot=甜菜根 +Beetroot Soup=甜菜根汤 +#Bibimbap= +Wild Blueberries=蓝莓 +Blueberry Muffin=蓝莓松糕 +Blueberry Pie=蓝莓派 +Bottle of Ethanol=一瓶乙醇 +Bottle of Hemp Oil=一瓶大麻油 +Bowl of Chili=一碗辣椒 +Bread=面包 +Bronze Hoe=青铜锄头 +#Cabbage= +#Cactus Juice= +Carrot=胡萝卜 +Carrot Juice=胡萝卜汁 +Chili Pepper=辣椒 +Chocolate Block=巧克力块 +Chocolate Donut=巧克力甜甜圈 +Cocoa Beans=可可豆 +Coffee Beans=咖啡豆 +Cookie=曲奇 +Cooking Pot=锅 +Corn=玉米 +Corn on the Cob=玉米棒 +Cornstarch=玉米淀粉 +Cotton=棉花 +Cotton Seed=棉籽 +Cucumber=黄瓜 +Cucumber and Potato Salad=黄瓜土豆沙拉 +Cup of Coffee=一杯咖啡 +Cutting Board=砧板 +Diamond Hoe=钻石锄 +Donut=甜甜圈 +Flour=面粉 +Garlic=大蒜 +Garlic Braid=蒜辫 +Garlic Bread=蒜香面包 +Garlic clove=蒜瓣 +Glass Mixing Bowl=搅拌杯 +Golden Carrot=金萝卜 +Grapes=葡萄 +Green Beans=青豆 +Ground Pepper=胡椒粉 +Hemp Block=麻块 +Hemp Fibre=大麻纤维 +Hemp Leaf=大麻叶 +Hemp Rope=麻绳 +Hemp Seed=大麻籽 +Hoe=锄头 +Hoe Bomb (use or throw on grassy areas to hoe land)=锄弹(在草地上使用或扔在锄地上) +Jack 'O Lantern (punch to turn on and off)=南瓜灯(按一下开关) +Jaffa Cake=佳发饼 +Juicer=榨汁机 +Melon=甜瓜 +Melon Slice=西瓜片 +Mese Hoe=黄石锄头 +#Mint Leaf= +#Mint Seeds= +#Mint Tea= +Mithril Scythe (Right-click to harvest and replant crops)=秘银镰刀(右击可收获并重新种植作物) +Mortar and Pestle=研钵 +Multigrain Bread=杂粮面包 +Multigrain Flour=多粒面粉 +Oat seed=燕麦籽 +#Oats= +Onion=洋葱 +#Onion Soup= +Orange=橙色 +#Pasta= +Pea Pod=豌豆荚 +Pea Soup=豌豆汤 +Peas=豌豆 +Pepper=胡椒粉 +Peppercorn=胡椒粉 +Pineapple=菠萝 +Pineapple Juice=菠萝汁 +Pineapple Ring=菠萝圈 +Pineapple Top=菠萝上衣 +Porridge=粥 +Potato=土豆 +Pumpkin=南瓜 +Pumpkin Bread=南瓜面包 +Pumpkin Dough=南瓜面团 +Pumpkin Slice=南瓜片 +Raspberries=覆盆子 +Raspberry Smoothie=覆盆子冰沙 +Rhubarb=大黄 +Rhubarb Pie=大黄派 +Rice=大米 +Rice Bread=米饭面包 +Rice Flour=米粉 +Rice grains=稻谷 +Rose Water=玫瑰汁 +Rye=黑麦 +Rye seed=黑麦种子 +Salt=盐 +Saucepan=平底锅 +#Savanna Soil= +Scarecrow Bottom=稻草人屁股 +Seed=种子 +Skillet=平底锅 +Sliced Bread=切片面包 +Soil=土壤 +#Spaghetti= +Steel Hoe=钢锄头 +Stone Hoe=石锄 +Straw=稻草 +Strawberry=草莓 +String=线 +Sugar=糖 +Toast=烤面包片 +Toast Sandwich=三明治面包 +Tomato=番茄 +Trellis (place on soil before planting grapes)=棚架(种植葡萄前先放在土壤上) +Turkish Delight=土耳其软糖 +#Wet Savanna Soil= +Wet Soil=湿土 +Wheat=小麦 +Wheat Seed=小麦种子 +#Wild Cotton= +Wooden Bowl=木碗 +Wooden Hoe=木锄 diff --git a/mods/farming/locale/farming.zh_TW.tr b/mods/farming/locale/farming.zh_TW.tr new file mode 100644 index 0000000..a72f739 --- /dev/null +++ b/mods/farming/locale/farming.zh_TW.tr @@ -0,0 +1,134 @@ +# textdomain:farming +#%s Hoe= +Apple Donut=蘋果甜甜圈 +#Apple Pie= +Baked Potato=焗馬鈴薯 +Baking Tray=烤盤 +Banana=香蕉 +Banana Leaves=香蕉葉 +Bar of Dark Chocolate=黑巧克力條 +Barley=大麥 +Barley Seed=大麥種子 +Bean Pole (place on soil before planting beans)=豆杆(種豆前先放在土上) +Beetroot=甜菜根 +Beetroot Soup=甜菜根湯 +#Bibimbap= +Wild Blueberries=藍莓 +Blueberry Muffin=藍莓鬆糕 +Blueberry Pie=藍莓派 +Bottle of Ethanol=一瓶乙醇 +Bottle of Hemp Oil=一瓶大麻油 +Bowl of Chili=一碗辣椒 +Bread=麵包 +Bronze Hoe=青銅鋤頭 +#Cabbage= +#Cactus Juice= +Carrot=胡蘿蔔 +Carrot Juice=胡蘿蔔汁 +Chili Pepper=辣椒 +Chocolate Block=巧克力塊 +Chocolate Donut=巧克力甜甜圈 +Cocoa Beans=可可豆 +Coffee Beans=咖啡豆 +Cookie=曲奇 +Cooking Pot=鍋 +Corn=玉米 +Corn on the Cob=玉米棒 +Cornstarch=玉米澱粉 +Cotton=棉花 +Cotton Seed=棉籽 +Cucumber=黃瓜 +Cucumber and Potato Salad=黃瓜土豆沙拉 +Cup of Coffee=一杯咖啡 +Cutting Board=砧板 +Diamond Hoe=鑽石鋤 +Donut=甜甜圈 +Flour=麵粉 +Garlic=大蒜 +Garlic Braid=蒜辮 +Garlic Bread=蒜香麵包 +Garlic clove=蒜瓣 +Glass Mixing Bowl=攪拌杯 +Golden Carrot=金蘿蔔 +Grapes=葡萄 +Green Beans=青豆 +Ground Pepper=胡椒粉 +Hemp Block=麻塊 +Hemp Fibre=大麻纖維 +Hemp Leaf=大麻葉 +Hemp Rope=麻繩 +Hemp Seed=大麻籽 +Hoe=鋤頭 +Hoe Bomb (use or throw on grassy areas to hoe land)=鋤彈(在草地上使用或扔在鋤地上) +Jack 'O Lantern (punch to turn on and off)=南瓜燈(按一下開關) +Jaffa Cake=佳發餅 +Juicer=榨汁機 +Melon=甜瓜 +Melon Slice=西瓜片 +Mese Hoe=黃石鋤頭 +#Mint Leaf= +#Mint Seeds= +#Mint Tea= +Mithril Scythe (Right-click to harvest and replant crops)=祕銀鐮刀(右擊可收穫並重新種植作物) +Mortar and Pestle=研缽 +Multigrain Bread=雜糧麵包 +Multigrain Flour=多粒麵粉 +Oat seed=燕麥籽 +#Oats= +Onion=洋蔥 +#Onion Soup= +Orange=橙色 +#Pasta= +Pea Pod=豌豆莢 +Pea Soup=豌豆湯 +Peas=豌豆 +Pepper=胡椒粉 +Peppercorn=胡椒粉 +Pineapple=菠蘿 +Pineapple Juice=菠蘿汁 +Pineapple Ring=菠蘿圈 +Pineapple Top=菠蘿上衣 +Porridge=粥 +Potato=土豆 +Pumpkin=南瓜 +Pumpkin Bread=南瓜麵包 +Pumpkin Dough=南瓜麵糰 +Pumpkin Slice=南瓜片 +Raspberries=覆盆子 +Raspberry Smoothie=覆盆子冰沙 +Rhubarb=大黃 +Rhubarb Pie=大黃派 +Rice=大米 +Rice Bread=米飯麵包 +Rice Flour=米粉 +Rice grains=稻穀 +Rose Water=玫瑰汁 +Rye=黑麥 +Rye seed=黑麥種子 +Salt=鹽 +Saucepan=平底鍋 +#Savanna Soil= +Scarecrow Bottom=稻草人屁股 +Seed=種子 +Skillet=平底鍋 +Sliced Bread=切片面包 +Soil=土壤 +#Spaghetti= +Steel Hoe=鋼鋤頭 +Stone Hoe=石鋤 +Straw=稻草 +Strawberry=草莓 +String=線 +Sugar=糖 +Toast=烤麵包片 +Toast Sandwich=三明治麵包 +Tomato=番茄 +Trellis (place on soil before planting grapes)=棚架(種植葡萄前先放在土壤上) +Turkish Delight=土耳其軟糖 +#Wet Savanna Soil= +Wet Soil=溼土 +Wheat=小麥 +Wheat Seed=小麥種子 +#Wild Cotton= +Wooden Bowl=木碗 +Wooden Hoe=木鋤 diff --git a/mods/farming/locale/fr.txt b/mods/farming/locale/fr.txt new file mode 100644 index 0000000..04a5b1b --- /dev/null +++ b/mods/farming/locale/fr.txt @@ -0,0 +1,195 @@ +# Traduction Française du mod farming par TenPlus1 +# textdomain: farming +# author: Papaou30 +# author: TheDarkTiger +# last update: 2020/Apr/26 + +###### folder . ###### + +### init.lua ### +Seed=Graine + +### compatibility.lua ### +Banana=Banane +Banana Leaves=Feuilles de Banane +Orange=Orange +Strawberry=Fraise + +### food.lua ### +Sugar=Sucre +Salt=Sel +Rose Water=Eau de Rose +Turkish Delight=Douceur Turque +Garlic Bread=Pain à l'Ail +Donut=Beignet +Chocolate Donut=Beignet au chocolat +Apple Donut=Beignet aux pommes +Porridge=Gruau de céréales +Jaffa Cake=Petit gâteau à l'orange "Jaffa" + +### hoes.lua ### +Hoe=Binette +Wooden Hoe=Binette en Bois +Stone Hoe=Binette en Pierre +Steel Hoe=Binette en Acier +Bronze Hoe=Binette en Bronze +Mese Hoe=Binette en Mese +Diamond Hoe=Binette en Diamant +# Surcharge du mod [Toolranks] à faire # +Hoe Bomb (use or throw on grassy areas to hoe land)=Bombe à binnage (Actionner ou lancer sur une zone herbeuse pour la binner) +Mithril Scythe (Right-click to harvest and replant crops)=Faux en Mithril (Récolte et replante des graines) +# Surcharge du mod [Toolranks] à faire # + +### soil.lua ### +Soil=Sol binné +Wet Soil=Sol binné humide + +### utensils.lua ### +Wooden Bowl=Bol en Bois +Saucepan=Casserole +Cooking Pot=Fait-tout +Baking Tray=Lèche-frite +Skillet=Poêle +Mortar and Pestle=Mortier et Pilon +Cutting Board=Planche à découper +Juicer=Presse-agrumes +Glass Mixing Bowl=Terrine en Verre + + +###### folder ./crops ###### + +### barley.lua ### +Barley Seed=Graine d'Orge +Barley=Orge + +### beans.lua ### +Green Beans=Haricots verts +Bean Pole (place on soil before planting beans)=Tuteur pour haricots (placer sur le sol avant de planter des haricots) + +### beetroot.lua ### +Beetroot=Betrave +Beetroot Soup=Soupe de Betrave + +### blueberry.lua ### +Blueberries=Myrtilles +Blueberry Muffin=Muffin aux Myrtilles +Blueberry Pie=Tarte aux Myrtilles + +### carrot.lua ## +Carrot=Carotte +Carrot Juice=Jus de Carotte +Golden Carrot=Carotte dorée + +### chili.lua ### +Chili Pepper=Piment Rouge +Bowl of Chili=Assiette de Chilli + +### cocoa.lua ### +Cocoa Beans=Fèves de Cacao +Cookie=Cookie +Bar of Dark Chocolate=Tablette de Chocolat noir +Chocolate Block=Block de Chocolat + +### coffee.lua ### +Coffee Beans=Grains de café +Cup of Coffee=Tasse de café + +### corn.lua ### +Corn=Maïs +Corn on the Cob=Cobette (Maïs cuit) +Cornstarch=Fécule de Maïs +Bottle of Ethanol=Bouteille d'Éthanol + +### cotton.lua ### +Cotton Seed=Graines de Coton +Cotton=Coton +String=Ficelle + +### cucumber.lua ### +Cucumber=Concombre + +### garlic.lua ### +Garlic clove=Gousse d'Ail +Garlic=Tête d'Ail +Garlic Braid=Ail tressé + +### grapes.lua ### +Grapes=Raisins +Trellis (place on soil before planting grapes)=Treillis (placer sur le sol avant de planter la vigne) + +### hemp.lua ### +Hemp Seed=Graines de Chanvre +Hemp Leaf=Feuille de Chanvre +Bottle of Hemp Oil=Bouteille d'huile de Chanvre +Hemp Fibre=Fibre de Chanvre +Hemp Block=Bloc de Chanvre +Hemp Rope=Corde de Chanvre + +### melon.lua ### +Melon Slice=Tranche de Melon +Melon=Melon + +### onion.lua ### +Onion=Oignon + +### peas.lua ### +Pea Pod=Cosse de Petit-poids +Peas=Petit-poids +Pea Soup=Soupe de Petit-poids + +### pepper.lua ### +Peppercorn=Grain de Poivre +Pepper=Poivron +Ground Pepper=Poivre moulu + +### pinapple.lua ### +Pineapple Top=Pousse d'Ananas +Pineapple=Ananas +Pineapple Ring=Tranche d'Ananas +Pineapple Juice=Jus d'Ananas + +### potato.lua ### +Potato=Pomme de terre +Baked Potato=Pomme de terre cuite +Cucumber and Potato Salad=Salade de Pomme de terre au Concombre + +### pumpkin.lua ### +Pumpkin Slice=Tranche de Citrouille +Jack 'O Lantern (punch to turn on and off)=Jack 'O Lantern (Frapper pour allumer et éteindre) +Scarecrow Bottom=Base d'Epouventail +Pumpkin Bread=Pain à la Citrouille +Pumpkin Dough=Pâton de pain à la Citrouille +Pumpkin=Citrouille + +### raspberry.lua ### +Raspberries=Framboises +Raspberry Smoothie=Smoothie aux Framboises + +### rhubarb.lua ### +Rhubarb=Rhubarbe +Rhubarb Pie=Tarte à la rhubarbe + +### ryeoatrice.lua ### +Rye=Seigle +Rye seed=Grains de Seigle +Oat=Orge +Oat seed=Grains d'Orge +Rice=Riz +Rice grains=Grain de Riz +Rice Bread=Pain de Riz +Rice Flour=Farine de Riz +Multigrain Flour=Farine Multi-céréales +Multigrain Bread=Pain aux Céréales + +### tomato.lua ### +Tomato=Tomate + +### wheat.lua ### +Wheat Seed=Grain de blé +Wheat=Blé +Straw=Paille +Flour=Farine +Bread=Pain +Sliced Bread=Tranche de Pain +Toast=Pain Grillé +Toast Sandwich=Sandwich au Pain diff --git a/mods/farming/locale/it.txt b/mods/farming/locale/it.txt new file mode 100644 index 0000000..cbb6a2d --- /dev/null +++ b/mods/farming/locale/it.txt @@ -0,0 +1,194 @@ +# Translation of the farming mod by TenPlus1 +# textdomain: farming +# author: (Hamlet) +# last update: 2020/Jun/02 + +###### folder . ###### + +### init.lua ### +Seed=Seme + +### compatibility.lua ### +Banana=Banana +Banana Leaves=Foglie di banano +Orange=Arancia +Strawberry=Fragola + +### food.lua ### +Sugar=Zucchero +Salt=Sale +Rose Water=Acqua di rose +Turkish Delight=Lokum +Garlic Bread=Pane all'aglio +Donut=Ciambella +Chocolate Donut=Ciambella al cioccolato +Apple Donut=Ciambella alla mela +Porridge=Porridge +Jaffa Cake=Torta di jaffa + +### hoes.lua ### +Hoe=Zappa +Wooden Hoe=Zappa di legno +Stone Hoe=Zappa di pietra +Steel Hoe=Zappa d'acciaio +Bronze Hoe=Zappa di bronzo +Mese Hoe=Zappa di mese +Diamond Hoe=Zappa di diamante +# Surcharge du mod [Toolranks] à faire # +Hoe Bomb (use or throw on grassy areas to hoe land)=Bomba zappa (usala o lanciala sulle aree erbose per zappare il terreno) +Mithril Scythe (Right-click to harvest and replant crops)=Falce di mithril (clicca col destro per raccogliere e ripiantare le prose) +# Surcharge du mod [Toolranks] à faire # + +### soil.lua ### +Soil=Terreno coltivabile +Wet Soil=Terreno coltivabile bagnato + +### utensils.lua ### +Wooden Bowl=Ciotola di legno +Saucepan=Casseruola +Cooking Pot=Pentola da cottura +Baking Tray=Teglia da forno +Skillet=Padella +Mortar and Pestle=Mortaio e pestello +Cutting Board=Tagliere +Juicer=Spremiagrumi +Glass Mixing Bowl=Terrina di vetro + + +###### folder ./crops ###### + +### barley.lua ### +Barley Seed=Seme d'orzo +Barley=Orzo + +### beans.lua ### +Green Beans=Fagiolini +Bean Pole (place on soil before planting beans)=Palina per fagiolini (mettila sul terreno coltivabile prima di piantare i fagiolini) + +### beetroot.lua ### +Beetroot=Barbabietola +Beetroot Soup=Zuppa di barbabietola + +### blueberry.lua ### +Blueberries=Mirtilli +Blueberry Muffin=Focaccina di mirtilli +Blueberry Pie=Tortino di mirtilli + +### carrot.lua ## +Carrot=Carota +Carrot Juice=Succo di carota +Golden Carrot=Carota d'oro + +### chili.lua ### +Chili Pepper=Peperoncino +Bowl of Chili=Ciotola di peperoncino + +### cocoa.lua ### +Cocoa Beans=Chicchi di cacao +Cookie=Biscotto +Bar of Dark Chocolate=Barra di cioccolato fondente +Chocolate Block=Blocco di cioccolato + +### coffee.lua ### +Coffee Beans=Chicchi di caffè +Cup of Coffee=Tazza di caffè + +### corn.lua ### +Corn=Mais +Corn on the Cob=Pannocchia arrostita +Cornstarch=Amido di mais +Bottle of Ethanol=Bottiglia di alcol etilico + +### cotton.lua ### +Cotton Seed=Seme di cotone +Cotton=Cotone +String=Filo + +### cucumber.lua ### +Cucumber=Cetriolo + +### garlic.lua ### +Garlic clove=Spicchio d'aglio +Garlic=Aglio +Garlic Braid=Treccia d'aglio + +### grapes.lua ### +Grapes=Chicchi d'uva +Trellis (place on soil before planting grapes)=Graticcio (mettilo sul terreno coltivabile prima di piantare i chicchi d'uva) + +### hemp.lua ### +Hemp Seed=Seme di canapa +Hemp Leaf=Foglia di canapa +Bottle of Hemp Oil=Bottiglia d'olio di canapa +Hemp Fibre=Fibra di canapa +Hemp Block=Blocco di canapa +Hemp Rope=Corda di canapa + +### melon.lua ### +Melon Slice=Fetta d'anguria +Melon=Anguria + +### onion.lua ### +Onion=Cipolla + +### peas.lua ### +Pea Pod=Baccello di piselli +Peas=Piselli +Pea Soup=Zuppa di piselli + +### pepper.lua ### +Peppercorn=Grano di pepe +Pepper=Pepe +Ground Pepper=Pepe macinato + +### pinapple.lua ### +Pineapple Top=Cima d'ananas +Pineapple=Ananas +Pineapple Ring=Anello d'ananas +Pineapple Juice=Succo d'ananas + +### potato.lua ### +Potato=Patata +Baked Potato=Patata arrostita +Cucumber and Potato Salad=Insalata di patate e cetrioli + +### pumpkin.lua ### +Pumpkin Slice=Fetta di zucca +Jack 'O Lantern (punch to turn on and off)=Jack Lanterna (colpirlo per accenderlo e spegnerlo) +Scarecrow Bottom=Fondo dello spaventapasseri +Pumpkin Bread=Pane alla zucca +Pumpkin Dough=Pasta di zucca +Pumpkin=Zucca + +### raspberry.lua ### +Raspberries=Lamponi +Raspberry Smoothie=Purea di lamponi + +### rhubarb.lua ### +Rhubarb=Rabarbaro +Rhubarb Pie=Tortino al rabarbaro + +### ryeoatrice.lua ### +Rye=Segale +Rye seed=Seme di segale +Oat=Avena +Oat seed=Seme d'avena +Rice=Riso +Rice grains=Chicchi di riso +Rice Bread=Pane di riso +Rice Flour=Farina di riso +Multigrain Flour=Farina multicereale +Multigrain Bread=Pane multicereale + +### tomato.lua ### +Tomato=Pomodoro + +### wheat.lua ### +Wheat Seed=Seme di grano +Wheat=Grano +Straw=Paglia +Flour=Farina +Bread=Pane +Sliced Bread=Pane a fette +Toast=Pane tostato +Toast Sandwich=Panino di pane tostato diff --git a/mods/farming/locale/pt.txt b/mods/farming/locale/pt.txt new file mode 100644 index 0000000..a4c504c --- /dev/null +++ b/mods/farming/locale/pt.txt @@ -0,0 +1,195 @@ +# Portuguese translation of the farming mod by TenPlus1 +# textdomain: farming +# author: BrunoMine +# author: TheDarkTiger +# last update: 2020/Apr/26 + +###### folder . ###### + +### init.lua ### +Seed=Sementes + +### compatibility.lua ### +Banana= +Banana Leaves= +Orange= +Strawberry= + +### food.lua ### +Sugar=Açucar +Salt= +Rose Water= +Turkish Delight= +Garlic Bread= +Donut=Donut +Chocolate Donut=Donut de Chocolate +Apple Donut=Donut de Maça +Porridge= +Jaffa Cake= + +### hoes.lua ### +Hoe=Enxada +Wooden Hoe=Enxada de Madeira +Stone Hoe=Enxada de Pedra +Steel Hoe=Enxada de Aço +Bronze Hoe=Enxada de Bronze +Mese Hoe=Enxada de Mese +Diamond Hoe=Enxada de Diamante +# Surcharge du mod [Toolranks] à faire # +Hoe Bomb (use or throw on grassy areas to hoe land)= +Mithril Scythe (Right-click to harvest and replant crops)= +# Surcharge du mod [Toolranks] à faire # + +### soil.lua ### +Soil=Solo +Wet Soil=Solo Seco + +### utensils.lua ### +Wooden Bowl= +Saucepan= +Cooking Pot= +Baking Tray= +Skillet= +Mortar and Pestle= +Cutting Board= +Juicer= +Glass Mixing Bowl= + + +###### folder ./crops ###### + +### barley.lua ### +Barley Seed=Sementes de Cevada +Barley=Cevada + +### beans.lua ### +Green Beans=Feijoes Verdes +Bean Pole (place on soil before planting beans)=Apoio de feijao (coloque no solo antes de plantar feijao) + +### beetroot.lua ### +Beetroot= +Beetroot Soup= + +### blueberry.lua ### +Blueberries=Mirtilos +Blueberry Muffin=Muffin de Mirtilos +Blueberry Pie= + +### carrot.lua ## +Carrot=Cenoura +Carrot Juice= +Golden Carrot=Cenoura Dourada + +### chili.lua ### +Chili Pepper= +Bowl of Chili= + +### cocoa.lua ### +Cocoa Beans=Amendoas de Cacau +Cookie=Cookie +Bar of Dark Chocolate=Barra de Chocolate Preto +Chocolate Block= + +### coffee.lua ### +Coffee Beans=Grao de Cafe +Cup of Coffee=Xicara de Cafe + +### corn.lua ### +Corn=Milho +Corn on the Cob=Espiga de Milho +Cornstarch= +Bottle of Ethanol=Garrafa de Etanol + +### cotton.lua ### +Cotton Seed=Sementes de Algodao +Cotton=Algodao +String= + +### cucumber.lua ### +Cucumber=Pepino + +### garlic.lua ### +Garlic clove= +Garlic= +Garlic Braid= + +### grapes.lua ### +Grapes=Uvas +Trellis (place on soil before planting grapes)=Grade de Ripas (colocar no solo antes de plantar uvas) + +### hemp.lua ### +Hemp Seed=Sementes de Canhamo +Hemp Leaf=Folha de Canhamo +Bottle of Hemp Oil=Garrafa de Oleo de Canhamo +Hemp Fibre=Fibra de Canhamo +Hemp Block= +Hemp Rope=Corda de Canhamo + +### melon.lua ### +Melon Slice=Sementes de Melancia +Melon=Melancia + +### onion.lua ### +Onion= + +### peas.lua ### +Pea Pod= +Peas= +Pea Soup= + +### pepper.lua ### +Peppercorn= +Pepper= +Ground Pepper= + +### pinapple.lua ### +Pineapple Top= +Pineapple= +Pineapple Ring= +Pineapple Juice= + +### potato.lua ### +Potato=Batata +Baked Potato=Batata Cozida +Cucumber and Potato Salad= + +### pumpkin.lua ### +Pumpkin Slice=Pedaço de Abobora +Jack 'O Lantern (punch to turn on and off)=Jack 'O Lantern (Socos para ligar e desligar) +Scarecrow Bottom= +Pumpkin Bread=Pao de Abobora +Pumpkin Dough=Massa de Abobora +Pumpkin=Abobora + +### raspberry.lua ### +Raspberries=Framboesa +Raspberry Smoothie=Batida de Framboesa + +### rhubarb.lua ### +Rhubarb=Ruibarbo +Rhubarb Pie=Torta de Ruibarbo + +### ryeoatrice.lua ### +Rye= +Rye seed= +Oat= +Oat seed= +Rice= +Rice grains= +Rice Bread= +Rice Flour= +Multigrain Flour= +Multigrain Bread= + +### tomato.lua ### +Tomato=Tomate + +### wheat.lua ### +Wheat Seed=Sementes de Trigo +Wheat=Trigo +Straw=Palha +Flour=Farinha +Bread=Pao +Sliced Bread= +Toast= +Toast Sandwich= diff --git a/mods/farming/locale/ru.txt b/mods/farming/locale/ru.txt new file mode 100644 index 0000000..8a181f5 --- /dev/null +++ b/mods/farming/locale/ru.txt @@ -0,0 +1,212 @@ +# Russian translation of the farming mod by TenPlus1 +# textdomain: farming +# author: codexp +# author: TheDarkTiger +# author: YELLOW +# last update: 2020/Jun/20 + +###### folder . ###### + +### init.lua ### +Seed=Семена + +### compatibility.lua ### +Banana=Банан +Banana Leaves=Листья банана +Orange=Апельсин +Strawberry=Земляника + +### food.lua ### +Sugar=Сахар +Salt=Соль +Rose Water=Розовая вода +Turkish Delight=Рахат-лукум +Garlic Bread=Чесночный хлеб +Donut=Пончик +Chocolate Donut=Шоколадный пончик +Apple Donut=Яблочный пончик +Porridge=Каша +Jaffa Cake=Яффский пирог +Apple Pie=Яблочный пирог +Cactus Juice=Кактусовый сок + +### hoes.lua ### +Hoe=Мотыга +Wooden Hoe=Деревянная мотыга +Stone Hoe=Каменная мотыга +Steel Hoe=Стальная мотыга +Bronze Hoe=Бронзовая мотыга +Mese Hoe=Магическая мотыга +Diamond Hoe=Алмазная мотыга +# Surcharge du mod [Toolranks] à faire # +Hoe Bomb (use or throw on grassy areas to hoe land)=Мотыгобомба (используйте или бросьте на траву для ее обработки) +Mithril Scythe (Right-click to harvest and replant crops)=Мифриловая коса (Щелкните правой кнопкой мыши для сбора и пересадки растений) +# Surcharge du mod [Toolranks] à faire # +%s Hoe=%s мотыга +Silver=Серебряная +Mithril=Мифриловая +Silver Hoe=Серебряная +Mithril Hoe=Мифриловая + +### soil.lua ### +Soil=Земля +Wet Soil=Увлажненная земля +Savanna Soil=Земля саванны +Wet Savanna Soil=Увлажненная земля саванны + +### utensils.lua ### +Wooden Bowl=Деревянная миска +Saucepan=Кастрюля +Cooking Pot=Котел +Baking Tray=Противень +Skillet=Сковорода +Mortar and Pestle=Ступка и пестик +Cutting Board=Разделочная доска +Juicer=Соковыжималка +Glass Mixing Bowl=Стеклянная чаша + + +###### folder ./crops ###### + +### barley.lua ### +Barley Seed=Семена ячменя +Barley=Ячмень + +### beans.lua ### +Green Beans=Зеленая фасоль +Bean Pole (place on soil before planting beans)=Жердь для бобовых (установите на почву перед посадкой бобовых) + +### beetroot.lua ### +Beetroot=Свекла +Beetroot Soup=Борщ + +### blueberry.lua ### +Blueberries=Голубика +Blueberry Muffin=Кекс с голубикой +Blueberry Pie=Пирог с голубикой + +### carrot.lua ## +Carrot=Морковь +Carrot Juice=Морковный сок +Golden Carrot=Золотая морковь + +### chili.lua ### +Chili Pepper=Перец чили +Bowl of Chili=Миска чили + +### cocoa.lua ### +Cocoa Beans=Какао-бобы +Cookie=Печенье +Bar of Dark Chocolate=Плитка темного шоколада +Chocolate Block=Шоколадный блок + +### coffee.lua ### +Coffee Beans=Кофейные зерна +Cup of Coffee=Чашка кофе + +### corn.lua ### +Corn=Кукуруза +Corn on the Cob=Початок кукурузы +Cornstarch=Кукурузный крахмал +Bottle of Ethanol=Бутылка спирта + +### cotton.lua ### +Wild Cotton=Дикорастущий хлопок +Cotton Seed=Семена хлопка +Cotton=Хлопок +String=Нить + +### cucumber.lua ### +Cucumber=Огурец + +### garlic.lua ### +Garlic clove=Зубчик чеснока +Garlic=Чеснок +Garlic Braid=Связка чеснока + +### grapes.lua ### +Grapes=Виноград +Trellis (place on soil before planting grapes)=Решетка (поставьте на почву перед посадкой винограда) + +### hemp.lua ### +Hemp Seed=Семена конопли +Hemp Leaf=Лист конопли +Bottle of Hemp Oil=Бутылка конопляного масла +Hemp Fibre=Конопляное волокно +Hemp Block=Блок конопли +Hemp Rope=Пеньковая веревка + +### melon.lua ### +Melon Slice=Долька арбуза +Melon=Арбуз + +### mint.lua ### +Mint Seeds=Семена мяты +Mint Leaf=Лист мяты +Mint Tea=Чай с мятой + +### onion.lua ### +Onion=Лук +Onion Soup=Луковый суп + +### peas.lua ### +Pea Pod=Стручок гороха +Peas=Горох +Pea Soup=Гороховый суп + +### pepper.lua ### +Peppercorn=Перчинка +Pepper=Перец +Ground Pepper=Молотый перец + +### pinapple.lua ### +Pineapple Top=Верхушка ананаса +Pineapple=Ананас +Pineapple Ring=Кольцо ананаса +Pineapple Juice=Ананасовый сок + +### potato.lua ### +Potato=Картофель +Baked Potato=Печеный картофель +Cucumber and Potato Salad=Салат из огурцов и картофеля + +### pumpkin.lua ### +Pumpkin Slice=Ломтик тыквы +Jack 'O Lantern (punch to turn on and off)=Светильник джека (удар для включения и выключения) +Scarecrow Bottom=Основание пугала +Pumpkin Bread=Тыквенный хлеб +Pumpkin Dough=Тыквенное тесто +Pumpkin=Тыква + +### raspberry.lua ### +Raspberries=Малина +Raspberry Smoothie=Малиновый смузи + +### rhubarb.lua ### +Rhubarb=Ревень +Rhubarb Pie=Пирог с ревенем + +### ryeoatrice.lua ### +Rye=Рожь +Rye seed=Зёрна ржи +Oat=Овес +Oat seed=Семена овса +Rice grains=Зёрна риса +Rice=Рис +Rice Bread=Рисовый хлеб +Rice Flour=Рисовая мука +Multigrain Flour=Мультизерновая мука +Multigrain Bread=Мультизерновой хлеб + +### tomato.lua ### +Tomato=Помидор + +### wheat.lua ### +Wheat Seed=Зёрна пшеницы +Wheat=Пшеница +Straw=Солома +Flour=Мука +Bread=Хлеб +Sliced Bread=Нарезанный хлеб +Toast=Тост +Toast Sandwich=Сэндвич diff --git a/mods/farming/locale/template.txt b/mods/farming/locale/template.txt new file mode 100644 index 0000000..905d9e0 --- /dev/null +++ b/mods/farming/locale/template.txt @@ -0,0 +1,194 @@ +# Translation of the farming mod by TenPlus1 +# textdomain: farming +# author: (you) +# last update: 2020/Apr/26 + +###### folder . ###### + +### init.lua ### +Seed= + +### compatibility.lua ### +Banana= +Banana Leaves= +Orange= +Strawberry= + +### food.lua ### +Sugar= +Salt= +Rose Water= +Turkish Delight= +Garlic Bread= +Donut= +Chocolate Donut= +Apple Donut= +Porridge= +Jaffa Cake= + +### hoes.lua ### +Hoe= +Wooden Hoe= +Stone Hoe= +Steel Hoe= +Bronze Hoe= +Mese Hoe= +Diamond Hoe= +# Surcharge du mod [Toolranks] faire # +Hoe Bomb (use or throw on grassy areas to hoe land)= +Mithril Scythe (Right-click to harvest and replant crops)= +# Surcharge du mod [Toolranks] faire # + +### soil.lua ### +Soil= +Wet Soil= + +### utensils.lua ### +Wooden Bowl= +Saucepan= +Cooking Pot= +Baking Tray= +Skillet= +Mortar and Pestle= +Cutting Board= +Juicer= +Glass Mixing Bowl= + + +###### folder ./crops ###### + +### barley.lua ### +Barley Seed= +Barley= + +### beans.lua ### +Green Beans= +Bean Pole (place on soil before planting beans)= + +### beetroot.lua ### +Beetroot= +Beetroot Soup= + +### blueberry.lua ### +Blueberries= +Blueberry Muffin= +Blueberry Pie= + +### carrot.lua ## +Carrot= +Carrot Juice= +Golden Carrot= + +### chili.lua ### +Chili Pepper= +Bowl of Chili= + +### cocoa.lua ### +Cocoa Beans= +Cookie= +Bar of Dark Chocolate= +Chocolate Block= + +### coffee.lua ### +Coffee Beans= +Cup of Coffee= + +### corn.lua ### +Corn= +Corn on the Cob= +Cornstarch= +Bottle of Ethanol= + +### cotton.lua ### +Cotton Seed= +Cotton= +String= + +### cucumber.lua ### +Cucumber= + +### garlic.lua ### +Garlic clove= +Garlic= +Garlic Braid= + +### grapes.lua ### +Grapes= +Trellis (place on soil before planting grapes)= + +### hemp.lua ### +Hemp Seed= +Hemp Leaf= +Bottle of Hemp Oil= +Hemp Fibre= +Hemp Block= +Hemp Rope= + +### melon.lua ### +Melon Slice= +Melon= + +### onion.lua ### +Onion= + +### peas.lua ### +Pea Pod= +Peas= +Pea Soup= + +### pepper.lua ### +Peppercorn= +Pepper= +Ground Pepper= + +### pinapple.lua ### +Pineapple Top= +Pineapple= +Pineapple Ring= +Pineapple Juice= + +### potato.lua ### +Potato= +Baked Potato= +Cucumber and Potato Salad= + +### pumpkin.lua ### +Pumpkin Slice= +Jack 'O Lantern (punch to turn on and off)= +Scarecrow Bottom= +Pumpkin Bread= +Pumpkin Dough= +Pumpkin= + +### raspberry.lua ### +Raspberries= +Raspberry Smoothie= + +### rhubarb.lua ### +Rhubarb= +Rhubarb Pie= + +### ryeoatrice.lua ### +Rye= +Rye seed= +Oat= +Oat seed= +Rice= +Rice grains= +Rice Bread= +Rice Flour= +Multigrain Flour= +Multigrain Bread= + +### tomato.lua ### +Tomato= + +### wheat.lua ### +Wheat Seed= +Wheat= +Straw= +Flour= +Bread= +Sliced Bread= +Toast= +Toast Sandwich= diff --git a/mods/farming/locale/zh_CN.txt b/mods/farming/locale/zh_CN.txt new file mode 100644 index 0000000..2ec4e55 --- /dev/null +++ b/mods/farming/locale/zh_CN.txt @@ -0,0 +1,119 @@ +Seed=种子 +Banana=香蕉 +Banana Leaves=香蕉叶 +Orange=橙色 +Strawberry=草莓 +Sugar=糖 +Salt=盐 +Rose Water=玫瑰汁 +Turkish Delight=土耳其软糖 +Garlic Bread=蒜香面包 +Donut=甜甜圈 +Chocolate Donut=巧克力甜甜圈 +Apple Donut=苹果甜甜圈 +Porridge=粥 +Jaffa Cake=佳发饼 +Hoe=锄头 +Wooden Hoe=木锄 +Stone Hoe=石锄 +Steel Hoe=钢锄头 +Bronze Hoe=青铜锄头 +Mese Hoe=黄石锄头 +Diamond Hoe=钻石锄 +Hoe Bomb (use or throw on grassy areas to hoe land)=锄弹(在草地上使用或扔在锄地上) +Mithril Scythe (Right-click to harvest and replant crops)=秘银镰刀(右击可收获并重新种植作物) +Soil=土壤 +Wet Soil=湿土 +Wooden Bowl=木碗 +Saucepan=平底锅 +Cooking Pot=锅 +Baking Tray=烤盘 +Skillet=平底锅 +Mortar and Pestle=研钵 +Cutting Board=砧板 +Juicer=榨汁机 +Glass Mixing Bowl=搅拌杯 +Barley Seed=大麦种子 +Barley=大麦 +Green Beans=青豆 +Bean Pole (place on soil before planting beans)=豆杆(种豆前先放在土上) +Beetroot=甜菜根 +Beetroot Soup=甜菜根汤 +Blueberries=蓝莓 +Blueberry Muffin=蓝莓松糕 +Blueberry Pie=蓝莓派 +Carrot=胡萝卜 +Carrot Juice=胡萝卜汁 +Golden Carrot=金萝卜 +Chili Pepper=辣椒 +Bowl of Chili=一碗辣椒 +Cocoa Beans=可可豆 +Cookie=曲奇 +Bar of Dark Chocolate=黑巧克力条 +Chocolate Block=巧克力块 +Coffee Beans=咖啡豆 +Cup of Coffee=一杯咖啡 +Corn=玉米 +Corn on the Cob=玉米棒 +Cornstarch=玉米淀粉 +Bottle of Ethanol=一瓶乙醇 +Cotton Seed=棉籽 +Cotton=棉花 +String=线 +Cucumber=黄瓜 +Garlic clove=蒜瓣 +Garlic=大蒜 +Garlic Braid=蒜辫 +Grapes=葡萄 +Trellis (place on soil before planting grapes)=棚架(种植葡萄前先放在土壤上) +Hemp Seed=大麻籽 +Hemp Leaf=大麻叶 +Bottle of Hemp Oil=一瓶大麻油 +Hemp Fibre=大麻纤维 +Hemp Block=麻块 +Hemp Rope=麻绳 +Melon Slice=西瓜片 +Melon=甜瓜 +Onion=洋葱 +Pea Pod=豌豆荚 +Peas=豌豆 +Pea Soup=豌豆汤 +Peppercorn=胡椒粉 +Pepper=胡椒粉 +Ground Pepper=胡椒粉 +Pineapple Top=菠萝上衣 +Pineapple=菠萝 +Pineapple Ring=菠萝圈 +Pineapple Juice=菠萝汁 +Potato=土豆 +Baked Potato=焗马铃薯 +Cucumber and Potato Salad=黄瓜土豆沙拉 +Pumpkin Slice=南瓜片 +Jack 'O Lantern (punch to turn on and off)=杰克灯(按一下开关) +Scarecrow Bottom=稻草人屁股 +Pumpkin Bread=南瓜面包 +Pumpkin Dough=南瓜面团 +Pumpkin=南瓜 +Raspberries=覆盆子 +Raspberry Smoothie=覆盆子冰沙 +Rhubarb=大黄 +Rhubarb Pie=大黄派 +Rye=黑麦 +Rye seed=黑麦种子 +Oat=燕麦 +Oat seed=燕麦籽 +Rice=大米 +Rice grains=稻谷 +Rice Bread=米饭面包 +Rice Flour=米粉 +Multigrain Flour=多粒面粉 +Multigrain Bread=杂粮面包 +Tomato=番茄 +Wheat Seed=小麦种子 +Wheat=小麦 +Straw=稻草 +Flour=面粉 +Bread=面包 +Sliced Bread=切片面包 +Toast=烤面包片 +Toast Sandwich=三明治面包 diff --git a/mods/farming/locale/zh_TW.txt b/mods/farming/locale/zh_TW.txt new file mode 100644 index 0000000..5bd109b --- /dev/null +++ b/mods/farming/locale/zh_TW.txt @@ -0,0 +1,119 @@ +Seed=種子 +Banana=香蕉 +Banana Leaves=香蕉葉 +Orange=橙色 +Strawberry=草莓 +Sugar=糖 +Salt=鹽 +Rose Water=玫瑰汁 +Turkish Delight=土耳其軟糖 +Garlic Bread=蒜香麵包 +Donut=甜甜圈 +Chocolate Donut=巧克力甜甜圈 +Apple Donut=蘋果甜甜圈 +Porridge=粥 +Jaffa Cake=佳發餅 +Hoe=鋤頭 +Wooden Hoe=木鋤 +Stone Hoe=石鋤 +Steel Hoe=鋼鋤頭 +Bronze Hoe=青銅鋤頭 +Mese Hoe=黃石鋤頭 +Diamond Hoe=鑽石鋤 +Hoe Bomb (use or throw on grassy areas to hoe land)=鋤彈(在草地上使用或扔在鋤地上) +Mithril Scythe (Right-click to harvest and replant crops)=祕銀鐮刀(右擊可收穫並重新種植作物) +Soil=土壤 +Wet Soil=溼土 +Wooden Bowl=木碗 +Saucepan=平底鍋 +Cooking Pot=鍋 +Baking Tray=烤盤 +Skillet=平底鍋 +Mortar and Pestle=研缽 +Cutting Board=砧板 +Juicer=榨汁機 +Glass Mixing Bowl=攪拌杯 +Barley Seed=大麥種子 +Barley=大麥 +Green Beans=青豆 +Bean Pole (place on soil before planting beans)=豆杆(種豆前先放在土上) +Beetroot=甜菜根 +Beetroot Soup=甜菜根湯 +Blueberries=藍莓 +Blueberry Muffin=藍莓鬆糕 +Blueberry Pie=藍莓派 +Carrot=胡蘿蔔 +Carrot Juice=胡蘿蔔汁 +Golden Carrot=金蘿蔔 +Chili Pepper=辣椒 +Bowl of Chili=一碗辣椒 +Cocoa Beans=可可豆 +Cookie=曲奇 +Bar of Dark Chocolate=黑巧克力條 +Chocolate Block=巧克力塊 +Coffee Beans=咖啡豆 +Cup of Coffee=一杯咖啡 +Corn=玉米 +Corn on the Cob=玉米棒 +Cornstarch=玉米澱粉 +Bottle of Ethanol=一瓶乙醇 +Cotton Seed=棉籽 +Cotton=棉花 +String=字符串 +Cucumber=黃瓜 +Garlic clove=蒜瓣 +Garlic=大蒜 +Garlic Braid=蒜辮 +Grapes=葡萄 +Trellis (place on soil before planting grapes)=棚架(種植葡萄前先放在土壤上) +Hemp Seed=大麻籽 +Hemp Leaf=大麻葉 +Bottle of Hemp Oil=一瓶大麻油 +Hemp Fibre=大麻纖維 +Hemp Block=麻塊 +Hemp Rope=麻繩 +Melon Slice=西瓜片 +Melon=甜瓜 +Onion=洋蔥 +Pea Pod=豌豆莢 +Peas=豌豆 +Pea Soup=豌豆湯 +Peppercorn=胡椒粉 +Pepper=胡椒粉 +Ground Pepper=胡椒粉 +Pineapple Top=菠蘿上衣 +Pineapple=菠蘿 +Pineapple Ring=菠蘿圈 +Pineapple Juice=菠蘿汁 +Potato=土豆 +Baked Potato=焗馬鈴薯 +Cucumber and Potato Salad=黃瓜土豆沙拉 +Pumpkin Slice=南瓜片 +Jack 'O Lantern (punch to turn on and off)=傑克燈(按一下開關) +Scarecrow Bottom=稻草人屁股 +Pumpkin Bread=南瓜麵包 +Pumpkin Dough=南瓜麵糰 +Pumpkin=南瓜 +Raspberries=覆盆子 +Raspberry Smoothie=覆盆子冰沙 +Rhubarb=大黃 +Rhubarb Pie=大黃派 +Rye=黑麥 +Rye seed=黑麥種子 +Oat=燕麥 +Oat seed=燕麥籽 +Rice=大米 +Rice grains=稻穀 +Rice Bread=米飯麵包 +Rice Flour=米粉 +Multigrain Flour=多粒麵粉 +Multigrain Bread=雜糧麵包 +Tomato=番茄 +Wheat Seed=小麥種子 +Wheat=小麥 +Straw=稻草 +Flour=麵粉 +Bread=麵包 +Sliced Bread=切片面包 +Toast=烤麵包片 +Toast Sandwich=三明治麵包 \ No newline at end of file diff --git a/mods/farming/lucky_block.lua b/mods/farming/lucky_block.lua new file mode 100644 index 0000000..c6a2000 --- /dev/null +++ b/mods/farming/lucky_block.lua @@ -0,0 +1,79 @@ + +-- add lucky blocks + +if minetest.get_modpath("lucky_block") then + + lucky_block:add_blocks({ + {"dro", {"farming:corn"}, 5}, + {"dro", {"farming:coffee_cup_hot"}, 1}, + {"dro", {"farming:bread"}, 5}, + {"nod", "farming:jackolantern", 0}, + {"tro", "farming:jackolantern_on"}, + {"nod", "default:river_water_source", 1}, + {"tel"}, + {"dro", {"farming:trellis", "farming:grapes"}, 5}, + {"dro", {"farming:bottle_ethanol"}, 1}, + {"nod", "farming:melon", 0}, + {"dro", {"farming:donut", "farming:donut_chocolate", "farming:donut_apple"}, 5}, + {"dro", {"farming:hemp_leaf", "farming:hemp_fibre", "farming:seed_hemp"}, 10}, + {"nod", "fire:permanent_flame", 1}, + {"dro", {"farming:chili_pepper", "farming:chili_bowl"}, 5}, + {"dro", {"farming:bowl"}, 3}, + {"dro", {"farming:saucepan"}, 1}, + {"dro", {"farming:pot"}, 1}, + {"dro", {"farming:baking_tray"}, 1}, + {"dro", {"farming:skillet"}, 1}, + {"exp", 4}, + {"dro", {"farming:mortar_pestle"}, 1}, + {"dro", {"farming:cutting_board"}, 1}, + {"dro", {"farming:juicer"}, 1}, + {"dro", {"farming:mixing_bowl"}, 1}, + {"dro", {"farming:hoe_bronze"}, 1}, + {"dro", {"farming:hoe_mese"}, 1}, + {"dro", {"farming:hoe_diamond"}, 1}, + {"dro", {"farming:hoe_bomb"}, 10}, + {"dro", {"farming:turkish_delight"}, 5}, + {"lig"}, + {"dro", {"farming:scythe_mithril"}, 1}, + {"sch", "instafarm", 0, true, { + {"farming:wheat_8", "farming:carrot_8"}, + {"farming:cotton_8", "farming:rhubarb_3"}, + }}, + {"sch", "instafarm", 0, true, { + {"farming:wheat_8", "farming:pepper_5"}, + {"farming:cotton_8", "farming:onion_5"}, + }}, + {"sch", "instafarm", 0, true, { + {"farming:wheat_8", "farming:beetroot_5"}, + {"farming:cotton_8", "farming:barley_7"}, + }}, + {"sch", "instafarm", 0, true, { + {"farming:wheat_8", "farming:corn_8"}, + {"farming:cotton_8", "farming:grapes_8"}, + }}, + {"sch", "instafarm", 0, true, { + {"farming:wheat_8", "farming:pea_5"}, + {"farming:cotton_8", "farming:coffee_5"}, + }}, + {"sch", "instafarm", 0, true, { + {"farming:wheat_8", "farming:raspberry_4"}, + {"farming:cotton_8", "farming:tomato_8"}, + }}, + {"sch", "instafarm", 0, true, { + {"farming:wheat_8", "farming:chili_8"}, + {"farming:cotton_8", "farming:cucumber_4"}, + }}, + {"nod", "default:chest", 0, { + {name = "farming:seed_wheat", max = 15}, + {name = "farming:seed_barley", max = 15}, + {name = "farming:seed_barley", max = 15}, + {name = "farming:seed_hemp", max = 15}, + {name = "farming:seed_rye", max = 15}, + {name = "farming:seed_rice", max = 15}, + {name = "farming:seed_oat", max = 15}, + {name = "farming:soil_wet", max = 10}, + {name = "farming:cotton_wild", max = 5}, + {name = "farming:grapebush", max = 5}, + }}, + }) +end diff --git a/mods/farming/mapgen.lua b/mods/farming/mapgen.lua new file mode 100644 index 0000000..fce941d --- /dev/null +++ b/mods/farming/mapgen.lua @@ -0,0 +1,240 @@ +-- what mapgen are we using +local mg_name = minetest.get_mapgen_setting("mg_name") + +-- temp vars +local tmp1, tmp2, tmp3 + +-- decoration function +local function register_plant(name, min, max, spawnon, spawnby, num, rarety) + + -- do not place on mapgen if no value given (or not true) + if not rarety then + return + end + + -- set rarety value or default to farming.rarety if not a number + rarety = tonumber(rarety) or farming.rarety + + minetest.register_decoration({ + deco_type = "simple", + place_on = spawnon or {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = rarety, + spread = {x = 120, y = 120, z = 120}, + seed = 329, + octaves = 2, + persist = 0.6 + }, + y_min = min, + y_max = max, + decoration = "farming:" .. name, + spawn_by = spawnby, + num_spawn_by = num + }) +end + + +-- add crops to mapgen +register_plant("potato_3", 1, 80, nil, "", -1, farming.potato) +register_plant("tomato_7", 5, 40, nil, "", -1, farming.tomato) +register_plant("corn_7", 1, 42, nil, "", -1, farming.corn) +register_plant("raspberry_4", 3, 20, nil, "", -1, farming.raspberry) +register_plant("rhubarb_3", 3, 25, nil, "", -1, farming.rhubarb) +register_plant("blueberry_4", 3, 20, nil, "", -1, farming.blueberry) +register_plant("beanbush", 1, 65, nil, "", -1, farming.beans) +register_plant("grapebush", 2, 85, nil, "", -1, farming.grapes) +register_plant("onion_5", 5, 42, nil, "", -1, farming.onion) +register_plant("garlic_5", 3, 60, nil, "group:tree", 1, farming.garlic) +register_plant("pea_5", 5, 100, nil, "", -1, farming.peas) +register_plant("beetroot_5", 1, 25, nil, "", -1, farming.beetroot) +register_plant("cabbage_6", 2, 20, nil, "", -1, farming.cabbage) +register_plant("lettuce_5", 5, 60, nil, "", -1, farming.lettuce) +register_plant("blackberry_4", 3, 20, nil, "", -1, farming.blackberry) +register_plant("vanilla_7", 5, 65, nil, "", -1, farming.vanilla) +register_plant("parsley_3", 1, 80, nil, "", -1, farming.parsley) +register_plant("sunflower_8", 1, 80, nil, "", -1, farming.sunflower) +register_plant("mint_4", 1, 145, { + "default:dirt_with_grass", "default:dirt_with_coniferous_litter"}, + "group:water", 1, farming.mint) + + +-- v6 mapgen compatibility for specific crops +if mg_name == "v6" then + + register_plant("carrot_8", 1, 60, nil, "group:water", 1, farming.carrot) + register_plant("cucumber_4", 1, 40, nil, "group:water", 1, farming.cucumber) + register_plant("melon_8", 1, 40, nil, "group:water", 1, farming.melon) + register_plant("pumpkin_8", 1, 40, nil, "group:water", 1, farming.pumpkin) + register_plant("coffee_5", 10, 85, nil, "", -1, farming.coffee) + register_plant("soy_6", 10, 100, nil, "", -1, farming.soy) +else + -- v7 maps have a beach so plants growing near water is limited to 6 high + register_plant("carrot_8", 1, 25, nil, "", -1, farming.carrot) + register_plant("cucumber_4", 1, 20, nil, "", -1, farming.cucumber) + register_plant("melon_8", 1, 12, {"default:dirt_with_dry_grass", + "default:dirt_with_rainforest_litter"}, "", -1, farming.melon) + register_plant("pumpkin_8", 1, 12, nil, "", -1, farming.pumpkin) + register_plant("coffee_5", 10, 85, {"default:dirt_with_dry_grass", + "default:dirt_with_rainforest_litter", + "default:dry_dirt_with_dry_grass"}, "", -1, farming.coffee) + register_plant("soy_6", 10, 100, {"default:dirt_with_dry_grass", + "default:dirt_with_rainforest_litter", + "default:dry_dirt_with_dry_grass"}, "", -1, farming.soy) +end + + +if farming.hemp 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 = tonumber(farming.hemp) or farming.rarety, + spread = {x = 110, y = 110, z = 110}, + seed = 420, + octaves = 3, + persist = 0.6 + }, + y_min = 3, + y_max = 45, + decoration = "farming:hemp_7", + spawn_by = "group:tree", + 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 = tonumber(farming.chili) or farming.rarety, + spread = {x = 110, y = 110, z = 110}, + 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 + + +if farming.artichoke then +minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = tonumber(farming.artichoke) or farming.rarety, + spread = {x = 110, y = 110, z = 110}, + seed = 448, + octaves = 3, + persist = 0.6 + }, + y_min = 1, + y_max = 13, + decoration = {"farming:artichoke_5"}, + spawn_by = "group:tree", + num_spawn_by = 1, +}) +end + + +if farming.pepper then + +local tmp1 = {"default:dirt_with_rainforest_litter"} -- v7 + +if mg_name == "v6" then + tmp1 = {"default:dirt_with_grass"} -- v6 +end + +minetest.register_decoration({ + deco_type = "simple", + place_on = tmp1, + sidelen = 16, + noise_params = { + offset = 0, + scale = tonumber(farming.pepper) or farming.rarety, + spread = {x = 100, y = 100, z = 100}, + seed = 933, + octaves = 3, + persist = 0.6 + }, + y_min = 5, + y_max = 35, + decoration = {"farming:pepper_5", "farming:pepper_6", "farming:pepper_7"}, + spawn_by = "group:tree", + num_spawn_by = 1 +}) +end + + +if farming.pineapple then + +tmp1 = {"default:dirt_with_dry_grass", "default:dry_dirt_with_dry_grass"} +tmp2 = nil +tmp3 = -1 + +if mg_name == "v6" then + tmp1 = {"default:dirt_with_grass"} + tmp2 = "default:desert_sand" + tmp3 = 1 +end + +minetest.register_decoration({ + deco_type = "simple", + place_on = tmp1, + sidelen = 16, + noise_params = { + offset = 0, + scale = tonumber(farming.pineapple) or farming.rarety, + spread = {x = 70, y = 70, z = 70}, + seed = 917, + octaves = 3, + persist = 0.6 + }, + y_min = 8, + y_max = 30, + decoration = {"farming:pineapple_8"}, + spawn_by = tmp2, + num_spawn_by = tmp3 +}) +end + +tmp1 = {"default:dry_dirt_with_dry_grass"} +tmp2 = {"savanna"} + +if mg_name == "v6" then + tmp1 = {"default:dirt_with_grass"} + tmp2 = {"jungle"} +end + +minetest.register_decoration({ + name = "farming:cotton_wild", + deco_type = "simple", + place_on = tmp1, + sidelen = 16, + noise_params = { + offset = -0.1, + scale = 0.1, + spread = {x = 150, y = 150, z = 150}, + seed = 4242, + octaves = 4, + persist = 0.7 + }, + biomes = tmp2, + y_max = 31000, + y_min = 1, + decoration = "farming:cotton_wild" +}) diff --git a/mods/farming/mod.conf b/mods/farming/mod.conf new file mode 100644 index 0000000..bc6a919 --- /dev/null +++ b/mods/farming/mod.conf @@ -0,0 +1,4 @@ +name = farming +depends = default +optional_depends = stairs, intllib, lucky_block, toolranks +description = Adds many plants and food to Minetest diff --git a/mods/farming/nodes.lua b/mods/farming/nodes.lua deleted file mode 100644 index 1e746ec..0000000 --- a/mods/farming/nodes.lua +++ /dev/null @@ -1,181 +0,0 @@ -minetest.override_item("default:dirt", { - soil = { - base = "default:dirt", - dry = "farming:soil", - wet = "farming:soil_wet" - } -}) - -minetest.override_item("default:dirt_with_grass", { - soil = { - base = "default:dirt_with_grass", - dry = "farming:soil", - wet = "farming:soil_wet" - } -}) - -minetest.override_item("default:dirt_with_dry_grass", { - soil = { - base = "default:dirt_with_dry_grass", - dry = "farming:soil", - wet = "farming:soil_wet" - } -}) - -minetest.override_item("default:dirt_with_rainforest_litter", { - soil = { - base = "default:dirt_with_rainforest_litter", - dry = "farming:soil", - wet = "farming:soil_wet" - } -}) - -minetest.register_node("farming:soil", { - description = "Soil", - tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"}, - drop = "default:dirt", - groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1}, - sounds = default.node_sound_dirt_defaults(), - soil = { - base = "default:dirt", - dry = "farming:soil", - wet = "farming:soil_wet" - } -}) - -minetest.register_node("farming:soil_wet", { - description = "Wet Soil", - tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png^farming_soil_wet_side.png"}, - drop = "default:dirt", - groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1}, - sounds = default.node_sound_dirt_defaults(), - soil = { - base = "default:dirt", - dry = "farming:soil", - wet = "farming:soil_wet" - } -}) - -minetest.override_item("default:desert_sand", { - groups = {crumbly=3, falling_node=1, sand=1, soil = 1}, - soil = { - base = "default:desert_sand", - dry = "farming:desert_sand_soil", - wet = "farming:desert_sand_soil_wet" - } -}) -minetest.register_node("farming:desert_sand_soil", { - description = "Desert Sand Soil", - drop = "default:desert_sand", - tiles = {"farming_desert_sand_soil.png", "default_desert_sand.png"}, - groups = {crumbly=3, not_in_creative_inventory = 1, falling_node=1, sand=1, soil = 2, desert = 1, field = 1}, - sounds = default.node_sound_sand_defaults(), - soil = { - base = "default:desert_sand", - dry = "farming:desert_sand_soil", - wet = "farming:desert_sand_soil_wet" - } -}) - -minetest.register_node("farming:desert_sand_soil_wet", { - description = "Wet Desert Sand Soil", - drop = "default:desert_sand", - tiles = {"farming_desert_sand_soil_wet.png", "farming_desert_sand_soil_wet_side.png"}, - groups = {crumbly=3, falling_node=1, sand=1, not_in_creative_inventory=1, soil=3, wet = 1, desert = 1, field = 1}, - sounds = default.node_sound_sand_defaults(), - soil = { - base = "default:desert_sand", - dry = "farming:desert_sand_soil", - wet = "farming:desert_sand_soil_wet" - } -}) - -minetest.register_node("farming:straw", { - description = "Straw", - tiles = {"farming_straw.png"}, - is_ground_content = false, - groups = {snappy=3, flammable=4, fall_damage_add_percent=-30}, - sounds = default.node_sound_leaves_defaults(), -}) - -stairs.register_stair_and_slab( - "straw", - "farming:straw", - {snappy = 3, flammable = 4}, - {"farming_straw.png"}, - "Straw Stair", - "Straw Slab", - default.node_sound_leaves_defaults() -) - -minetest.register_abm({ - label = "Farming soil", - nodenames = {"group:field"}, - interval = 15, - chance = 4, - action = function(pos, node) - local n_def = minetest.registered_nodes[node.name] or nil - local wet = n_def.soil.wet or nil - local base = n_def.soil.base or nil - local dry = n_def.soil.dry or nil - if not n_def or not n_def.soil or not wet or not base or not dry then - return - end - - pos.y = pos.y + 1 - local nn = minetest.get_node_or_nil(pos) - if not nn or not nn.name then - return - end - local nn_def = minetest.registered_nodes[nn.name] or nil - pos.y = pos.y - 1 - - if nn_def and nn_def.walkable and minetest.get_item_group(nn.name, "plant") == 0 then - minetest.set_node(pos, {name = base}) - return - end - -- check if there is water nearby - local wet_lvl = minetest.get_item_group(node.name, "wet") - if minetest.find_node_near(pos, 3, {"group:water"}) then - -- if it is dry soil and not base node, turn it into wet soil - if wet_lvl == 0 then - minetest.set_node(pos, {name = wet}) - end - else - -- only turn back if there are no unloaded blocks (and therefore - -- possible water sources) nearby - if not minetest.find_node_near(pos, 3, {"ignore"}) then - -- turn it back into base if it is already dry - if wet_lvl == 0 then - -- only turn it back if there is no plant/seed on top of it - if minetest.get_item_group(nn.name, "plant") == 0 and minetest.get_item_group(nn.name, "seed") == 0 then - minetest.set_node(pos, {name = base}) - end - - -- if its wet turn it back into dry soil - elseif wet_lvl == 1 then - minetest.set_node(pos, {name = dry}) - end - end - end - end, -}) - - -for i = 1, 5 do - minetest.override_item("default:grass_"..i, {drop = { - max_items = 1, - items = { - {items = {'farming:seed_wheat'},rarity = 5}, - {items = {'default:grass_1'}}, - } - }}) -end - -minetest.override_item("default:junglegrass", {drop = { - max_items = 1, - items = { - {items = {'farming:seed_cotton'},rarity = 8}, - {items = {'default:junglegrass'}}, - } -}}) diff --git a/mods/farming/screenshot.png b/mods/farming/screenshot.png new file mode 100644 index 0000000..aba30f0 Binary files /dev/null and b/mods/farming/screenshot.png differ diff --git a/mods/farming/settingtypes.txt b/mods/farming/settingtypes.txt new file mode 100644 index 0000000..05f50af --- /dev/null +++ b/mods/farming/settingtypes.txt @@ -0,0 +1,2 @@ +# Contains a value used for speed of crop growth in seconds +farming_stage_length (Farming Stage Length) float 160.0 diff --git a/mods/farming/soil.lua b/mods/farming/soil.lua new file mode 100644 index 0000000..4363323 --- /dev/null +++ b/mods/farming/soil.lua @@ -0,0 +1,160 @@ + +local S = farming.intllib + + +-- default dry soil node +local dry_soil = "farming:soil" + + +-- add soil types to existing dirt blocks +minetest.override_item("default:dirt", { + soil = { + base = "default:dirt", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +minetest.override_item("default:dirt_with_grass", { + soil = { + base = "default:dirt_with_grass", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +minetest.override_item("default:dirt_with_dry_grass", { + soil = { + base = "default:dirt_with_dry_grass", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +minetest.override_item("default:dirt_with_rainforest_litter", { + soil = { + base = "default:dirt_with_rainforest_litter", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +if not minetest.registered_nodes[":default:dirt_with_coniferous_litter"] then + minetest.register_alias("default:dirt_with_coniferous_litter", "default:dirt_with_dry_grass") +end +minetest.override_item("default:dirt_with_coniferous_litter", { + soil = { + base = "default:dirt_with_dry_grass", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +if not minetest.registered_nodes[":default:dry_dirt"] then + minetest.register_alias("default:dry_dirt", "default:dirt") +end +minetest.override_item("default:dry_dirt", { + soil = { + base = "default:dirt", + dry = "farming:dry_soil", + wet = "farming:dry_soil_wet" + } +}) + +if not minetest.registered_nodes[":default:dry_dirt_with_dry_grass"] then + minetest.register_alias("default:dry_dirt_with_dry_grass", "default:dirt_with_dry_grass") +end +minetest.override_item("default:dry_dirt_with_dry_grass", { + soil = { + base = "default:dirt_with_dry_grass", + dry = "farming:dry_soil", + wet = "farming:dry_soil_wet" + } +}) + +-- normal soil +minetest.register_node("farming:soil", { + description = S("Soil"), + tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"}, + drop = "default:dirt", + groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 2, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "default:dirt", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +-- wet soil +minetest.register_node("farming:soil_wet", { + description = S("Wet Soil"), + tiles = { + "default_dirt.png^farming_soil_wet.png", + "default_dirt.png^farming_soil_wet_side.png" + }, + drop = "default:dirt", + groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 3, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "default:dirt", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + + +-- sand is not soil, change existing sand-soil to use dry soil +minetest.register_alias("farming:desert_sand_soil", dry_soil) +minetest.register_alias("farming:desert_sand_soil_wet", dry_soil .. "_wet") + + +-- if water near soil then change to wet soil +minetest.register_abm({ + nodenames = {"group:field"}, + interval = 15, + chance = 4, + catch_up = false, + + action = function(pos, node) + + local ndef = minetest.registered_nodes[node.name] + if not ndef or not ndef.soil or not ndef.soil.wet + or not ndef.soil.base or not ndef.soil.dry then return end + + pos.y = pos.y + 1 + local nn = minetest.get_node_or_nil(pos) + pos.y = pos.y - 1 + + if nn then nn = nn.name else return end + + -- what's on top of soil, if solid/not plant change soil to dirt + if minetest.registered_nodes[nn] + and minetest.registered_nodes[nn].walkable + and minetest.get_item_group(nn, "plant") == 0 then + minetest.set_node(pos, {name = ndef.soil.base}) + return + end + + -- if map around soil not loaded then skip until loaded + if minetest.find_node_near(pos, 3, {"ignore"}) then + return + end + + -- check if water is within 3 nodes horizontally and 1 below + if #minetest.find_nodes_in_area( + {x = pos.x + 3, y = pos.y - 1, z = pos.z + 3}, + {x = pos.x - 3, y = pos.y , z = pos.z - 3}, + {"group:water"}) > 0 then + + minetest.set_node(pos, {name = ndef.soil.wet}) + + elseif node.name == ndef.soil.wet then + minetest.set_node(pos, {name = ndef.soil.dry}) + + elseif node.name == ndef.soil.dry + and minetest.get_item_group(nn, "plant") == 0 then + minetest.set_node(pos, {name = ndef.soil.base}) + end + end +}) diff --git a/mods/farming/statistics.lua b/mods/farming/statistics.lua new file mode 100644 index 0000000..b892867 --- /dev/null +++ b/mods/farming/statistics.lua @@ -0,0 +1,185 @@ +local statistics = {} +local ROOT_2 = math.sqrt(2.0) + +-- Approximations for erf(x) and erfInv(x) from +-- https://en.wikipedia.org/wiki/Error_function + +local erf +local erf_inv + +local A = 8 * (math.pi - 3.0)/(3.0 * math.pi * (4.0 - math.pi)) +local B = 4.0 / math.pi +local C = 2.0/(math.pi * A) +local D = 1.0 / A + + +erf = function(x) + + if x == 0 then return 0; end + + local xSq = x * x + local aXSq = A * xSq + local v = math.sqrt(1.0 - math.exp(-xSq * (B + aXSq) / (1.0 + aXSq))) + + return (x > 0 and v) or -v +end + + +erf_inv = function(x) + + if x == 0 then return 0; end + + if x <= -1 or x >= 1 then return nil; end + + local y = math.log(1 - x * x) + local u = C + 0.5 * y + local v = math.sqrt(math.sqrt(u * u - D * y) - u) + + return (x > 0 and v) or -v +end + + +local function std_normal(u) + return ROOT_2 * erf_inv(2.0 * u - 1.0) +end + + +local poisson +local cdf_table = {} + + +local function generate_cdf(lambda_index, lambda) + + local max = math.ceil(4 * lambda) + local pdf = math.exp(-lambda) + local cdf = pdf + local t = { [0] = pdf } + + for i = 1, max - 1 do + pdf = pdf * lambda / i + cdf = cdf + pdf + t[i] = cdf + end + + return t +end + + +for li = 1, 100 do + cdf_table[li] = generate_cdf(li, 0.25 * li) +end + + +poisson = function(lambda, max) + + if max < 2 then + return (math.random() < math.exp(-lambda) and 0) or 1 + elseif lambda >= 2 * max then + return max + end + + local u = math.random() + local lambda_index = math.floor(4 * lambda + 0.5) + local cdfs = cdf_table[lambda_index] + + if cdfs then + + lambda = 0.25 * lambda_index + + if u < cdfs[0] then return 0; end + if max > #cdfs then max = #cdfs + 1 else max = math.floor(max); end + if u >= cdfs[max - 1] then return max; end + + if max > 4 then -- Binary search + + local s = 0 + + while s + 1 < max do + + local m = math.floor(0.5 * (s + max)) + + if u < cdfs[m] then max = m; else s = m; end + end + else + for i = 1, max - 1 do + if u < cdfs[i] then return i; end + end + end + + return max + else + local x = lambda + math.sqrt(lambda) * std_normal(u) + + return (x < 0.5 and 0) or (x >= max - 0.5 and max) or math.floor(x + 0.5) + end +end + + +-- Error function. +statistics.erf = erf + +-- Inverse error function. +statistics.erf_inv = erf_inv + +--- Standard normal distribution function (mean 0, standard deviation 1). + -- + -- @return + -- Any real number (actually between -3.0 and 3.0). + +statistics.std_normal = function() + + local u = math.random() + + if u < 0.001 then + return -3.0 + elseif u > 0.999 then + return 3.0 + end + + return std_normal(u) +end + + +--- Standard normal distribution function (mean 0, standard deviation 1). + -- + -- @param mu + -- The distribution mean. + -- @param sigma + -- The distribution standard deviation. + -- @return + -- Any real number (actually between -3*sigma and 3*sigma). + +statistics.normal = function(mu, sigma) + + local u = math.random() + + if u < 0.001 then + return mu - 3.0 * sigma + elseif u > 0.999 then + return mu + 3.0 * sigma + end + + return mu + sigma * std_normal(u) +end + + +--- Poisson distribution function. + -- + -- @param lambda + -- The distribution mean and variance. + -- @param max + -- The distribution maximum. + -- @return + -- An integer between 0 and max (both inclusive). + +statistics.poisson = function(lambda, max) + + lambda, max = tonumber(lambda), tonumber(max) + + if not lambda or not max or lambda <= 0 or max < 1 then return 0; end + + return poisson(lambda, max) +end + + +return statistics diff --git a/mods/farming/textures/crops_garlic.png b/mods/farming/textures/crops_garlic.png new file mode 100644 index 0000000..a73638c Binary files /dev/null and b/mods/farming/textures/crops_garlic.png differ diff --git a/mods/farming/textures/crops_garlic_braid.png b/mods/farming/textures/crops_garlic_braid.png new file mode 100644 index 0000000..f5fa269 Binary files /dev/null and b/mods/farming/textures/crops_garlic_braid.png differ diff --git a/mods/farming/textures/crops_garlic_braid_side.png b/mods/farming/textures/crops_garlic_braid_side.png new file mode 100644 index 0000000..ce467b7 Binary files /dev/null and b/mods/farming/textures/crops_garlic_braid_side.png differ diff --git a/mods/farming/textures/crops_garlic_clove.png b/mods/farming/textures/crops_garlic_clove.png new file mode 100644 index 0000000..bfc1cee Binary files /dev/null and b/mods/farming/textures/crops_garlic_clove.png differ diff --git a/mods/farming/textures/crops_garlic_plant_1.png b/mods/farming/textures/crops_garlic_plant_1.png new file mode 100644 index 0000000..61eb9a8 Binary files /dev/null and b/mods/farming/textures/crops_garlic_plant_1.png differ diff --git a/mods/farming/textures/crops_garlic_plant_2.png b/mods/farming/textures/crops_garlic_plant_2.png new file mode 100644 index 0000000..217fd25 Binary files /dev/null and b/mods/farming/textures/crops_garlic_plant_2.png differ diff --git a/mods/farming/textures/crops_garlic_plant_3.png b/mods/farming/textures/crops_garlic_plant_3.png new file mode 100644 index 0000000..557b017 Binary files /dev/null and b/mods/farming/textures/crops_garlic_plant_3.png differ diff --git a/mods/farming/textures/crops_garlic_plant_4.png b/mods/farming/textures/crops_garlic_plant_4.png new file mode 100644 index 0000000..80ef076 Binary files /dev/null and b/mods/farming/textures/crops_garlic_plant_4.png differ diff --git a/mods/farming/textures/crops_garlic_plant_5.png b/mods/farming/textures/crops_garlic_plant_5.png new file mode 100644 index 0000000..8b8c31a Binary files /dev/null and b/mods/farming/textures/crops_garlic_plant_5.png differ diff --git a/mods/farming/textures/crops_onion.png b/mods/farming/textures/crops_onion.png new file mode 100644 index 0000000..2099c63 Binary files /dev/null and b/mods/farming/textures/crops_onion.png differ diff --git a/mods/farming/textures/crops_onion_plant_1.png b/mods/farming/textures/crops_onion_plant_1.png new file mode 100644 index 0000000..dea2d4b Binary files /dev/null and b/mods/farming/textures/crops_onion_plant_1.png differ diff --git a/mods/farming/textures/crops_onion_plant_2.png b/mods/farming/textures/crops_onion_plant_2.png new file mode 100644 index 0000000..1f850f1 Binary files /dev/null and b/mods/farming/textures/crops_onion_plant_2.png differ diff --git a/mods/farming/textures/crops_onion_plant_3.png b/mods/farming/textures/crops_onion_plant_3.png new file mode 100644 index 0000000..d9af239 Binary files /dev/null and b/mods/farming/textures/crops_onion_plant_3.png differ diff --git a/mods/farming/textures/crops_onion_plant_4.png b/mods/farming/textures/crops_onion_plant_4.png new file mode 100644 index 0000000..962b21b Binary files /dev/null and b/mods/farming/textures/crops_onion_plant_4.png differ diff --git a/mods/farming/textures/crops_onion_plant_5.png b/mods/farming/textures/crops_onion_plant_5.png new file mode 100644 index 0000000..dfb1f7f Binary files /dev/null and b/mods/farming/textures/crops_onion_plant_5.png differ diff --git a/mods/farming/textures/crops_pepper.png b/mods/farming/textures/crops_pepper.png new file mode 100644 index 0000000..bb8f40c Binary files /dev/null and b/mods/farming/textures/crops_pepper.png differ diff --git a/mods/farming/textures/crops_pepper_ground.png b/mods/farming/textures/crops_pepper_ground.png new file mode 100644 index 0000000..d72405a Binary files /dev/null and b/mods/farming/textures/crops_pepper_ground.png differ diff --git a/mods/farming/textures/crops_pepper_plant_1.png b/mods/farming/textures/crops_pepper_plant_1.png new file mode 100644 index 0000000..43ce6ba Binary files /dev/null and b/mods/farming/textures/crops_pepper_plant_1.png differ diff --git a/mods/farming/textures/crops_pepper_plant_2.png b/mods/farming/textures/crops_pepper_plant_2.png new file mode 100644 index 0000000..556f952 Binary files /dev/null and b/mods/farming/textures/crops_pepper_plant_2.png differ diff --git a/mods/farming/textures/crops_pepper_plant_3.png b/mods/farming/textures/crops_pepper_plant_3.png new file mode 100644 index 0000000..24e92e1 Binary files /dev/null and b/mods/farming/textures/crops_pepper_plant_3.png differ diff --git a/mods/farming/textures/crops_pepper_plant_4.png b/mods/farming/textures/crops_pepper_plant_4.png new file mode 100644 index 0000000..e33554d Binary files /dev/null and b/mods/farming/textures/crops_pepper_plant_4.png differ diff --git a/mods/farming/textures/crops_pepper_plant_5.png b/mods/farming/textures/crops_pepper_plant_5.png new file mode 100644 index 0000000..c2c92eb Binary files /dev/null and b/mods/farming/textures/crops_pepper_plant_5.png differ diff --git a/mods/farming/textures/crops_pepper_plant_6.png b/mods/farming/textures/crops_pepper_plant_6.png new file mode 100644 index 0000000..f2de13a Binary files /dev/null and b/mods/farming/textures/crops_pepper_plant_6.png differ diff --git a/mods/farming/textures/crops_pepper_plant_7.png b/mods/farming/textures/crops_pepper_plant_7.png new file mode 100644 index 0000000..b94526b Binary files /dev/null and b/mods/farming/textures/crops_pepper_plant_7.png differ diff --git a/mods/farming/textures/crops_pepper_red.png b/mods/farming/textures/crops_pepper_red.png new file mode 100644 index 0000000..26802ec Binary files /dev/null and b/mods/farming/textures/crops_pepper_red.png differ diff --git a/mods/farming/textures/crops_pepper_yellow.png b/mods/farming/textures/crops_pepper_yellow.png new file mode 100644 index 0000000..c0273e4 Binary files /dev/null and b/mods/farming/textures/crops_pepper_yellow.png differ diff --git a/mods/farming/textures/crops_peppercorn.png b/mods/farming/textures/crops_peppercorn.png new file mode 100644 index 0000000..0ee3c49 Binary files /dev/null and b/mods/farming/textures/crops_peppercorn.png differ diff --git a/mods/farming/textures/default_junglegrass.png b/mods/farming/textures/default_junglegrass.png new file mode 100644 index 0000000..5d8cdbc Binary files /dev/null and b/mods/farming/textures/default_junglegrass.png differ diff --git a/mods/farming/textures/farming_apple_pie.png b/mods/farming/textures/farming_apple_pie.png new file mode 100644 index 0000000..0e4fdf4 Binary files /dev/null and b/mods/farming/textures/farming_apple_pie.png differ diff --git a/mods/farming/textures/farming_artichoke.png b/mods/farming/textures/farming_artichoke.png new file mode 100644 index 0000000..74af38b Binary files /dev/null and b/mods/farming/textures/farming_artichoke.png differ diff --git a/mods/farming/textures/farming_artichoke_1.png b/mods/farming/textures/farming_artichoke_1.png new file mode 100644 index 0000000..b7f2e02 Binary files /dev/null and b/mods/farming/textures/farming_artichoke_1.png differ diff --git a/mods/farming/textures/farming_artichoke_2.png b/mods/farming/textures/farming_artichoke_2.png new file mode 100644 index 0000000..653637e Binary files /dev/null and b/mods/farming/textures/farming_artichoke_2.png differ diff --git a/mods/farming/textures/farming_artichoke_3.png b/mods/farming/textures/farming_artichoke_3.png new file mode 100644 index 0000000..2d203e9 Binary files /dev/null and b/mods/farming/textures/farming_artichoke_3.png differ diff --git a/mods/farming/textures/farming_artichoke_4.png b/mods/farming/textures/farming_artichoke_4.png new file mode 100644 index 0000000..9a44e92 Binary files /dev/null and b/mods/farming/textures/farming_artichoke_4.png differ diff --git a/mods/farming/textures/farming_artichoke_5.png b/mods/farming/textures/farming_artichoke_5.png new file mode 100644 index 0000000..dac25dd Binary files /dev/null and b/mods/farming/textures/farming_artichoke_5.png differ diff --git a/mods/farming/textures/farming_baked_potato.png b/mods/farming/textures/farming_baked_potato.png new file mode 100644 index 0000000..425c4ae Binary files /dev/null and b/mods/farming/textures/farming_baked_potato.png differ diff --git a/mods/farming/textures/farming_baking_tray.png b/mods/farming/textures/farming_baking_tray.png new file mode 100644 index 0000000..be1711c Binary files /dev/null and b/mods/farming/textures/farming_baking_tray.png differ diff --git a/mods/farming/textures/farming_banana_leaf.png b/mods/farming/textures/farming_banana_leaf.png new file mode 100644 index 0000000..5800cbf Binary files /dev/null and b/mods/farming/textures/farming_banana_leaf.png differ diff --git a/mods/farming/textures/farming_banana_single.png b/mods/farming/textures/farming_banana_single.png new file mode 100644 index 0000000..b15ed2f Binary files /dev/null and b/mods/farming/textures/farming_banana_single.png differ diff --git a/mods/farming/textures/farming_barley.png b/mods/farming/textures/farming_barley.png new file mode 100644 index 0000000..ca929e0 Binary files /dev/null and b/mods/farming/textures/farming_barley.png differ diff --git a/mods/farming/textures/farming_barley_1.png b/mods/farming/textures/farming_barley_1.png new file mode 100644 index 0000000..4a458b1 Binary files /dev/null and b/mods/farming/textures/farming_barley_1.png differ diff --git a/mods/farming/textures/farming_barley_2.png b/mods/farming/textures/farming_barley_2.png new file mode 100644 index 0000000..96610c2 Binary files /dev/null and b/mods/farming/textures/farming_barley_2.png differ diff --git a/mods/farming/textures/farming_barley_3.png b/mods/farming/textures/farming_barley_3.png new file mode 100644 index 0000000..ef14b5b Binary files /dev/null and b/mods/farming/textures/farming_barley_3.png differ diff --git a/mods/farming/textures/farming_barley_4.png b/mods/farming/textures/farming_barley_4.png new file mode 100644 index 0000000..f7c9054 Binary files /dev/null and b/mods/farming/textures/farming_barley_4.png differ diff --git a/mods/farming/textures/farming_barley_5.png b/mods/farming/textures/farming_barley_5.png new file mode 100644 index 0000000..68c0d68 Binary files /dev/null and b/mods/farming/textures/farming_barley_5.png differ diff --git a/mods/farming/textures/farming_barley_6.png b/mods/farming/textures/farming_barley_6.png new file mode 100644 index 0000000..496a218 Binary files /dev/null and b/mods/farming/textures/farming_barley_6.png differ diff --git a/mods/farming/textures/farming_barley_7.png b/mods/farming/textures/farming_barley_7.png new file mode 100644 index 0000000..1c636af Binary files /dev/null and b/mods/farming/textures/farming_barley_7.png differ diff --git a/mods/farming/textures/farming_barley_seed.png b/mods/farming/textures/farming_barley_seed.png new file mode 100644 index 0000000..2f00a20 Binary files /dev/null and b/mods/farming/textures/farming_barley_seed.png differ diff --git a/mods/farming/textures/farming_beanbush.png b/mods/farming/textures/farming_beanbush.png new file mode 100644 index 0000000..637e716 Binary files /dev/null and b/mods/farming/textures/farming_beanbush.png differ diff --git a/mods/farming/textures/farming_beanpole.png b/mods/farming/textures/farming_beanpole.png new file mode 100644 index 0000000..ed07572 Binary files /dev/null and b/mods/farming/textures/farming_beanpole.png differ diff --git a/mods/farming/textures/farming_beanpole_1.png b/mods/farming/textures/farming_beanpole_1.png new file mode 100644 index 0000000..ef2bd5a Binary files /dev/null and b/mods/farming/textures/farming_beanpole_1.png differ diff --git a/mods/farming/textures/farming_beanpole_2.png b/mods/farming/textures/farming_beanpole_2.png new file mode 100644 index 0000000..34143e4 Binary files /dev/null and b/mods/farming/textures/farming_beanpole_2.png differ diff --git a/mods/farming/textures/farming_beanpole_3.png b/mods/farming/textures/farming_beanpole_3.png new file mode 100644 index 0000000..d693f17 Binary files /dev/null and b/mods/farming/textures/farming_beanpole_3.png differ diff --git a/mods/farming/textures/farming_beanpole_4.png b/mods/farming/textures/farming_beanpole_4.png new file mode 100644 index 0000000..c779b25 Binary files /dev/null and b/mods/farming/textures/farming_beanpole_4.png differ diff --git a/mods/farming/textures/farming_beanpole_5.png b/mods/farming/textures/farming_beanpole_5.png new file mode 100644 index 0000000..910f8a0 Binary files /dev/null and b/mods/farming/textures/farming_beanpole_5.png differ diff --git a/mods/farming/textures/farming_beans.png b/mods/farming/textures/farming_beans.png new file mode 100644 index 0000000..ad5cf85 Binary files /dev/null and b/mods/farming/textures/farming_beans.png differ diff --git a/mods/farming/textures/farming_beetroot.png b/mods/farming/textures/farming_beetroot.png new file mode 100644 index 0000000..6a60168 Binary files /dev/null and b/mods/farming/textures/farming_beetroot.png differ diff --git a/mods/farming/textures/farming_beetroot_1.png b/mods/farming/textures/farming_beetroot_1.png new file mode 100644 index 0000000..8b75e10 Binary files /dev/null and b/mods/farming/textures/farming_beetroot_1.png differ diff --git a/mods/farming/textures/farming_beetroot_2.png b/mods/farming/textures/farming_beetroot_2.png new file mode 100644 index 0000000..9c1ce1e Binary files /dev/null and b/mods/farming/textures/farming_beetroot_2.png differ diff --git a/mods/farming/textures/farming_beetroot_3.png b/mods/farming/textures/farming_beetroot_3.png new file mode 100644 index 0000000..0f28e5e Binary files /dev/null and b/mods/farming/textures/farming_beetroot_3.png differ diff --git a/mods/farming/textures/farming_beetroot_4.png b/mods/farming/textures/farming_beetroot_4.png new file mode 100644 index 0000000..35f211b Binary files /dev/null and b/mods/farming/textures/farming_beetroot_4.png differ diff --git a/mods/farming/textures/farming_beetroot_5.png b/mods/farming/textures/farming_beetroot_5.png new file mode 100644 index 0000000..c4b8957 Binary files /dev/null and b/mods/farming/textures/farming_beetroot_5.png differ diff --git a/mods/farming/textures/farming_beetroot_soup.png b/mods/farming/textures/farming_beetroot_soup.png new file mode 100644 index 0000000..4df562e Binary files /dev/null and b/mods/farming/textures/farming_beetroot_soup.png differ diff --git a/mods/farming/textures/farming_berry_smoothie.png b/mods/farming/textures/farming_berry_smoothie.png new file mode 100644 index 0000000..8da2fc5 Binary files /dev/null and b/mods/farming/textures/farming_berry_smoothie.png differ diff --git a/mods/farming/textures/farming_bibimbap.png b/mods/farming/textures/farming_bibimbap.png new file mode 100644 index 0000000..e1a7dfe Binary files /dev/null and b/mods/farming/textures/farming_bibimbap.png differ diff --git a/mods/farming/textures/farming_blackberry.png b/mods/farming/textures/farming_blackberry.png new file mode 100644 index 0000000..01d7ac5 Binary files /dev/null and b/mods/farming/textures/farming_blackberry.png differ diff --git a/mods/farming/textures/farming_blackberry_1.png b/mods/farming/textures/farming_blackberry_1.png new file mode 100644 index 0000000..8dd8832 Binary files /dev/null and b/mods/farming/textures/farming_blackberry_1.png differ diff --git a/mods/farming/textures/farming_blackberry_2.png b/mods/farming/textures/farming_blackberry_2.png new file mode 100644 index 0000000..7d3827c Binary files /dev/null and b/mods/farming/textures/farming_blackberry_2.png differ diff --git a/mods/farming/textures/farming_blackberry_3.png b/mods/farming/textures/farming_blackberry_3.png new file mode 100644 index 0000000..7d89aa0 Binary files /dev/null and b/mods/farming/textures/farming_blackberry_3.png differ diff --git a/mods/farming/textures/farming_blackberry_4.png b/mods/farming/textures/farming_blackberry_4.png new file mode 100644 index 0000000..d9d398d Binary files /dev/null and b/mods/farming/textures/farming_blackberry_4.png differ diff --git a/mods/farming/textures/farming_blueberries.png b/mods/farming/textures/farming_blueberries.png new file mode 100644 index 0000000..b0c4931 Binary files /dev/null and b/mods/farming/textures/farming_blueberries.png differ diff --git a/mods/farming/textures/farming_blueberry_1.png b/mods/farming/textures/farming_blueberry_1.png new file mode 100644 index 0000000..83832c8 Binary files /dev/null and b/mods/farming/textures/farming_blueberry_1.png differ diff --git a/mods/farming/textures/farming_blueberry_2.png b/mods/farming/textures/farming_blueberry_2.png new file mode 100644 index 0000000..308a0ca Binary files /dev/null and b/mods/farming/textures/farming_blueberry_2.png differ diff --git a/mods/farming/textures/farming_blueberry_3.png b/mods/farming/textures/farming_blueberry_3.png new file mode 100644 index 0000000..43d2ab1 Binary files /dev/null and b/mods/farming/textures/farming_blueberry_3.png differ diff --git a/mods/farming/textures/farming_blueberry_4.png b/mods/farming/textures/farming_blueberry_4.png new file mode 100644 index 0000000..75fb69a Binary files /dev/null and b/mods/farming/textures/farming_blueberry_4.png differ diff --git a/mods/farming/textures/farming_blueberry_muffin.png b/mods/farming/textures/farming_blueberry_muffin.png new file mode 100644 index 0000000..b1253d7 Binary files /dev/null and b/mods/farming/textures/farming_blueberry_muffin.png differ diff --git a/mods/farming/textures/farming_blueberry_pie.png b/mods/farming/textures/farming_blueberry_pie.png new file mode 100644 index 0000000..2174686 Binary files /dev/null and b/mods/farming/textures/farming_blueberry_pie.png differ diff --git a/mods/farming/textures/farming_bottle_ethanol.png b/mods/farming/textures/farming_bottle_ethanol.png new file mode 100644 index 0000000..84e6162 Binary files /dev/null and b/mods/farming/textures/farming_bottle_ethanol.png differ diff --git a/mods/farming/textures/farming_bowl.png b/mods/farming/textures/farming_bowl.png new file mode 100644 index 0000000..627c22e Binary files /dev/null and b/mods/farming/textures/farming_bowl.png differ diff --git a/mods/farming/textures/farming_bread.png b/mods/farming/textures/farming_bread.png index 0c25678..bd00e3e 100644 Binary files a/mods/farming/textures/farming_bread.png and b/mods/farming/textures/farming_bread.png differ diff --git a/mods/farming/textures/farming_bread_multigrain.png b/mods/farming/textures/farming_bread_multigrain.png new file mode 100644 index 0000000..66dda07 Binary files /dev/null and b/mods/farming/textures/farming_bread_multigrain.png differ diff --git a/mods/farming/textures/farming_bread_slice.png b/mods/farming/textures/farming_bread_slice.png new file mode 100644 index 0000000..ff2714d Binary files /dev/null and b/mods/farming/textures/farming_bread_slice.png differ diff --git a/mods/farming/textures/farming_burger.png b/mods/farming/textures/farming_burger.png new file mode 100644 index 0000000..c39f7c0 Binary files /dev/null and b/mods/farming/textures/farming_burger.png differ diff --git a/mods/farming/textures/farming_cabbage.png b/mods/farming/textures/farming_cabbage.png new file mode 100644 index 0000000..7f4fa05 Binary files /dev/null and b/mods/farming/textures/farming_cabbage.png differ diff --git a/mods/farming/textures/farming_cabbage_1.png b/mods/farming/textures/farming_cabbage_1.png new file mode 100644 index 0000000..850b0da Binary files /dev/null and b/mods/farming/textures/farming_cabbage_1.png differ diff --git a/mods/farming/textures/farming_cabbage_2.png b/mods/farming/textures/farming_cabbage_2.png new file mode 100644 index 0000000..5ae079f Binary files /dev/null and b/mods/farming/textures/farming_cabbage_2.png differ diff --git a/mods/farming/textures/farming_cabbage_3.png b/mods/farming/textures/farming_cabbage_3.png new file mode 100644 index 0000000..3050229 Binary files /dev/null and b/mods/farming/textures/farming_cabbage_3.png differ diff --git a/mods/farming/textures/farming_cabbage_4.png b/mods/farming/textures/farming_cabbage_4.png new file mode 100644 index 0000000..5064274 Binary files /dev/null and b/mods/farming/textures/farming_cabbage_4.png differ diff --git a/mods/farming/textures/farming_cabbage_5.png b/mods/farming/textures/farming_cabbage_5.png new file mode 100644 index 0000000..45dd777 Binary files /dev/null and b/mods/farming/textures/farming_cabbage_5.png differ diff --git a/mods/farming/textures/farming_cabbage_6.png b/mods/farming/textures/farming_cabbage_6.png new file mode 100644 index 0000000..253f8a7 Binary files /dev/null and b/mods/farming/textures/farming_cabbage_6.png differ diff --git a/mods/farming/textures/farming_cactus_juice.png b/mods/farming/textures/farming_cactus_juice.png new file mode 100644 index 0000000..b4fb5b9 Binary files /dev/null and b/mods/farming/textures/farming_cactus_juice.png differ diff --git a/mods/farming/textures/farming_caramel.png b/mods/farming/textures/farming_caramel.png new file mode 100644 index 0000000..bc7d164 Binary files /dev/null and b/mods/farming/textures/farming_caramel.png differ diff --git a/mods/farming/textures/farming_carrot.png b/mods/farming/textures/farming_carrot.png new file mode 100644 index 0000000..73f2fd4 Binary files /dev/null and b/mods/farming/textures/farming_carrot.png differ diff --git a/mods/farming/textures/farming_carrot_1.png b/mods/farming/textures/farming_carrot_1.png new file mode 100644 index 0000000..bbeae7e Binary files /dev/null and b/mods/farming/textures/farming_carrot_1.png differ diff --git a/mods/farming/textures/farming_carrot_2.png b/mods/farming/textures/farming_carrot_2.png new file mode 100644 index 0000000..b24ecc0 Binary files /dev/null and b/mods/farming/textures/farming_carrot_2.png differ diff --git a/mods/farming/textures/farming_carrot_3.png b/mods/farming/textures/farming_carrot_3.png new file mode 100644 index 0000000..8400505 Binary files /dev/null and b/mods/farming/textures/farming_carrot_3.png differ diff --git a/mods/farming/textures/farming_carrot_4.png b/mods/farming/textures/farming_carrot_4.png new file mode 100644 index 0000000..32ee262 Binary files /dev/null and b/mods/farming/textures/farming_carrot_4.png differ diff --git a/mods/farming/textures/farming_carrot_5.png b/mods/farming/textures/farming_carrot_5.png new file mode 100644 index 0000000..0bcd9c1 Binary files /dev/null and b/mods/farming/textures/farming_carrot_5.png differ diff --git a/mods/farming/textures/farming_carrot_6.png b/mods/farming/textures/farming_carrot_6.png new file mode 100644 index 0000000..a17c6b2 Binary files /dev/null and b/mods/farming/textures/farming_carrot_6.png differ diff --git a/mods/farming/textures/farming_carrot_7.png b/mods/farming/textures/farming_carrot_7.png new file mode 100644 index 0000000..d26eee7 Binary files /dev/null and b/mods/farming/textures/farming_carrot_7.png differ diff --git a/mods/farming/textures/farming_carrot_8.png b/mods/farming/textures/farming_carrot_8.png new file mode 100644 index 0000000..00b6d92 Binary files /dev/null and b/mods/farming/textures/farming_carrot_8.png differ diff --git a/mods/farming/textures/farming_carrot_gold.png b/mods/farming/textures/farming_carrot_gold.png new file mode 100644 index 0000000..b817101 Binary files /dev/null and b/mods/farming/textures/farming_carrot_gold.png differ diff --git a/mods/farming/textures/farming_carrot_juice.png b/mods/farming/textures/farming_carrot_juice.png new file mode 100644 index 0000000..5a03245 Binary files /dev/null and b/mods/farming/textures/farming_carrot_juice.png differ diff --git a/mods/farming/textures/farming_cheese_vegan.png b/mods/farming/textures/farming_cheese_vegan.png new file mode 100644 index 0000000..22c439e Binary files /dev/null and b/mods/farming/textures/farming_cheese_vegan.png differ diff --git a/mods/farming/textures/farming_chili_1.png b/mods/farming/textures/farming_chili_1.png new file mode 100644 index 0000000..aa11988 Binary files /dev/null and b/mods/farming/textures/farming_chili_1.png differ diff --git a/mods/farming/textures/farming_chili_2.png b/mods/farming/textures/farming_chili_2.png new file mode 100644 index 0000000..ae34506 Binary files /dev/null and b/mods/farming/textures/farming_chili_2.png differ diff --git a/mods/farming/textures/farming_chili_3.png b/mods/farming/textures/farming_chili_3.png new file mode 100644 index 0000000..5e1d901 Binary files /dev/null and b/mods/farming/textures/farming_chili_3.png differ diff --git a/mods/farming/textures/farming_chili_4.png b/mods/farming/textures/farming_chili_4.png new file mode 100644 index 0000000..d97769b Binary files /dev/null and b/mods/farming/textures/farming_chili_4.png differ diff --git a/mods/farming/textures/farming_chili_5.png b/mods/farming/textures/farming_chili_5.png new file mode 100644 index 0000000..dd4755d Binary files /dev/null and b/mods/farming/textures/farming_chili_5.png differ diff --git a/mods/farming/textures/farming_chili_6.png b/mods/farming/textures/farming_chili_6.png new file mode 100644 index 0000000..4ee057b Binary files /dev/null and b/mods/farming/textures/farming_chili_6.png differ diff --git a/mods/farming/textures/farming_chili_7.png b/mods/farming/textures/farming_chili_7.png new file mode 100644 index 0000000..5912c2e Binary files /dev/null and b/mods/farming/textures/farming_chili_7.png differ diff --git a/mods/farming/textures/farming_chili_8.png b/mods/farming/textures/farming_chili_8.png new file mode 100644 index 0000000..976eb52 Binary files /dev/null and b/mods/farming/textures/farming_chili_8.png differ diff --git a/mods/farming/textures/farming_chili_bowl.png b/mods/farming/textures/farming_chili_bowl.png new file mode 100644 index 0000000..6454ba3 Binary files /dev/null and b/mods/farming/textures/farming_chili_bowl.png differ diff --git a/mods/farming/textures/farming_chili_pepper.png b/mods/farming/textures/farming_chili_pepper.png new file mode 100644 index 0000000..922cec4 Binary files /dev/null and b/mods/farming/textures/farming_chili_pepper.png differ diff --git a/mods/farming/textures/farming_chocolate_block.png b/mods/farming/textures/farming_chocolate_block.png new file mode 100644 index 0000000..20e5a79 Binary files /dev/null and b/mods/farming/textures/farming_chocolate_block.png differ diff --git a/mods/farming/textures/farming_chocolate_dark.png b/mods/farming/textures/farming_chocolate_dark.png new file mode 100644 index 0000000..03243b2 Binary files /dev/null and b/mods/farming/textures/farming_chocolate_dark.png differ diff --git a/mods/farming/textures/farming_cocoa_1.png b/mods/farming/textures/farming_cocoa_1.png new file mode 100644 index 0000000..18fd362 Binary files /dev/null and b/mods/farming/textures/farming_cocoa_1.png differ diff --git a/mods/farming/textures/farming_cocoa_2.png b/mods/farming/textures/farming_cocoa_2.png new file mode 100644 index 0000000..c304ee0 Binary files /dev/null and b/mods/farming/textures/farming_cocoa_2.png differ diff --git a/mods/farming/textures/farming_cocoa_3.png b/mods/farming/textures/farming_cocoa_3.png new file mode 100644 index 0000000..d66b47d Binary files /dev/null and b/mods/farming/textures/farming_cocoa_3.png differ diff --git a/mods/farming/textures/farming_cocoa_4.png b/mods/farming/textures/farming_cocoa_4.png new file mode 100644 index 0000000..990a8b4 Binary files /dev/null and b/mods/farming/textures/farming_cocoa_4.png differ diff --git a/mods/farming/textures/farming_cocoa_beans.png b/mods/farming/textures/farming_cocoa_beans.png new file mode 100644 index 0000000..9605e51 Binary files /dev/null and b/mods/farming/textures/farming_cocoa_beans.png differ diff --git a/mods/farming/textures/farming_coffee_1.png b/mods/farming/textures/farming_coffee_1.png new file mode 100644 index 0000000..97c207a Binary files /dev/null and b/mods/farming/textures/farming_coffee_1.png differ diff --git a/mods/farming/textures/farming_coffee_2.png b/mods/farming/textures/farming_coffee_2.png new file mode 100644 index 0000000..a659f85 Binary files /dev/null and b/mods/farming/textures/farming_coffee_2.png differ diff --git a/mods/farming/textures/farming_coffee_3.png b/mods/farming/textures/farming_coffee_3.png new file mode 100644 index 0000000..93088c8 Binary files /dev/null and b/mods/farming/textures/farming_coffee_3.png differ diff --git a/mods/farming/textures/farming_coffee_4.png b/mods/farming/textures/farming_coffee_4.png new file mode 100644 index 0000000..37a609f Binary files /dev/null and b/mods/farming/textures/farming_coffee_4.png differ diff --git a/mods/farming/textures/farming_coffee_5.png b/mods/farming/textures/farming_coffee_5.png new file mode 100644 index 0000000..e624fbe Binary files /dev/null and b/mods/farming/textures/farming_coffee_5.png differ diff --git a/mods/farming/textures/farming_coffee_beans.png b/mods/farming/textures/farming_coffee_beans.png new file mode 100644 index 0000000..0786f4e Binary files /dev/null and b/mods/farming/textures/farming_coffee_beans.png differ diff --git a/mods/farming/textures/farming_coffee_cup.png b/mods/farming/textures/farming_coffee_cup.png new file mode 100644 index 0000000..d3820bc Binary files /dev/null and b/mods/farming/textures/farming_coffee_cup.png differ diff --git a/mods/farming/textures/farming_cookie.png b/mods/farming/textures/farming_cookie.png new file mode 100644 index 0000000..e80be35 Binary files /dev/null and b/mods/farming/textures/farming_cookie.png differ diff --git a/mods/farming/textures/farming_corn.png b/mods/farming/textures/farming_corn.png new file mode 100644 index 0000000..2a2894a Binary files /dev/null and b/mods/farming/textures/farming_corn.png differ diff --git a/mods/farming/textures/farming_corn_1.png b/mods/farming/textures/farming_corn_1.png new file mode 100644 index 0000000..60e8b99 Binary files /dev/null and b/mods/farming/textures/farming_corn_1.png differ diff --git a/mods/farming/textures/farming_corn_2.png b/mods/farming/textures/farming_corn_2.png new file mode 100644 index 0000000..6ba6cc9 Binary files /dev/null and b/mods/farming/textures/farming_corn_2.png differ diff --git a/mods/farming/textures/farming_corn_3.png b/mods/farming/textures/farming_corn_3.png new file mode 100644 index 0000000..c5fa80b Binary files /dev/null and b/mods/farming/textures/farming_corn_3.png differ diff --git a/mods/farming/textures/farming_corn_4.png b/mods/farming/textures/farming_corn_4.png new file mode 100644 index 0000000..a43632d Binary files /dev/null and b/mods/farming/textures/farming_corn_4.png differ diff --git a/mods/farming/textures/farming_corn_5.png b/mods/farming/textures/farming_corn_5.png new file mode 100644 index 0000000..7b6fb02 Binary files /dev/null and b/mods/farming/textures/farming_corn_5.png differ diff --git a/mods/farming/textures/farming_corn_6.png b/mods/farming/textures/farming_corn_6.png new file mode 100644 index 0000000..313697b Binary files /dev/null and b/mods/farming/textures/farming_corn_6.png differ diff --git a/mods/farming/textures/farming_corn_7.png b/mods/farming/textures/farming_corn_7.png new file mode 100644 index 0000000..6a937e7 Binary files /dev/null and b/mods/farming/textures/farming_corn_7.png differ diff --git a/mods/farming/textures/farming_corn_8.png b/mods/farming/textures/farming_corn_8.png new file mode 100644 index 0000000..77e442b Binary files /dev/null and b/mods/farming/textures/farming_corn_8.png differ diff --git a/mods/farming/textures/farming_corn_cob.png b/mods/farming/textures/farming_corn_cob.png new file mode 100644 index 0000000..a2fd9da Binary files /dev/null and b/mods/farming/textures/farming_corn_cob.png differ diff --git a/mods/farming/textures/farming_cornstarch.png b/mods/farming/textures/farming_cornstarch.png new file mode 100644 index 0000000..d5f8218 Binary files /dev/null and b/mods/farming/textures/farming_cornstarch.png differ diff --git a/mods/farming/textures/farming_cotton_wild.png b/mods/farming/textures/farming_cotton_wild.png new file mode 100644 index 0000000..0107ad4 Binary files /dev/null and b/mods/farming/textures/farming_cotton_wild.png differ diff --git a/mods/farming/textures/farming_cucumber.png b/mods/farming/textures/farming_cucumber.png new file mode 100644 index 0000000..2acb7b2 Binary files /dev/null and b/mods/farming/textures/farming_cucumber.png differ diff --git a/mods/farming/textures/farming_cucumber_1.png b/mods/farming/textures/farming_cucumber_1.png new file mode 100644 index 0000000..e008fd1 Binary files /dev/null and b/mods/farming/textures/farming_cucumber_1.png differ diff --git a/mods/farming/textures/farming_cucumber_2.png b/mods/farming/textures/farming_cucumber_2.png new file mode 100644 index 0000000..9c345ff Binary files /dev/null and b/mods/farming/textures/farming_cucumber_2.png differ diff --git a/mods/farming/textures/farming_cucumber_3.png b/mods/farming/textures/farming_cucumber_3.png new file mode 100644 index 0000000..25f3c54 Binary files /dev/null and b/mods/farming/textures/farming_cucumber_3.png differ diff --git a/mods/farming/textures/farming_cucumber_4.png b/mods/farming/textures/farming_cucumber_4.png new file mode 100644 index 0000000..fc62f2f Binary files /dev/null and b/mods/farming/textures/farming_cucumber_4.png differ diff --git a/mods/farming/textures/farming_cutting_board.png b/mods/farming/textures/farming_cutting_board.png new file mode 100644 index 0000000..90b3f9c Binary files /dev/null and b/mods/farming/textures/farming_cutting_board.png differ diff --git a/mods/farming/textures/farming_desert_sand_soil.png b/mods/farming/textures/farming_desert_sand_soil.png index 3c09ef0..1450e01 100644 Binary files a/mods/farming/textures/farming_desert_sand_soil.png and b/mods/farming/textures/farming_desert_sand_soil.png differ diff --git a/mods/farming/textures/farming_desert_sand_soil_wet.png b/mods/farming/textures/farming_desert_sand_soil_wet.png index facc83e..cffa955 100644 Binary files a/mods/farming/textures/farming_desert_sand_soil_wet.png and b/mods/farming/textures/farming_desert_sand_soil_wet.png differ diff --git a/mods/farming/textures/farming_desert_sand_soil_wet_side.png b/mods/farming/textures/farming_desert_sand_soil_wet_side.png index 41e5a04..fbb2815 100644 Binary files a/mods/farming/textures/farming_desert_sand_soil_wet_side.png and b/mods/farming/textures/farming_desert_sand_soil_wet_side.png differ diff --git a/mods/farming/textures/farming_donut.png b/mods/farming/textures/farming_donut.png new file mode 100644 index 0000000..8985299 Binary files /dev/null and b/mods/farming/textures/farming_donut.png differ diff --git a/mods/farming/textures/farming_donut_apple.png b/mods/farming/textures/farming_donut_apple.png new file mode 100644 index 0000000..6dfe63d Binary files /dev/null and b/mods/farming/textures/farming_donut_apple.png differ diff --git a/mods/farming/textures/farming_donut_chocolate.png b/mods/farming/textures/farming_donut_chocolate.png new file mode 100644 index 0000000..aa4b93f Binary files /dev/null and b/mods/farming/textures/farming_donut_chocolate.png differ diff --git a/mods/farming/textures/farming_flour_multigrain.png b/mods/farming/textures/farming_flour_multigrain.png new file mode 100644 index 0000000..5367bc5 Binary files /dev/null and b/mods/farming/textures/farming_flour_multigrain.png differ diff --git a/mods/farming/textures/farming_garlic_bread.png b/mods/farming/textures/farming_garlic_bread.png new file mode 100644 index 0000000..b760004 Binary files /dev/null and b/mods/farming/textures/farming_garlic_bread.png differ diff --git a/mods/farming/textures/farming_grapebush.png b/mods/farming/textures/farming_grapebush.png new file mode 100644 index 0000000..c2e6620 Binary files /dev/null and b/mods/farming/textures/farming_grapebush.png differ diff --git a/mods/farming/textures/farming_grapes.png b/mods/farming/textures/farming_grapes.png new file mode 100644 index 0000000..aa00ed6 Binary files /dev/null and b/mods/farming/textures/farming_grapes.png differ diff --git a/mods/farming/textures/farming_grapes_1.png b/mods/farming/textures/farming_grapes_1.png new file mode 100644 index 0000000..64a935d Binary files /dev/null and b/mods/farming/textures/farming_grapes_1.png differ diff --git a/mods/farming/textures/farming_grapes_2.png b/mods/farming/textures/farming_grapes_2.png new file mode 100644 index 0000000..6cc2a33 Binary files /dev/null and b/mods/farming/textures/farming_grapes_2.png differ diff --git a/mods/farming/textures/farming_grapes_3.png b/mods/farming/textures/farming_grapes_3.png new file mode 100644 index 0000000..66d6310 Binary files /dev/null and b/mods/farming/textures/farming_grapes_3.png differ diff --git a/mods/farming/textures/farming_grapes_4.png b/mods/farming/textures/farming_grapes_4.png new file mode 100644 index 0000000..57cdc73 Binary files /dev/null and b/mods/farming/textures/farming_grapes_4.png differ diff --git a/mods/farming/textures/farming_grapes_5.png b/mods/farming/textures/farming_grapes_5.png new file mode 100644 index 0000000..aad41f4 Binary files /dev/null and b/mods/farming/textures/farming_grapes_5.png differ diff --git a/mods/farming/textures/farming_grapes_6.png b/mods/farming/textures/farming_grapes_6.png new file mode 100644 index 0000000..2e23a3c Binary files /dev/null and b/mods/farming/textures/farming_grapes_6.png differ diff --git a/mods/farming/textures/farming_grapes_7.png b/mods/farming/textures/farming_grapes_7.png new file mode 100644 index 0000000..9e70b6d Binary files /dev/null and b/mods/farming/textures/farming_grapes_7.png differ diff --git a/mods/farming/textures/farming_grapes_8.png b/mods/farming/textures/farming_grapes_8.png new file mode 100644 index 0000000..5093a06 Binary files /dev/null and b/mods/farming/textures/farming_grapes_8.png differ diff --git a/mods/farming/textures/farming_gyoza.png b/mods/farming/textures/farming_gyoza.png new file mode 100644 index 0000000..c8f036f Binary files /dev/null and b/mods/farming/textures/farming_gyoza.png differ diff --git a/mods/farming/textures/farming_hemp_1.png b/mods/farming/textures/farming_hemp_1.png new file mode 100644 index 0000000..6fb4510 Binary files /dev/null and b/mods/farming/textures/farming_hemp_1.png differ diff --git a/mods/farming/textures/farming_hemp_2.png b/mods/farming/textures/farming_hemp_2.png new file mode 100644 index 0000000..a676173 Binary files /dev/null and b/mods/farming/textures/farming_hemp_2.png differ diff --git a/mods/farming/textures/farming_hemp_3.png b/mods/farming/textures/farming_hemp_3.png new file mode 100644 index 0000000..57136d5 Binary files /dev/null and b/mods/farming/textures/farming_hemp_3.png differ diff --git a/mods/farming/textures/farming_hemp_4.png b/mods/farming/textures/farming_hemp_4.png new file mode 100644 index 0000000..b375cf3 Binary files /dev/null and b/mods/farming/textures/farming_hemp_4.png differ diff --git a/mods/farming/textures/farming_hemp_5.png b/mods/farming/textures/farming_hemp_5.png new file mode 100644 index 0000000..890a3d2 Binary files /dev/null and b/mods/farming/textures/farming_hemp_5.png differ diff --git a/mods/farming/textures/farming_hemp_6.png b/mods/farming/textures/farming_hemp_6.png new file mode 100644 index 0000000..258d4e3 Binary files /dev/null and b/mods/farming/textures/farming_hemp_6.png differ diff --git a/mods/farming/textures/farming_hemp_7.png b/mods/farming/textures/farming_hemp_7.png new file mode 100644 index 0000000..1ce3a8d Binary files /dev/null and b/mods/farming/textures/farming_hemp_7.png differ diff --git a/mods/farming/textures/farming_hemp_8.png b/mods/farming/textures/farming_hemp_8.png new file mode 100644 index 0000000..8d2143f Binary files /dev/null and b/mods/farming/textures/farming_hemp_8.png differ diff --git a/mods/farming/textures/farming_hemp_block.png b/mods/farming/textures/farming_hemp_block.png new file mode 100644 index 0000000..285a2cd Binary files /dev/null and b/mods/farming/textures/farming_hemp_block.png differ diff --git a/mods/farming/textures/farming_hemp_fibre.png b/mods/farming/textures/farming_hemp_fibre.png new file mode 100644 index 0000000..fe3c918 Binary files /dev/null and b/mods/farming/textures/farming_hemp_fibre.png differ diff --git a/mods/farming/textures/farming_hemp_leaf.png b/mods/farming/textures/farming_hemp_leaf.png new file mode 100644 index 0000000..997c8f0 Binary files /dev/null and b/mods/farming/textures/farming_hemp_leaf.png differ diff --git a/mods/farming/textures/farming_hemp_oil.png b/mods/farming/textures/farming_hemp_oil.png new file mode 100644 index 0000000..fa8afe2 Binary files /dev/null and b/mods/farming/textures/farming_hemp_oil.png differ diff --git a/mods/farming/textures/farming_hemp_rope.png b/mods/farming/textures/farming_hemp_rope.png new file mode 100644 index 0000000..03a7082 Binary files /dev/null and b/mods/farming/textures/farming_hemp_rope.png differ diff --git a/mods/farming/textures/farming_hemp_seed.png b/mods/farming/textures/farming_hemp_seed.png new file mode 100644 index 0000000..6be42c8 Binary files /dev/null and b/mods/farming/textures/farming_hemp_seed.png differ diff --git a/mods/farming/textures/farming_hoe_bomb.png b/mods/farming/textures/farming_hoe_bomb.png new file mode 100644 index 0000000..e8db9b1 Binary files /dev/null and b/mods/farming/textures/farming_hoe_bomb.png differ diff --git a/mods/farming/textures/farming_jaffa_cake.png b/mods/farming/textures/farming_jaffa_cake.png new file mode 100644 index 0000000..87cc003 Binary files /dev/null and b/mods/farming/textures/farming_jaffa_cake.png differ diff --git a/mods/farming/textures/farming_juicer.png b/mods/farming/textures/farming_juicer.png new file mode 100644 index 0000000..46265e4 Binary files /dev/null and b/mods/farming/textures/farming_juicer.png differ diff --git a/mods/farming/textures/farming_lettuce.png b/mods/farming/textures/farming_lettuce.png new file mode 100644 index 0000000..3f29fbe Binary files /dev/null and b/mods/farming/textures/farming_lettuce.png differ diff --git a/mods/farming/textures/farming_lettuce_1.png b/mods/farming/textures/farming_lettuce_1.png new file mode 100644 index 0000000..39ce983 Binary files /dev/null and b/mods/farming/textures/farming_lettuce_1.png differ diff --git a/mods/farming/textures/farming_lettuce_2.png b/mods/farming/textures/farming_lettuce_2.png new file mode 100644 index 0000000..0e4ab30 Binary files /dev/null and b/mods/farming/textures/farming_lettuce_2.png differ diff --git a/mods/farming/textures/farming_lettuce_3.png b/mods/farming/textures/farming_lettuce_3.png new file mode 100644 index 0000000..066833b Binary files /dev/null and b/mods/farming/textures/farming_lettuce_3.png differ diff --git a/mods/farming/textures/farming_lettuce_4.png b/mods/farming/textures/farming_lettuce_4.png new file mode 100644 index 0000000..847a2de Binary files /dev/null and b/mods/farming/textures/farming_lettuce_4.png differ diff --git a/mods/farming/textures/farming_lettuce_5.png b/mods/farming/textures/farming_lettuce_5.png new file mode 100644 index 0000000..97651f4 Binary files /dev/null and b/mods/farming/textures/farming_lettuce_5.png differ diff --git a/mods/farming/textures/farming_melon_1.png b/mods/farming/textures/farming_melon_1.png new file mode 100644 index 0000000..3c6ea6d Binary files /dev/null and b/mods/farming/textures/farming_melon_1.png differ diff --git a/mods/farming/textures/farming_melon_2.png b/mods/farming/textures/farming_melon_2.png new file mode 100644 index 0000000..185ed82 Binary files /dev/null and b/mods/farming/textures/farming_melon_2.png differ diff --git a/mods/farming/textures/farming_melon_3.png b/mods/farming/textures/farming_melon_3.png new file mode 100644 index 0000000..6e661f9 Binary files /dev/null and b/mods/farming/textures/farming_melon_3.png differ diff --git a/mods/farming/textures/farming_melon_4.png b/mods/farming/textures/farming_melon_4.png new file mode 100644 index 0000000..d9199f3 Binary files /dev/null and b/mods/farming/textures/farming_melon_4.png differ diff --git a/mods/farming/textures/farming_melon_5.png b/mods/farming/textures/farming_melon_5.png new file mode 100644 index 0000000..755cbd3 Binary files /dev/null and b/mods/farming/textures/farming_melon_5.png differ diff --git a/mods/farming/textures/farming_melon_6.png b/mods/farming/textures/farming_melon_6.png new file mode 100644 index 0000000..b31a5b4 Binary files /dev/null and b/mods/farming/textures/farming_melon_6.png differ diff --git a/mods/farming/textures/farming_melon_7.png b/mods/farming/textures/farming_melon_7.png new file mode 100644 index 0000000..3aebfdd Binary files /dev/null and b/mods/farming/textures/farming_melon_7.png differ diff --git a/mods/farming/textures/farming_melon_bottom.png b/mods/farming/textures/farming_melon_bottom.png new file mode 100644 index 0000000..91d1e6c Binary files /dev/null and b/mods/farming/textures/farming_melon_bottom.png differ diff --git a/mods/farming/textures/farming_melon_side.png b/mods/farming/textures/farming_melon_side.png new file mode 100644 index 0000000..07afb25 Binary files /dev/null and b/mods/farming/textures/farming_melon_side.png differ diff --git a/mods/farming/textures/farming_melon_slice.png b/mods/farming/textures/farming_melon_slice.png new file mode 100644 index 0000000..6ee9775 Binary files /dev/null and b/mods/farming/textures/farming_melon_slice.png differ diff --git a/mods/farming/textures/farming_melon_top.png b/mods/farming/textures/farming_melon_top.png new file mode 100644 index 0000000..29ca92d Binary files /dev/null and b/mods/farming/textures/farming_melon_top.png differ diff --git a/mods/farming/textures/farming_mint_1.png b/mods/farming/textures/farming_mint_1.png new file mode 100644 index 0000000..1f303ae Binary files /dev/null and b/mods/farming/textures/farming_mint_1.png differ diff --git a/mods/farming/textures/farming_mint_2.png b/mods/farming/textures/farming_mint_2.png new file mode 100644 index 0000000..cdcde54 Binary files /dev/null and b/mods/farming/textures/farming_mint_2.png differ diff --git a/mods/farming/textures/farming_mint_3.png b/mods/farming/textures/farming_mint_3.png new file mode 100644 index 0000000..4bfc43f Binary files /dev/null and b/mods/farming/textures/farming_mint_3.png differ diff --git a/mods/farming/textures/farming_mint_4.png b/mods/farming/textures/farming_mint_4.png new file mode 100644 index 0000000..a71a6e3 Binary files /dev/null and b/mods/farming/textures/farming_mint_4.png differ diff --git a/mods/farming/textures/farming_mint_leaf.png b/mods/farming/textures/farming_mint_leaf.png new file mode 100644 index 0000000..9e14467 Binary files /dev/null and b/mods/farming/textures/farming_mint_leaf.png differ diff --git a/mods/farming/textures/farming_mint_seeds.png b/mods/farming/textures/farming_mint_seeds.png new file mode 100644 index 0000000..2e0a0ea Binary files /dev/null and b/mods/farming/textures/farming_mint_seeds.png differ diff --git a/mods/farming/textures/farming_mint_tea.png b/mods/farming/textures/farming_mint_tea.png new file mode 100644 index 0000000..a4b6440 Binary files /dev/null and b/mods/farming/textures/farming_mint_tea.png differ diff --git a/mods/farming/textures/farming_mixing_bowl.png b/mods/farming/textures/farming_mixing_bowl.png new file mode 100644 index 0000000..e96edf0 Binary files /dev/null and b/mods/farming/textures/farming_mixing_bowl.png differ diff --git a/mods/farming/textures/farming_mochi.png b/mods/farming/textures/farming_mochi.png new file mode 100644 index 0000000..7b3b2b5 Binary files /dev/null and b/mods/farming/textures/farming_mochi.png differ diff --git a/mods/farming/textures/farming_mortar_pestle.png b/mods/farming/textures/farming_mortar_pestle.png new file mode 100644 index 0000000..abfeb9e Binary files /dev/null and b/mods/farming/textures/farming_mortar_pestle.png differ diff --git a/mods/farming/textures/farming_oat.png b/mods/farming/textures/farming_oat.png new file mode 100644 index 0000000..e8d5c23 Binary files /dev/null and b/mods/farming/textures/farming_oat.png differ diff --git a/mods/farming/textures/farming_oat_1.png b/mods/farming/textures/farming_oat_1.png new file mode 100644 index 0000000..177fbdf Binary files /dev/null and b/mods/farming/textures/farming_oat_1.png differ diff --git a/mods/farming/textures/farming_oat_2.png b/mods/farming/textures/farming_oat_2.png new file mode 100644 index 0000000..fe051ea Binary files /dev/null and b/mods/farming/textures/farming_oat_2.png differ diff --git a/mods/farming/textures/farming_oat_3.png b/mods/farming/textures/farming_oat_3.png new file mode 100644 index 0000000..5aba108 Binary files /dev/null and b/mods/farming/textures/farming_oat_3.png differ diff --git a/mods/farming/textures/farming_oat_4.png b/mods/farming/textures/farming_oat_4.png new file mode 100644 index 0000000..833b134 Binary files /dev/null and b/mods/farming/textures/farming_oat_4.png differ diff --git a/mods/farming/textures/farming_oat_5.png b/mods/farming/textures/farming_oat_5.png new file mode 100644 index 0000000..ec0803b Binary files /dev/null and b/mods/farming/textures/farming_oat_5.png differ diff --git a/mods/farming/textures/farming_oat_6.png b/mods/farming/textures/farming_oat_6.png new file mode 100644 index 0000000..847adc5 Binary files /dev/null and b/mods/farming/textures/farming_oat_6.png differ diff --git a/mods/farming/textures/farming_oat_7.png b/mods/farming/textures/farming_oat_7.png new file mode 100644 index 0000000..3552811 Binary files /dev/null and b/mods/farming/textures/farming_oat_7.png differ diff --git a/mods/farming/textures/farming_oat_8.png b/mods/farming/textures/farming_oat_8.png new file mode 100644 index 0000000..c7a5540 Binary files /dev/null and b/mods/farming/textures/farming_oat_8.png differ diff --git a/mods/farming/textures/farming_oat_seed.png b/mods/farming/textures/farming_oat_seed.png new file mode 100644 index 0000000..893c93c Binary files /dev/null and b/mods/farming/textures/farming_oat_seed.png differ diff --git a/mods/farming/textures/farming_onigiri.png b/mods/farming/textures/farming_onigiri.png new file mode 100644 index 0000000..86ee7c6 Binary files /dev/null and b/mods/farming/textures/farming_onigiri.png differ diff --git a/mods/farming/textures/farming_onion_soup.png b/mods/farming/textures/farming_onion_soup.png new file mode 100644 index 0000000..cd535ae Binary files /dev/null and b/mods/farming/textures/farming_onion_soup.png differ diff --git a/mods/farming/textures/farming_orange.png b/mods/farming/textures/farming_orange.png new file mode 100644 index 0000000..8b9ec29 Binary files /dev/null and b/mods/farming/textures/farming_orange.png differ diff --git a/mods/farming/textures/farming_paella.png b/mods/farming/textures/farming_paella.png new file mode 100644 index 0000000..1362ac7 Binary files /dev/null and b/mods/farming/textures/farming_paella.png differ diff --git a/mods/farming/textures/farming_parsley.png b/mods/farming/textures/farming_parsley.png new file mode 100644 index 0000000..183ecb7 Binary files /dev/null and b/mods/farming/textures/farming_parsley.png differ diff --git a/mods/farming/textures/farming_parsley_1.png b/mods/farming/textures/farming_parsley_1.png new file mode 100644 index 0000000..632928c Binary files /dev/null and b/mods/farming/textures/farming_parsley_1.png differ diff --git a/mods/farming/textures/farming_parsley_2.png b/mods/farming/textures/farming_parsley_2.png new file mode 100644 index 0000000..fddbf00 Binary files /dev/null and b/mods/farming/textures/farming_parsley_2.png differ diff --git a/mods/farming/textures/farming_parsley_3.png b/mods/farming/textures/farming_parsley_3.png new file mode 100644 index 0000000..e4aacb9 Binary files /dev/null and b/mods/farming/textures/farming_parsley_3.png differ diff --git a/mods/farming/textures/farming_pasta.png b/mods/farming/textures/farming_pasta.png new file mode 100644 index 0000000..af6a48c Binary files /dev/null and b/mods/farming/textures/farming_pasta.png differ diff --git a/mods/farming/textures/farming_pea_1.png b/mods/farming/textures/farming_pea_1.png new file mode 100644 index 0000000..eb48e36 Binary files /dev/null and b/mods/farming/textures/farming_pea_1.png differ diff --git a/mods/farming/textures/farming_pea_2.png b/mods/farming/textures/farming_pea_2.png new file mode 100644 index 0000000..4db7551 Binary files /dev/null and b/mods/farming/textures/farming_pea_2.png differ diff --git a/mods/farming/textures/farming_pea_3.png b/mods/farming/textures/farming_pea_3.png new file mode 100644 index 0000000..980d6ea Binary files /dev/null and b/mods/farming/textures/farming_pea_3.png differ diff --git a/mods/farming/textures/farming_pea_4.png b/mods/farming/textures/farming_pea_4.png new file mode 100644 index 0000000..551eaf4 Binary files /dev/null and b/mods/farming/textures/farming_pea_4.png differ diff --git a/mods/farming/textures/farming_pea_5.png b/mods/farming/textures/farming_pea_5.png new file mode 100644 index 0000000..907760d Binary files /dev/null and b/mods/farming/textures/farming_pea_5.png differ diff --git a/mods/farming/textures/farming_pea_pod.png b/mods/farming/textures/farming_pea_pod.png new file mode 100644 index 0000000..1c19c9f Binary files /dev/null and b/mods/farming/textures/farming_pea_pod.png differ diff --git a/mods/farming/textures/farming_pea_soup.png b/mods/farming/textures/farming_pea_soup.png new file mode 100644 index 0000000..03753cf Binary files /dev/null and b/mods/farming/textures/farming_pea_soup.png differ diff --git a/mods/farming/textures/farming_pineapple.png b/mods/farming/textures/farming_pineapple.png new file mode 100644 index 0000000..febf22a Binary files /dev/null and b/mods/farming/textures/farming_pineapple.png differ diff --git a/mods/farming/textures/farming_pineapple_1.png b/mods/farming/textures/farming_pineapple_1.png new file mode 100644 index 0000000..262eff7 Binary files /dev/null and b/mods/farming/textures/farming_pineapple_1.png differ diff --git a/mods/farming/textures/farming_pineapple_2.png b/mods/farming/textures/farming_pineapple_2.png new file mode 100644 index 0000000..4b96d17 Binary files /dev/null and b/mods/farming/textures/farming_pineapple_2.png differ diff --git a/mods/farming/textures/farming_pineapple_3.png b/mods/farming/textures/farming_pineapple_3.png new file mode 100644 index 0000000..90464a1 Binary files /dev/null and b/mods/farming/textures/farming_pineapple_3.png differ diff --git a/mods/farming/textures/farming_pineapple_4.png b/mods/farming/textures/farming_pineapple_4.png new file mode 100644 index 0000000..be58e53 Binary files /dev/null and b/mods/farming/textures/farming_pineapple_4.png differ diff --git a/mods/farming/textures/farming_pineapple_5.png b/mods/farming/textures/farming_pineapple_5.png new file mode 100644 index 0000000..2526f83 Binary files /dev/null and b/mods/farming/textures/farming_pineapple_5.png differ diff --git a/mods/farming/textures/farming_pineapple_6.png b/mods/farming/textures/farming_pineapple_6.png new file mode 100644 index 0000000..741e0e3 Binary files /dev/null and b/mods/farming/textures/farming_pineapple_6.png differ diff --git a/mods/farming/textures/farming_pineapple_7.png b/mods/farming/textures/farming_pineapple_7.png new file mode 100644 index 0000000..22bad23 Binary files /dev/null and b/mods/farming/textures/farming_pineapple_7.png differ diff --git a/mods/farming/textures/farming_pineapple_8.png b/mods/farming/textures/farming_pineapple_8.png new file mode 100644 index 0000000..5182c4f Binary files /dev/null and b/mods/farming/textures/farming_pineapple_8.png differ diff --git a/mods/farming/textures/farming_pineapple_juice.png b/mods/farming/textures/farming_pineapple_juice.png new file mode 100644 index 0000000..43a54c7 Binary files /dev/null and b/mods/farming/textures/farming_pineapple_juice.png differ diff --git a/mods/farming/textures/farming_pineapple_ring.png b/mods/farming/textures/farming_pineapple_ring.png new file mode 100644 index 0000000..4cf3feb Binary files /dev/null and b/mods/farming/textures/farming_pineapple_ring.png differ diff --git a/mods/farming/textures/farming_pineapple_top.png b/mods/farming/textures/farming_pineapple_top.png new file mode 100644 index 0000000..f653d83 Binary files /dev/null and b/mods/farming/textures/farming_pineapple_top.png differ diff --git a/mods/farming/textures/farming_popcorn.png b/mods/farming/textures/farming_popcorn.png new file mode 100644 index 0000000..6a534b9 Binary files /dev/null and b/mods/farming/textures/farming_popcorn.png differ diff --git a/mods/farming/textures/farming_porridge.png b/mods/farming/textures/farming_porridge.png new file mode 100644 index 0000000..cd4466f Binary files /dev/null and b/mods/farming/textures/farming_porridge.png differ diff --git a/mods/farming/textures/farming_pot.png b/mods/farming/textures/farming_pot.png new file mode 100644 index 0000000..d28411d Binary files /dev/null and b/mods/farming/textures/farming_pot.png differ diff --git a/mods/farming/textures/farming_potato.png b/mods/farming/textures/farming_potato.png new file mode 100644 index 0000000..6e91d6a Binary files /dev/null and b/mods/farming/textures/farming_potato.png differ diff --git a/mods/farming/textures/farming_potato_1.png b/mods/farming/textures/farming_potato_1.png new file mode 100644 index 0000000..a9c0040 Binary files /dev/null and b/mods/farming/textures/farming_potato_1.png differ diff --git a/mods/farming/textures/farming_potato_2.png b/mods/farming/textures/farming_potato_2.png new file mode 100644 index 0000000..c81830c Binary files /dev/null and b/mods/farming/textures/farming_potato_2.png differ diff --git a/mods/farming/textures/farming_potato_3.png b/mods/farming/textures/farming_potato_3.png new file mode 100644 index 0000000..a3d7920 Binary files /dev/null and b/mods/farming/textures/farming_potato_3.png differ diff --git a/mods/farming/textures/farming_potato_4.png b/mods/farming/textures/farming_potato_4.png new file mode 100644 index 0000000..405b7e5 Binary files /dev/null and b/mods/farming/textures/farming_potato_4.png differ diff --git a/mods/farming/textures/farming_potato_omelet.png b/mods/farming/textures/farming_potato_omelet.png new file mode 100644 index 0000000..abdacad Binary files /dev/null and b/mods/farming/textures/farming_potato_omelet.png differ diff --git a/mods/farming/textures/farming_potato_salad.png b/mods/farming/textures/farming_potato_salad.png new file mode 100644 index 0000000..0028c91 Binary files /dev/null and b/mods/farming/textures/farming_potato_salad.png differ diff --git a/mods/farming/textures/farming_pumpkin_1.png b/mods/farming/textures/farming_pumpkin_1.png new file mode 100644 index 0000000..e5b9a2b Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_1.png differ diff --git a/mods/farming/textures/farming_pumpkin_2.png b/mods/farming/textures/farming_pumpkin_2.png new file mode 100644 index 0000000..d977e8c Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_2.png differ diff --git a/mods/farming/textures/farming_pumpkin_3.png b/mods/farming/textures/farming_pumpkin_3.png new file mode 100644 index 0000000..83f8190 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_3.png differ diff --git a/mods/farming/textures/farming_pumpkin_4.png b/mods/farming/textures/farming_pumpkin_4.png new file mode 100644 index 0000000..20de004 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_4.png differ diff --git a/mods/farming/textures/farming_pumpkin_5.png b/mods/farming/textures/farming_pumpkin_5.png new file mode 100644 index 0000000..59fa78e Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_5.png differ diff --git a/mods/farming/textures/farming_pumpkin_6.png b/mods/farming/textures/farming_pumpkin_6.png new file mode 100644 index 0000000..6ae543e Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_6.png differ diff --git a/mods/farming/textures/farming_pumpkin_7.png b/mods/farming/textures/farming_pumpkin_7.png new file mode 100644 index 0000000..79190e0 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_7.png differ diff --git a/mods/farming/textures/farming_pumpkin_8.png b/mods/farming/textures/farming_pumpkin_8.png new file mode 100644 index 0000000..b941442 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_8.png differ diff --git a/mods/farming/textures/farming_pumpkin_bottom.png b/mods/farming/textures/farming_pumpkin_bottom.png new file mode 100644 index 0000000..b23d241 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_bottom.png differ diff --git a/mods/farming/textures/farming_pumpkin_bread.png b/mods/farming/textures/farming_pumpkin_bread.png new file mode 100644 index 0000000..0dfae08 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_bread.png differ diff --git a/mods/farming/textures/farming_pumpkin_dough.png b/mods/farming/textures/farming_pumpkin_dough.png new file mode 100644 index 0000000..62ea7a6 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_dough.png differ diff --git a/mods/farming/textures/farming_pumpkin_face_off.png b/mods/farming/textures/farming_pumpkin_face_off.png new file mode 100644 index 0000000..df70171 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_face_off.png differ diff --git a/mods/farming/textures/farming_pumpkin_face_on.png b/mods/farming/textures/farming_pumpkin_face_on.png new file mode 100644 index 0000000..fa71c9d Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_face_on.png differ diff --git a/mods/farming/textures/farming_pumpkin_side.png b/mods/farming/textures/farming_pumpkin_side.png new file mode 100644 index 0000000..2d30f20 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_side.png differ diff --git a/mods/farming/textures/farming_pumpkin_slice.png b/mods/farming/textures/farming_pumpkin_slice.png new file mode 100644 index 0000000..1fb659e Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_slice.png differ diff --git a/mods/farming/textures/farming_pumpkin_top.png b/mods/farming/textures/farming_pumpkin_top.png new file mode 100644 index 0000000..7928345 Binary files /dev/null and b/mods/farming/textures/farming_pumpkin_top.png differ diff --git a/mods/farming/textures/farming_raspberries.png b/mods/farming/textures/farming_raspberries.png new file mode 100644 index 0000000..ab96e1b Binary files /dev/null and b/mods/farming/textures/farming_raspberries.png differ diff --git a/mods/farming/textures/farming_raspberry_1.png b/mods/farming/textures/farming_raspberry_1.png new file mode 100644 index 0000000..d1a7ffc Binary files /dev/null and b/mods/farming/textures/farming_raspberry_1.png differ diff --git a/mods/farming/textures/farming_raspberry_2.png b/mods/farming/textures/farming_raspberry_2.png new file mode 100644 index 0000000..308a0ca Binary files /dev/null and b/mods/farming/textures/farming_raspberry_2.png differ diff --git a/mods/farming/textures/farming_raspberry_3.png b/mods/farming/textures/farming_raspberry_3.png new file mode 100644 index 0000000..43d2ab1 Binary files /dev/null and b/mods/farming/textures/farming_raspberry_3.png differ diff --git a/mods/farming/textures/farming_raspberry_4.png b/mods/farming/textures/farming_raspberry_4.png new file mode 100644 index 0000000..32da6b9 Binary files /dev/null and b/mods/farming/textures/farming_raspberry_4.png differ diff --git a/mods/farming/textures/farming_raspberry_smoothie.png b/mods/farming/textures/farming_raspberry_smoothie.png new file mode 100644 index 0000000..fe178d1 Binary files /dev/null and b/mods/farming/textures/farming_raspberry_smoothie.png differ diff --git a/mods/farming/textures/farming_rhubarb.png b/mods/farming/textures/farming_rhubarb.png new file mode 100644 index 0000000..7d416ab Binary files /dev/null and b/mods/farming/textures/farming_rhubarb.png differ diff --git a/mods/farming/textures/farming_rhubarb_1.png b/mods/farming/textures/farming_rhubarb_1.png new file mode 100644 index 0000000..01585b1 Binary files /dev/null and b/mods/farming/textures/farming_rhubarb_1.png differ diff --git a/mods/farming/textures/farming_rhubarb_2.png b/mods/farming/textures/farming_rhubarb_2.png new file mode 100644 index 0000000..71845c7 Binary files /dev/null and b/mods/farming/textures/farming_rhubarb_2.png differ diff --git a/mods/farming/textures/farming_rhubarb_3.png b/mods/farming/textures/farming_rhubarb_3.png new file mode 100644 index 0000000..b412f7e Binary files /dev/null and b/mods/farming/textures/farming_rhubarb_3.png differ diff --git a/mods/farming/textures/farming_rhubarb_pie.png b/mods/farming/textures/farming_rhubarb_pie.png new file mode 100644 index 0000000..1f77b53 Binary files /dev/null and b/mods/farming/textures/farming_rhubarb_pie.png differ diff --git a/mods/farming/textures/farming_rice.png b/mods/farming/textures/farming_rice.png new file mode 100644 index 0000000..3d64c7e Binary files /dev/null and b/mods/farming/textures/farming_rice.png differ diff --git a/mods/farming/textures/farming_rice_1.png b/mods/farming/textures/farming_rice_1.png new file mode 100644 index 0000000..715bb2e Binary files /dev/null and b/mods/farming/textures/farming_rice_1.png differ diff --git a/mods/farming/textures/farming_rice_2.png b/mods/farming/textures/farming_rice_2.png new file mode 100644 index 0000000..2662d42 Binary files /dev/null and b/mods/farming/textures/farming_rice_2.png differ diff --git a/mods/farming/textures/farming_rice_3.png b/mods/farming/textures/farming_rice_3.png new file mode 100644 index 0000000..fee87b2 Binary files /dev/null and b/mods/farming/textures/farming_rice_3.png differ diff --git a/mods/farming/textures/farming_rice_4.png b/mods/farming/textures/farming_rice_4.png new file mode 100644 index 0000000..97b026f Binary files /dev/null and b/mods/farming/textures/farming_rice_4.png differ diff --git a/mods/farming/textures/farming_rice_5.png b/mods/farming/textures/farming_rice_5.png new file mode 100644 index 0000000..c249851 Binary files /dev/null and b/mods/farming/textures/farming_rice_5.png differ diff --git a/mods/farming/textures/farming_rice_6.png b/mods/farming/textures/farming_rice_6.png new file mode 100644 index 0000000..c0e7233 Binary files /dev/null and b/mods/farming/textures/farming_rice_6.png differ diff --git a/mods/farming/textures/farming_rice_7.png b/mods/farming/textures/farming_rice_7.png new file mode 100644 index 0000000..9d251ee Binary files /dev/null and b/mods/farming/textures/farming_rice_7.png differ diff --git a/mods/farming/textures/farming_rice_8.png b/mods/farming/textures/farming_rice_8.png new file mode 100644 index 0000000..41b37e0 Binary files /dev/null and b/mods/farming/textures/farming_rice_8.png differ diff --git a/mods/farming/textures/farming_rice_bread.png b/mods/farming/textures/farming_rice_bread.png new file mode 100644 index 0000000..f14f741 Binary files /dev/null and b/mods/farming/textures/farming_rice_bread.png differ diff --git a/mods/farming/textures/farming_rice_flour.png b/mods/farming/textures/farming_rice_flour.png new file mode 100644 index 0000000..2722151 Binary files /dev/null and b/mods/farming/textures/farming_rice_flour.png differ diff --git a/mods/farming/textures/farming_rose_water.png b/mods/farming/textures/farming_rose_water.png new file mode 100644 index 0000000..96e546f Binary files /dev/null and b/mods/farming/textures/farming_rose_water.png differ diff --git a/mods/farming/textures/farming_rye.png b/mods/farming/textures/farming_rye.png new file mode 100644 index 0000000..ebc5b37 Binary files /dev/null and b/mods/farming/textures/farming_rye.png differ diff --git a/mods/farming/textures/farming_rye_1.png b/mods/farming/textures/farming_rye_1.png new file mode 100644 index 0000000..932b621 Binary files /dev/null and b/mods/farming/textures/farming_rye_1.png differ diff --git a/mods/farming/textures/farming_rye_2.png b/mods/farming/textures/farming_rye_2.png new file mode 100644 index 0000000..b6a69b7 Binary files /dev/null and b/mods/farming/textures/farming_rye_2.png differ diff --git a/mods/farming/textures/farming_rye_3.png b/mods/farming/textures/farming_rye_3.png new file mode 100644 index 0000000..aaa71c2 Binary files /dev/null and b/mods/farming/textures/farming_rye_3.png differ diff --git a/mods/farming/textures/farming_rye_4.png b/mods/farming/textures/farming_rye_4.png new file mode 100644 index 0000000..ea1246e Binary files /dev/null and b/mods/farming/textures/farming_rye_4.png differ diff --git a/mods/farming/textures/farming_rye_5.png b/mods/farming/textures/farming_rye_5.png new file mode 100644 index 0000000..b359673 Binary files /dev/null and b/mods/farming/textures/farming_rye_5.png differ diff --git a/mods/farming/textures/farming_rye_6.png b/mods/farming/textures/farming_rye_6.png new file mode 100644 index 0000000..749a2ef Binary files /dev/null and b/mods/farming/textures/farming_rye_6.png differ diff --git a/mods/farming/textures/farming_rye_7.png b/mods/farming/textures/farming_rye_7.png new file mode 100644 index 0000000..fc78198 Binary files /dev/null and b/mods/farming/textures/farming_rye_7.png differ diff --git a/mods/farming/textures/farming_rye_8.png b/mods/farming/textures/farming_rye_8.png new file mode 100644 index 0000000..0b7c33e Binary files /dev/null and b/mods/farming/textures/farming_rye_8.png differ diff --git a/mods/farming/textures/farming_rye_seed.png b/mods/farming/textures/farming_rye_seed.png new file mode 100644 index 0000000..e65ba9b Binary files /dev/null and b/mods/farming/textures/farming_rye_seed.png differ diff --git a/mods/farming/textures/farming_salad.png b/mods/farming/textures/farming_salad.png new file mode 100644 index 0000000..febf40f Binary files /dev/null and b/mods/farming/textures/farming_salad.png differ diff --git a/mods/farming/textures/farming_salt.png b/mods/farming/textures/farming_salt.png new file mode 100644 index 0000000..2b23e33 Binary files /dev/null and b/mods/farming/textures/farming_salt.png differ diff --git a/mods/farming/textures/farming_salt_crystal.png b/mods/farming/textures/farming_salt_crystal.png new file mode 100644 index 0000000..e94ed7b Binary files /dev/null and b/mods/farming/textures/farming_salt_crystal.png differ diff --git a/mods/farming/textures/farming_saucepan.png b/mods/farming/textures/farming_saucepan.png new file mode 100644 index 0000000..2625d45 Binary files /dev/null and b/mods/farming/textures/farming_saucepan.png differ diff --git a/mods/farming/textures/farming_scythe_mithril.png b/mods/farming/textures/farming_scythe_mithril.png new file mode 100644 index 0000000..17c89c5 Binary files /dev/null and b/mods/farming/textures/farming_scythe_mithril.png differ diff --git a/mods/farming/textures/farming_skillet.png b/mods/farming/textures/farming_skillet.png new file mode 100644 index 0000000..60d26a1 Binary files /dev/null and b/mods/farming/textures/farming_skillet.png differ diff --git a/mods/farming/textures/farming_soy_1.png b/mods/farming/textures/farming_soy_1.png new file mode 100644 index 0000000..9a64d87 Binary files /dev/null and b/mods/farming/textures/farming_soy_1.png differ diff --git a/mods/farming/textures/farming_soy_2.png b/mods/farming/textures/farming_soy_2.png new file mode 100644 index 0000000..e491594 Binary files /dev/null and b/mods/farming/textures/farming_soy_2.png differ diff --git a/mods/farming/textures/farming_soy_3.png b/mods/farming/textures/farming_soy_3.png new file mode 100644 index 0000000..e8f39ee Binary files /dev/null and b/mods/farming/textures/farming_soy_3.png differ diff --git a/mods/farming/textures/farming_soy_4.png b/mods/farming/textures/farming_soy_4.png new file mode 100644 index 0000000..3012c2a Binary files /dev/null and b/mods/farming/textures/farming_soy_4.png differ diff --git a/mods/farming/textures/farming_soy_5.png b/mods/farming/textures/farming_soy_5.png new file mode 100644 index 0000000..63f0ce4 Binary files /dev/null and b/mods/farming/textures/farming_soy_5.png differ diff --git a/mods/farming/textures/farming_soy_6.png b/mods/farming/textures/farming_soy_6.png new file mode 100644 index 0000000..581def5 Binary files /dev/null and b/mods/farming/textures/farming_soy_6.png differ diff --git a/mods/farming/textures/farming_soy_7.png b/mods/farming/textures/farming_soy_7.png new file mode 100644 index 0000000..eb47e32 Binary files /dev/null and b/mods/farming/textures/farming_soy_7.png differ diff --git a/mods/farming/textures/farming_soy_milk_glass.png b/mods/farming/textures/farming_soy_milk_glass.png new file mode 100644 index 0000000..95c567d Binary files /dev/null and b/mods/farming/textures/farming_soy_milk_glass.png differ diff --git a/mods/farming/textures/farming_soy_pod.png b/mods/farming/textures/farming_soy_pod.png new file mode 100644 index 0000000..eceeec5 Binary files /dev/null and b/mods/farming/textures/farming_soy_pod.png differ diff --git a/mods/farming/textures/farming_soy_sauce.png b/mods/farming/textures/farming_soy_sauce.png new file mode 100644 index 0000000..f32caec Binary files /dev/null and b/mods/farming/textures/farming_soy_sauce.png differ diff --git a/mods/farming/textures/farming_spaghetti.png b/mods/farming/textures/farming_spaghetti.png new file mode 100644 index 0000000..a401281 Binary files /dev/null and b/mods/farming/textures/farming_spaghetti.png differ diff --git a/mods/farming/textures/farming_spanish_potatoes.png b/mods/farming/textures/farming_spanish_potatoes.png new file mode 100644 index 0000000..198b50e Binary files /dev/null and b/mods/farming/textures/farming_spanish_potatoes.png differ diff --git a/mods/farming/textures/farming_straw.png b/mods/farming/textures/farming_straw.png index f9f5fe7..e427772 100644 Binary files a/mods/farming/textures/farming_straw.png and b/mods/farming/textures/farming_straw.png differ diff --git a/mods/farming/textures/farming_strawberry.png b/mods/farming/textures/farming_strawberry.png new file mode 100644 index 0000000..5b43e6b Binary files /dev/null and b/mods/farming/textures/farming_strawberry.png differ diff --git a/mods/farming/textures/farming_sugar.png b/mods/farming/textures/farming_sugar.png new file mode 100644 index 0000000..5cb7fa0 Binary files /dev/null and b/mods/farming/textures/farming_sugar.png differ diff --git a/mods/farming/textures/farming_sunflower.png b/mods/farming/textures/farming_sunflower.png new file mode 100644 index 0000000..06b9387 Binary files /dev/null and b/mods/farming/textures/farming_sunflower.png differ diff --git a/mods/farming/textures/farming_sunflower_1.png b/mods/farming/textures/farming_sunflower_1.png new file mode 100644 index 0000000..719ec40 Binary files /dev/null and b/mods/farming/textures/farming_sunflower_1.png differ diff --git a/mods/farming/textures/farming_sunflower_2.png b/mods/farming/textures/farming_sunflower_2.png new file mode 100644 index 0000000..4ccfff3 Binary files /dev/null and b/mods/farming/textures/farming_sunflower_2.png differ diff --git a/mods/farming/textures/farming_sunflower_3.png b/mods/farming/textures/farming_sunflower_3.png new file mode 100644 index 0000000..719b5f1 Binary files /dev/null and b/mods/farming/textures/farming_sunflower_3.png differ diff --git a/mods/farming/textures/farming_sunflower_4.png b/mods/farming/textures/farming_sunflower_4.png new file mode 100644 index 0000000..2b03eb5 Binary files /dev/null and b/mods/farming/textures/farming_sunflower_4.png differ diff --git a/mods/farming/textures/farming_sunflower_5.png b/mods/farming/textures/farming_sunflower_5.png new file mode 100644 index 0000000..a9c474e Binary files /dev/null and b/mods/farming/textures/farming_sunflower_5.png differ diff --git a/mods/farming/textures/farming_sunflower_6.png b/mods/farming/textures/farming_sunflower_6.png new file mode 100644 index 0000000..a2ee843 Binary files /dev/null and b/mods/farming/textures/farming_sunflower_6.png differ diff --git a/mods/farming/textures/farming_sunflower_7.png b/mods/farming/textures/farming_sunflower_7.png new file mode 100644 index 0000000..e3a0986 Binary files /dev/null and b/mods/farming/textures/farming_sunflower_7.png differ diff --git a/mods/farming/textures/farming_sunflower_8.png b/mods/farming/textures/farming_sunflower_8.png new file mode 100644 index 0000000..5d1022f Binary files /dev/null and b/mods/farming/textures/farming_sunflower_8.png differ diff --git a/mods/farming/textures/farming_sunflower_bread.png b/mods/farming/textures/farming_sunflower_bread.png new file mode 100644 index 0000000..112e8c6 Binary files /dev/null and b/mods/farming/textures/farming_sunflower_bread.png differ diff --git a/mods/farming/textures/farming_sunflower_oil.png b/mods/farming/textures/farming_sunflower_oil.png new file mode 100644 index 0000000..36d139f Binary files /dev/null and b/mods/farming/textures/farming_sunflower_oil.png differ diff --git a/mods/farming/textures/farming_sunflower_seeds.png b/mods/farming/textures/farming_sunflower_seeds.png new file mode 100644 index 0000000..fe67a0c Binary files /dev/null and b/mods/farming/textures/farming_sunflower_seeds.png differ diff --git a/mods/farming/textures/farming_sunflower_seeds_toasted.png b/mods/farming/textures/farming_sunflower_seeds_toasted.png new file mode 100644 index 0000000..1973e48 Binary files /dev/null and b/mods/farming/textures/farming_sunflower_seeds_toasted.png differ diff --git a/mods/farming/textures/farming_toast.png b/mods/farming/textures/farming_toast.png new file mode 100644 index 0000000..8a4524e Binary files /dev/null and b/mods/farming/textures/farming_toast.png differ diff --git a/mods/farming/textures/farming_toast_sandwich.png b/mods/farming/textures/farming_toast_sandwich.png new file mode 100644 index 0000000..c60ff5a Binary files /dev/null and b/mods/farming/textures/farming_toast_sandwich.png differ diff --git a/mods/farming/textures/farming_tofu.png b/mods/farming/textures/farming_tofu.png new file mode 100644 index 0000000..aaa0a2c Binary files /dev/null and b/mods/farming/textures/farming_tofu.png differ diff --git a/mods/farming/textures/farming_tofu_cooked.png b/mods/farming/textures/farming_tofu_cooked.png new file mode 100644 index 0000000..23963ce Binary files /dev/null and b/mods/farming/textures/farming_tofu_cooked.png differ diff --git a/mods/farming/textures/farming_tomato.png b/mods/farming/textures/farming_tomato.png new file mode 100644 index 0000000..586aa56 Binary files /dev/null and b/mods/farming/textures/farming_tomato.png differ diff --git a/mods/farming/textures/farming_tomato_1.png b/mods/farming/textures/farming_tomato_1.png new file mode 100644 index 0000000..d858e58 Binary files /dev/null and b/mods/farming/textures/farming_tomato_1.png differ diff --git a/mods/farming/textures/farming_tomato_2.png b/mods/farming/textures/farming_tomato_2.png new file mode 100644 index 0000000..9d9ed6d Binary files /dev/null and b/mods/farming/textures/farming_tomato_2.png differ diff --git a/mods/farming/textures/farming_tomato_3.png b/mods/farming/textures/farming_tomato_3.png new file mode 100644 index 0000000..fe3dcf0 Binary files /dev/null and b/mods/farming/textures/farming_tomato_3.png differ diff --git a/mods/farming/textures/farming_tomato_4.png b/mods/farming/textures/farming_tomato_4.png new file mode 100644 index 0000000..27c3282 Binary files /dev/null and b/mods/farming/textures/farming_tomato_4.png differ diff --git a/mods/farming/textures/farming_tomato_5.png b/mods/farming/textures/farming_tomato_5.png new file mode 100644 index 0000000..f369a68 Binary files /dev/null and b/mods/farming/textures/farming_tomato_5.png differ diff --git a/mods/farming/textures/farming_tomato_6.png b/mods/farming/textures/farming_tomato_6.png new file mode 100644 index 0000000..0135cb5 Binary files /dev/null and b/mods/farming/textures/farming_tomato_6.png differ diff --git a/mods/farming/textures/farming_tomato_7.png b/mods/farming/textures/farming_tomato_7.png new file mode 100644 index 0000000..4cd85f5 Binary files /dev/null and b/mods/farming/textures/farming_tomato_7.png differ diff --git a/mods/farming/textures/farming_tomato_8.png b/mods/farming/textures/farming_tomato_8.png new file mode 100644 index 0000000..0b49025 Binary files /dev/null and b/mods/farming/textures/farming_tomato_8.png differ diff --git a/mods/farming/textures/farming_tomato_soup.png b/mods/farming/textures/farming_tomato_soup.png new file mode 100644 index 0000000..d58d53d Binary files /dev/null and b/mods/farming/textures/farming_tomato_soup.png differ diff --git a/mods/farming/textures/farming_tool_bronzehoe.png b/mods/farming/textures/farming_tool_bronzehoe.png index 2802d11..ef07a80 100644 Binary files a/mods/farming/textures/farming_tool_bronzehoe.png and b/mods/farming/textures/farming_tool_bronzehoe.png differ diff --git a/mods/farming/textures/farming_tool_diamondhoe.png b/mods/farming/textures/farming_tool_diamondhoe.png index 66f1042..093acb8 100644 Binary files a/mods/farming/textures/farming_tool_diamondhoe.png and b/mods/farming/textures/farming_tool_diamondhoe.png differ diff --git a/mods/farming/textures/farming_tool_mesehoe.png b/mods/farming/textures/farming_tool_mesehoe.png index 4534fba..ffd597a 100644 Binary files a/mods/farming/textures/farming_tool_mesehoe.png and b/mods/farming/textures/farming_tool_mesehoe.png differ diff --git a/mods/farming/textures/farming_tool_steelhoe.png b/mods/farming/textures/farming_tool_steelhoe.png index d057af2..893a695 100644 Binary files a/mods/farming/textures/farming_tool_steelhoe.png and b/mods/farming/textures/farming_tool_steelhoe.png differ diff --git a/mods/farming/textures/farming_tool_stonehoe.png b/mods/farming/textures/farming_tool_stonehoe.png index 55d8123..4f8dade 100644 Binary files a/mods/farming/textures/farming_tool_stonehoe.png and b/mods/farming/textures/farming_tool_stonehoe.png differ diff --git a/mods/farming/textures/farming_tool_woodhoe.png b/mods/farming/textures/farming_tool_woodhoe.png index a287152..8b20d2d 100644 Binary files a/mods/farming/textures/farming_tool_woodhoe.png and b/mods/farming/textures/farming_tool_woodhoe.png differ diff --git a/mods/farming/textures/farming_trellis.png b/mods/farming/textures/farming_trellis.png new file mode 100644 index 0000000..855b932 Binary files /dev/null and b/mods/farming/textures/farming_trellis.png differ diff --git a/mods/farming/textures/farming_turkish_delight.png b/mods/farming/textures/farming_turkish_delight.png new file mode 100644 index 0000000..198ffc4 Binary files /dev/null and b/mods/farming/textures/farming_turkish_delight.png differ diff --git a/mods/farming/textures/farming_vanilla.png b/mods/farming/textures/farming_vanilla.png new file mode 100644 index 0000000..25596ad Binary files /dev/null and b/mods/farming/textures/farming_vanilla.png differ diff --git a/mods/farming/textures/farming_vanilla_1.png b/mods/farming/textures/farming_vanilla_1.png new file mode 100644 index 0000000..fdd10c0 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_1.png differ diff --git a/mods/farming/textures/farming_vanilla_2.png b/mods/farming/textures/farming_vanilla_2.png new file mode 100644 index 0000000..73ba2ca Binary files /dev/null and b/mods/farming/textures/farming_vanilla_2.png differ diff --git a/mods/farming/textures/farming_vanilla_3.png b/mods/farming/textures/farming_vanilla_3.png new file mode 100644 index 0000000..596b9bf Binary files /dev/null and b/mods/farming/textures/farming_vanilla_3.png differ diff --git a/mods/farming/textures/farming_vanilla_4.png b/mods/farming/textures/farming_vanilla_4.png new file mode 100644 index 0000000..5585827 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_4.png differ diff --git a/mods/farming/textures/farming_vanilla_5.png b/mods/farming/textures/farming_vanilla_5.png new file mode 100644 index 0000000..7ac3ef7 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_5.png differ diff --git a/mods/farming/textures/farming_vanilla_6.png b/mods/farming/textures/farming_vanilla_6.png new file mode 100644 index 0000000..10a5bfd Binary files /dev/null and b/mods/farming/textures/farming_vanilla_6.png differ diff --git a/mods/farming/textures/farming_vanilla_7.png b/mods/farming/textures/farming_vanilla_7.png new file mode 100644 index 0000000..f2962ee Binary files /dev/null and b/mods/farming/textures/farming_vanilla_7.png differ diff --git a/mods/farming/textures/farming_vanilla_8.png b/mods/farming/textures/farming_vanilla_8.png new file mode 100644 index 0000000..1801a97 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_8.png differ diff --git a/mods/farming/textures/farming_vanilla_extract.png b/mods/farming/textures/farming_vanilla_extract.png new file mode 100644 index 0000000..c0668ce Binary files /dev/null and b/mods/farming/textures/farming_vanilla_extract.png differ diff --git a/mods/farming/textures/farming_vanilla_flan.png b/mods/farming/textures/farming_vanilla_flan.png new file mode 100644 index 0000000..c8b9ff0 Binary files /dev/null and b/mods/farming/textures/farming_vanilla_flan.png differ diff --git a/mods/farming/textures/farming_water_glass.png b/mods/farming/textures/farming_water_glass.png new file mode 100644 index 0000000..081f8d6 Binary files /dev/null and b/mods/farming/textures/farming_water_glass.png differ diff --git a/mods/farming/textures/vessels_drinking_cup.png b/mods/farming/textures/vessels_drinking_cup.png new file mode 100644 index 0000000..2eba232 Binary files /dev/null and b/mods/farming/textures/vessels_drinking_cup.png differ diff --git a/mods/farming/utensils.lua b/mods/farming/utensils.lua new file mode 100644 index 0000000..f9b2d29 --- /dev/null +++ b/mods/farming/utensils.lua @@ -0,0 +1,160 @@ + +local S = farming.intllib + +-- wooden bowl + +minetest.register_craftitem("farming:bowl", { + description = S("Wooden Bowl"), + inventory_image = "farming_bowl.png", + groups = {food_bowl = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:bowl 4", + recipe = { + {"group:wood", "", "group:wood"}, + {"", "group:wood", ""} + } +}) + +minetest.register_craft({ + type = "fuel", + recipe = "farming:bowl", + burntime = 10 +}) + +-- saucepan + +minetest.register_craftitem("farming:saucepan", { + description = S("Saucepan"), + inventory_image = "farming_saucepan.png", + groups = {food_saucepan = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:saucepan", + recipe = { + {"default:steel_ingot", "", ""}, + {"", "group:stick", ""} + } +}) + +-- cooking pot + +minetest.register_craftitem("farming:pot", { + description = S("Cooking Pot"), + inventory_image = "farming_pot.png", + groups = {food_pot = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:pot", + recipe = { + {"group:stick", "default:steel_ingot", "default:steel_ingot"}, + {"", "default:steel_ingot", "default:steel_ingot"} + } +}) + +-- baking tray + +minetest.register_craftitem("farming:baking_tray", { + description = S("Baking Tray"), + inventory_image = "farming_baking_tray.png", + groups = {food_baking_tray = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:baking_tray", + recipe = { + {"default:clay_brick", "default:clay_brick", "default:clay_brick"}, + {"default:clay_brick", "", "default:clay_brick"}, + {"default:clay_brick", "default:clay_brick", "default:clay_brick"} + } +}) + +-- skillet + +minetest.register_craftitem("farming:skillet", { + description = S("Skillet"), + inventory_image = "farming_skillet.png", + groups = {food_skillet = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:skillet", + recipe = { + {"default:steel_ingot", "", ""}, + {"", "default:steel_ingot", ""}, + {"", "", "group:stick"} + } +}) + +-- mortar and pestle + +minetest.register_craftitem("farming:mortar_pestle", { + description = S("Mortar and Pestle"), + inventory_image = "farming_mortar_pestle.png", + groups = {food_mortar_pestle = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:mortar_pestle", + recipe = { + {"default:stone", "group:stick", "default:stone"}, + {"", "default:stone", ""} + } +}) + +-- cutting board + +minetest.register_craftitem("farming:cutting_board", { + description = S("Cutting Board"), + inventory_image = "farming_cutting_board.png", + groups = {food_cutting_board = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:cutting_board", + recipe = { + {"default:steel_ingot", "", ""}, + {"", "group:stick", ""}, + {"", "", "group:wood"} + } +}) + +-- juicer + +minetest.register_craftitem("farming:juicer", { + description = S("Juicer"), + inventory_image = "farming_juicer.png", + groups = {food_juicer = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:juicer", + recipe = { + {"", "default:stone", ""}, + {"default:stone", "", "default:stone"} + } +}) + +-- glass mixing bowl + +minetest.register_craftitem("farming:mixing_bowl", { + description = S("Glass Mixing Bowl"), + inventory_image = "farming_mixing_bowl.png", + groups = {food_mixing_bowl = 1, flammable = 2} +}) + +minetest.register_craft({ + output = "farming:mixing_bowl", + recipe = { + {"default:glass", "group:stick", "default:glass"}, + {"", "default:glass", ""} + } +}) + +minetest.register_craft( { + output = "vessels:glass_fragments", + recipe = {{"farming:mixing_bowl"}} +}) diff --git a/mods/fire/README.md b/mods/fire/README.md new file mode 100644 index 0000000..6ed3f81 --- /dev/null +++ b/mods/fire/README.md @@ -0,0 +1,80 @@ +minetest mod fire +========================== + +Fire featured mod + +Information +----------- + +This mod is named `fire`, it features work from original mod. +This is improved for Chest drops and /fire (on|off) command too to +disable propagation of fire destruction. + +![screenshot.png](screenshot.png) + +Technical informaton +-------------------- + +#### Dependencies + +* default + +#### Configuration + +* `enable_fire` - taken from minetest config file, bool type +* `disable_fire` - taken from minetest config file, bool type + +The `disable_fire` is checked only if `enable_fire` is not defined, +if configure enables or disables usage of fire and flames. + +#### nodes and tools + +| Name | node | notes | +| --------------- | -------------------- | ----- | +| Basic flame | fire:basic_flame | it flames fro a while | +| Permanent flame | fire:permanent_flame | always flaming | +| Flint and Steel | fire:flint_and_steel | it burns flamable things | + +#### chat command + +| Command format | Description | privilegies need | +| ---------------- | -------------------------------------- | ---------------- | +| `/fire ` | Disbles fire spreading when set to OFF | server | + +Licence +------ + +**Source code** + +Originally by Perttu Ahola (celeron55) (LGPL 2.1) +Various Minetest developers and contributors (LGPL 2.1) +Chest drops and /fire (on|off) command additions by TenPlus1 (MIT) + +**Media (textures and model)** + +Everything not listed in here: +Copyright (C) 2012 Perttu Ahola (celeron55) (CC BY-SA 3.0) + +Muadtralk (CC BY-SA 3.0) + fire_basic_flame_animated.png + +Gambit (CC BY-SA 3.0) + fire_flint_steel.png + +dobroide (CC BY 3.0) +http://www.freesound.org/people/dobroide/sounds/4211/ + fire_small.ogg + +Dynamicell (CC BY 3.0) +http://www.freesound.org/people/Dynamicell/sounds/17548/ + fire_large.ogg + fire_fire.*.ogg + +fire_small.ogg and fire_large.ogg are unused but kept temporarily to not break +other mods that may use them. + +Benboncan (CC BY 3.0) +https://www.freesound.org/people/Benboncan/sounds/66457/ + fire_flint_and_steel.ogg + +Check [lisence.txt](lisence.txt) diff --git a/mods/fire/README.txt b/mods/fire/README.txt deleted file mode 100644 index 099da1c..0000000 --- a/mods/fire/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -Minetest Game mod: fire -======================= -See license.txt for license information. - -Authors of source code ----------------------- -Originally by Perttu Ahola (celeron55) (LGPL 2.1) -Various Minetest developers and contributors (LGPL 2.1) - -Authors of media (textures and sounds) --------------------------------------- -Everything not listed in here: -Copyright (C) 2012 Perttu Ahola (celeron55) (CC BY-SA 3.0) - -Muadtralk (CC BY-SA 3.0) - fire_basic_flame_animated.png - -Gambit (CC BY-SA 3.0) - fire_flint_steel.png - -dobroide (CC BY 3.0) -http://www.freesound.org/people/dobroide/sounds/4211/ - fire_small.ogg - -Dynamicell (CC BY 3.0) -http://www.freesound.org/people/Dynamicell/sounds/17548/ - fire_large.ogg - fire_fire.*.ogg - -fire_small.ogg and fire_large.ogg are unused but kept temporarily to not break -other mods that may use them. - -Benboncan (CC BY 3.0) -https://www.freesound.org/people/Benboncan/sounds/66457/ - fire_flint_and_steel.ogg diff --git a/mods/fire/init.lua b/mods/fire/init.lua index f97636b..6ef5c31 100644 --- a/mods/fire/init.lua +++ b/mods/fire/init.lua @@ -1,11 +1,62 @@ --- Global namespace for functions -fire = {} +fire = { + mod = "redo", + spread = true -- fire spreads by default (when enabled) +} +-- 'Enable fire' setting --- --- Items --- +local fire_enabled = minetest.settings:get_bool("enable_fire") + +if fire_enabled == nil then + + -- enable_fire setting not specified, check for disable_fire + local fire_disabled = minetest.settings:get_bool("disable_fire") + + if fire_disabled == nil then + + -- Neither setting specified, check whether singleplayer + fire_enabled = minetest.is_singleplayer() + else + fire_enabled = not fire_disabled + end +end + +-- Particle effects + +local function add_effect(pos) + + minetest.add_particlespawner({ + amount = 1, + time = 0.25, + minpos = pos, + maxpos = pos, + minvel = {x = -1, y = 2, z = -1}, + maxvel = {x = 1, y = 4, z = 1}, + minacc = {x = 0, y = 0, z = 0}, + maxacc = {x = 0, y = 0, z = 0}, + minexptime = 1, + maxexptime = 3, + minsize = 2, + maxsize = 5, + texture = "tnt_smoke.png" + }) +end + +-- Flood flame function + +local function flood_flame(pos, oldnode, newnode) + + -- Play flame extinguish sound if liquid is not an 'igniter' + if minetest.get_item_group(newnode.name, "igniter") == 0 then + + minetest.sound_play("fire_extinguish_flame", { + pos = pos, max_hear_distance = 16, gain = 0.15}, true) + end + + -- Remove the flame + return false +end -- Flame nodes @@ -28,22 +79,39 @@ minetest.register_node("fire:basic_flame", { walkable = false, buildable_to = true, sunlight_propagates = true, + floodable = true, damage_per_second = 4, - groups = {igniter = 2, dig_immediate = 3, not_in_creative_inventory = 1}, + groups = {igniter = 2, dig_immediate = 3, fire = 1, not_in_creative_inventory = 1}, + drop = {}, + on_timer = function(pos) + local f = minetest.find_node_near(pos, 1, {"group:flammable"}) - if not f then - minetest.remove_node(pos) + + if not fire_enabled or not f then + + minetest.swap_node(pos, {name = "air"}) + return end + -- Restart timer return true end, - drop = "", on_construct = function(pos) - minetest.get_node_timer(pos):start(math.random(30, 60)) + + local n = 0 + + -- if fire not enabled then reduce amount of time flame stays in world + if not fire_enabled then + n = 29 + end + + minetest.get_node_timer(pos):start(math.random(30 - n, 60 - n)) end, + + on_flood = flood_flame }) minetest.register_node("fire:permanent_flame", { @@ -66,11 +134,13 @@ minetest.register_node("fire:permanent_flame", { walkable = false, buildable_to = true, sunlight_propagates = true, + floodable = true, damage_per_second = 4, - groups = {igniter = 2, dig_immediate = 3}, - drop = "", -}) + groups = {igniter = 2, fire = 1, dig_immediate = 3}, + drop = {}, + on_flood = flood_flame +}) -- Flint and steel @@ -80,38 +150,55 @@ minetest.register_tool("fire:flint_and_steel", { sound = {breaks = "default_tool_breaks"}, on_use = function(itemstack, user, pointed_thing) + local sound_pos = pointed_thing.above or user:get_pos() - minetest.sound_play( - "fire_flint_and_steel", - {pos = sound_pos, gain = 0.5, max_hear_distance = 8} - ) + + minetest.sound_play("fire_flint_and_steel", + {pos = sound_pos, gain = 0.5, max_hear_distance = 8}, true) + local player_name = user:get_player_name() + if pointed_thing.type == "node" then + local node_under = minetest.get_node(pointed_thing.under).name local nodedef = minetest.registered_nodes[node_under] + if not nodedef then return end + if minetest.is_protected(pointed_thing.under, player_name) then + minetest.chat_send_player(player_name, "This area is protected") + return end + if nodedef.on_ignite then nodedef.on_ignite(pointed_thing.under, user) + elseif minetest.get_item_group(node_under, "flammable") >= 1 - and minetest.get_node(pointed_thing.above).name == "air" then + and minetest.get_node(pointed_thing.above).name == "air" then + minetest.set_node(pointed_thing.above, {name = "fire:basic_flame"}) end end + if not (creative and creative.is_enabled_for and creative.is_enabled_for(player_name)) then + -- Wear tool local wdef = itemstack:get_definition() + itemstack:add_wear(1000) + -- Tool break sound if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then - minetest.sound_play(wdef.sound.breaks, {pos = sound_pos, gain = 0.5}) + + minetest.sound_play(wdef.sound.breaks, + {pos = sound_pos, gain = 0.5}, true) end + return itemstack end end @@ -124,198 +211,38 @@ minetest.register_craft({ } }) - -- Override coalblock to enable permanent flame above -- Coalblock is non-flammable to avoid unwanted basic_flame nodes minetest.override_item("default:coalblock", { + after_destruct = function(pos, oldnode) + pos.y = pos.y + 1 + if minetest.get_node(pos).name == "fire:permanent_flame" then minetest.remove_node(pos) end end, + on_ignite = function(pos, igniter) + local flame_pos = {x = pos.x, y = pos.y + 1, z = pos.z} + if minetest.get_node(flame_pos).name == "air" then - minetest.set_node(flame_pos, {name = "fire:permanent_flame"}) - end - end, -}) - - --- --- Sound --- - -local flame_sound = minetest.settings:get_bool("flame_sound") -if flame_sound == nil then - -- Enable if no setting present - flame_sound = true -end - -if flame_sound then - - local handles = {} - local timer = 0 - - -- Parameters - - local radius = 8 -- Flame node search radius around player - local cycle = 3 -- Cycle time for sound updates - - -- Update sound for player - - function fire.update_player_sound(player) - local player_name = player:get_player_name() - -- Search for flame nodes in radius around player - local ppos = player:getpos() - local areamin = vector.subtract(ppos, radius) - local areamax = vector.add(ppos, radius) - local fpos, num = minetest.find_nodes_in_area( - areamin, - areamax, - {"fire:basic_flame", "fire:permanent_flame"} - ) - -- Total number of flames in radius - local flames = (num["fire:basic_flame"] or 0) + - (num["fire:permanent_flame"] or 0) - -- Stop previous sound - if handles[player_name] then - minetest.sound_stop(handles[player_name]) - handles[player_name] = nil - end - -- If flames - if flames > 0 then - -- Find centre of flame positions - local fposmid = fpos[1] - -- If more than 1 flame - if #fpos > 1 then - local fposmin = areamax - local fposmax = areamin - for i = 1, #fpos do - local fposi = fpos[i] - if fposi.x > fposmax.x then - fposmax.x = fposi.x - end - if fposi.y > fposmax.y then - fposmax.y = fposi.y - end - if fposi.z > fposmax.z then - fposmax.z = fposi.z - end - if fposi.x < fposmin.x then - fposmin.x = fposi.x - end - if fposi.y < fposmin.y then - fposmin.y = fposi.y - end - if fposi.z < fposmin.z then - fposmin.z = fposi.z - end - end - fposmid = vector.divide(vector.add(fposmin, fposmax), 2) - end - -- Play sound - local handle = minetest.sound_play( - "fire_fire", - { - pos = fposmid, - to_player = player_name, - gain = math.min(0.06 * (1 + flames * 0.125), 0.18), - max_hear_distance = 32, - loop = true, -- In case of lag - } - ) - -- Store sound handle for this player - if handle then - handles[player_name] = handle - end + minetest.swap_node(flame_pos, {name = "fire:permanent_flame"}) end end - - -- Cycle for updating players sounds - - minetest.register_globalstep(function(dtime) - timer = timer + dtime - if timer < cycle then - return - end - - timer = 0 - local players = minetest.get_connected_players() - for n = 1, #players do - fire.update_player_sound(players[n]) - end - end) - - -- Stop sound and clear handle on player leave - - minetest.register_on_leaveplayer(function(player) - local player_name = player:get_player_name() - if handles[player_name] then - minetest.sound_stop(handles[player_name]) - handles[player_name] = nil - end - end) -end - +}) -- Deprecated function kept temporarily to avoid crashes if mod fire nodes call it function fire.update_sounds_around(pos) end - --- --- ABMs --- - --- Extinguish all flames quickly with water, snow, ice - -minetest.register_abm({ - label = "Extinguish flame", - nodenames = {"fire:basic_flame", "fire:permanent_flame"}, - neighbors = {"group:puts_out_fire"}, - interval = 3, - chance = 1, - catch_up = false, - action = function(pos, node, active_object_count, active_object_count_wider) - minetest.remove_node(pos) - minetest.sound_play("fire_extinguish_flame", - {pos = pos, max_hear_distance = 16, gain = 0.15}) - end, -}) - - -- Enable the following ABMs according to 'enable fire' setting -local fire_enabled = minetest.settings:get_bool("enable_fire") -if fire_enabled == nil then - -- enable_fire setting not specified, check for disable_fire - local fire_disabled = minetest.settings:get_bool("disable_fire") - if fire_disabled == nil then - -- Neither setting specified, check whether singleplayer - fire_enabled = minetest.is_singleplayer() - else - fire_enabled = not fire_disabled - end -end - -if not fire_enabled then - - -- Remove basic flames only if fire disabled - - minetest.register_abm({ - label = "Remove disabled fire", - nodenames = {"fire:basic_flame"}, - interval = 7, - chance = 1, - catch_up = false, - action = minetest.remove_node, - }) - -else -- Fire enabled +if fire_enabled then -- Ignite neighboring nodes, add basic flames @@ -326,12 +253,16 @@ else -- Fire enabled interval = 7, chance = 12, catch_up = false, + action = function(pos, node, active_object_count, active_object_count_wider) - -- If there is water or stuff like that around node, don't ignite - if minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) then + + if fire.spread == false + or minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) then return end + local p = minetest.find_node_near(pos, 1, {"air"}) + if p then minetest.set_node(p, {name = "fire:basic_flame"}) end @@ -347,19 +278,105 @@ else -- Fire enabled interval = 5, chance = 18, catch_up = false, + action = function(pos, node, active_object_count, active_object_count_wider) + + if fire.spread == false + or minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) then + + minetest.remove_node(pos) + + return + end + local p = minetest.find_node_near(pos, 1, {"group:flammable"}) + if p then + local flammable_node = minetest.get_node(p) local def = minetest.registered_nodes[flammable_node.name] + if def.on_burn then def.on_burn(p) else minetest.remove_node(p) + + add_effect(p) + minetest.check_for_falling(p) end end - end, + end }) - end + +-- used to drop items inside a chest or container + +function fire.drop_items(pos, invstring) + + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + + for i = 1, inv:get_size(invstring) do + + local m_stack = inv:get_stack(invstring, i) + local obj = minetest.add_item(pos, m_stack) + + if obj then + + obj:set_velocity({ + x = math.random(-10, 10) / 9, + y = 1, + z = math.random(-10, 10) / 9 + }) + end + end +end + +-- override default chest to drop contents on burn + +if minetest.registered_nodes["default:chest"] then + + local groups = minetest.registered_nodes["default:chest"].groups + + groups.flammable = 3 + + minetest.override_item("default:chest", { + groups = groups, + + on_burn = function(p) + + fire.drop_items(p, "main") + + minetest.remove_node(p) + end + }) +end + +-- /fire [on/off] command to quickly stop flames spreading without reset + +minetest.register_chatcommand("fire", { + params = "", + description = "Disbles fire spreading when set to OFF", + privs = {server = true}, + + func = function (name, param) + + if not param or param == "" then + return false, "No paramater set, use /fire (on|off)" + end + + if param == "on" or param == "ON" then + + fire.spread = true + + return false, "fire spreading is ON" + + elseif param == "off" or param == "OFF" then + + fire.spread = false + + return false, "fire spreading is OFF" + end + end +}) diff --git a/mods/fire/mod.conf b/mods/fire/mod.conf new file mode 100644 index 0000000..c305576 --- /dev/null +++ b/mods/fire/mod.conf @@ -0,0 +1,2 @@ +name = fire +depends = default diff --git a/mods/fire/screenshot.png b/mods/fire/screenshot.png new file mode 100644 index 0000000..b0f99a8 Binary files /dev/null and b/mods/fire/screenshot.png differ diff --git a/mods/fire/textures/fire_basic_flame.png b/mods/fire/textures/fire_basic_flame.png index 1da0702..989963c 100644 Binary files a/mods/fire/textures/fire_basic_flame.png and b/mods/fire/textures/fire_basic_flame.png differ diff --git a/mods/fire/textures/fire_flint_steel.png b/mods/fire/textures/fire_flint_steel.png index c262ebc..2eb4128 100644 Binary files a/mods/fire/textures/fire_flint_steel.png and b/mods/fire/textures/fire_flint_steel.png differ diff --git a/mods/stairs/README.md b/mods/stairs/README.md new file mode 100644 index 0000000..a6db874 --- /dev/null +++ b/mods/stairs/README.md @@ -0,0 +1,41 @@ +minetest mod Stairs +========================= + +Featured stairs with transparent and glowing stairs, slopes, fuel feature, etc + +Information +----------- + +This mod is named `stairs` and its a featured replacement of default one; +this mod has been amended to add new features like transparent and glowing +stairs, slopes, recipes to return stairs / slopes back into blocks and also for +stairs to be used as fuel for furnaces, also alternative placement functions +that use on_rotate and sneak key. + +![screenshot.png](screenshot.png) + +Tech information +---------------- + +This mod sustitute default one, you must disable the default of minetest +game if present or override it. + +#### Dependencies + +* default +* creative (for newer engines) + +License +------- + +### Authors of source code + +Originally by Kahrl (LGPLv2.1+) and +celeron55, Perttu Ahola (LGPLv2.1+) +Various Minetest developers and contributors (LGPLv2.1+) +http://www.gnu.org/licenses/lgpl-2.1.html + +### License of media (textures and sounds) + +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/mods/stairs/README.txt b/mods/stairs/README.txt deleted file mode 100644 index d32cd71..0000000 --- a/mods/stairs/README.txt +++ /dev/null @@ -1,16 +0,0 @@ -Minetest Game mod: stairs -========================= -See license.txt for license information. - -Authors of source code ----------------------- -Originally by Kahrl (LGPL 2.1) and -celeron55, Perttu Ahola (LGPL 2.1) -Various Minetest developers and contributors (LGPL 2.1) - -Authors of media (models) -------------------------- -Jean-Patrick G. (kilbith) (CC BY-SA 3.0): - stairs_stair.obj - - diff --git a/mods/stairs/api.md b/mods/stairs/api.md new file mode 100644 index 0000000..58a885d --- /dev/null +++ b/mods/stairs/api.md @@ -0,0 +1,78 @@ +Stairs API +---------- + +The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those delivered with Minetest Game, to keep them compatible with other mods. + +* `stairs.register_stair(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers a stair + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +* `stairs.register_slab(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers a slab + * `subname`: Basically the material name (e.g. cobble) used for the slab name. Nodename pattern: "stairs:slab_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble" + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the slab's definition + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +* `stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers an inner corner stair + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_inner_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition with "Inner" prepended + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +* `stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers an outer corner stair + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition with "Outer" prepended + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +* `stairs.register_slope(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers a slope + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition with "Outer" prepended + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +* `stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, worldaligntex)` + + * A wrapper for stairs.register_stair, stairs.register_slab, stairs.register_stair_inner, stairs.register_stair_outer + * Uses almost the same arguments as stairs.register_stair + * `desc_stair`: Description for stair nodes. For corner stairs 'Inner' or 'Outer' will be prefixed + * `desc_slab`: Description for slab node + + +* `stairs.register_all(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * A wrapper for stairs.register_stair, stairs.register_slab, stairs.register_stair_inner, stairs.register_stair_outer, stairs.register_slope + * Uses almost the same arguments as stairs.register_stair + * `description`: Description for stair nodes. 'stair' 'slab' 'stair_inner' 'stair_outer' 'Slope' will be prefixed diff --git a/mods/stairs/api.txt b/mods/stairs/api.txt new file mode 100644 index 0000000..3dc50aa --- /dev/null +++ b/mods/stairs/api.txt @@ -0,0 +1,78 @@ +Stairs API +---------- + +The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those delivered with Minetest Game, to keep them compatible with other mods. + +`stairs.register_stair(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers a stair + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +`stairs.register_slab(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers a slab + * `subname`: Basically the material name (e.g. cobble) used for the slab name. Nodename pattern: "stairs:slab_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble" + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the slab's definition + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +`stairs.register_stair_inner(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers an inner corner stair + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_inner_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition with "Inner" prepended + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +`stairs.register_stair_outer(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers an outer corner stair + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition with "Outer" prepended + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +`stairs.register_slope(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * Registers a slope + * `subname`: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_outer_subname" + * `recipeitem`: Item used in the craft recipe, e.g. "default:cobble", may be `nil` + * `groups`: See [Known damage and digging time defining groups] + * `images`: See [Tile definition] + * `description`: Used for the description field in the stair's definition with "Outer" prepended + * `sounds`: See [#Default sounds] + * `worldaligntex`: A bool to set all textures world-aligned. Default false. See [Tile definition] + + +`stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, worldaligntex)` + + * A wrapper for stairs.register_stair, stairs.register_slab, stairs.register_stair_inner, stairs.register_stair_outer + * Uses almost the same arguments as stairs.register_stair + * `desc_stair`: Description for stair nodes. For corner stairs 'Inner' or 'Outer' will be prefixed + * `desc_slab`: Description for slab node + + +`stairs.register_all(subname, recipeitem, groups, images, description, sounds, worldaligntex)` + + * A wrapper for stairs.register_stair, stairs.register_slab, stairs.register_stair_inner, stairs.register_stair_outer, stairs.register_slope + * Uses almost the same arguments as stairs.register_stair + * `description`: Description for stair nodes. 'stair' 'slab' 'stair_inner' 'stair_outer' 'Slope' will be prefixed diff --git a/mods/stairs/depends.txt b/mods/stairs/depends.txt index 4ad96d5..1f737c1 100644 --- a/mods/stairs/depends.txt +++ b/mods/stairs/depends.txt @@ -1 +1,2 @@ default +creative? diff --git a/mods/stairs/description.txt b/mods/stairs/description.txt new file mode 100644 index 0000000..828523b --- /dev/null +++ b/mods/stairs/description.txt @@ -0,0 +1 @@ +Adds stairs, slabs, inner and outer corners and slopes for blocks. diff --git a/mods/stairs/init.lua b/mods/stairs/init.lua index 788fa50..20eb8a4 100644 --- a/mods/stairs/init.lua +++ b/mods/stairs/init.lua @@ -1,77 +1,468 @@ --- Minetest 0.4 mod: stairs --- See README.txt for licensing and other information. + +-- wool sounds +function default.node_sound_wool_defaults(table) + + table = table or {} + + table.footstep = table.footstep or {name = "wool_coat_movement", gain = 1.0} + table.dug = table.dug or {name = "wool_coat_movement", gain = 0.25} + table.place = table.place or {name = "default_place_node", gain = 1.0} + + return table +end + +-- add new 5.x snow sounds to 0.4.x client +if not minetest.has_feature("object_use_texture_alpha") then + + function default.node_sound_snow_defaults(table) + + table = table or {} + + table.footstep = table.footstep or {name = "default_snow_footstep", gain = 0.1} + table.dug = table.dug or {name = "default_snow_footstep", gain = 0.3} + table.place = table.place or {name = "default_place_node", gain = 1.0} + + return table + end +end + +stairs = { + mod = "redo", + wood = default.node_sound_wood_defaults(), + dirt = default.node_sound_dirt_defaults(), + stone = default.node_sound_stone_defaults(), + glass = default.node_sound_glass_defaults(), + leaves = default.node_sound_leaves_defaults(), + metal = default.node_sound_metal_defaults(), + wool = default.node_sound_wool_defaults() +} --- Global namespace for functions +-- cache creative +local creative = minetest.settings:get_bool("creative_mode") -stairs = {} +function is_creative_enabled_for(name) + + if creative or minetest.check_player_privs(name, {creative = true}) then + return true + end + + return false +end --- Register aliases for new pine node names +-- process textures +local set_textures = function(images, worldaligntex) -minetest.register_alias("stairs:stair_pinewood", "stairs:stair_pine_wood") -minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood") + local stair_images = {} + for i, image in ipairs(images) do --- Get setting for replace ABM + if type(image) == "string" then -local replace = minetest.settings:get_bool("enable_stairs_replace_abm") + stair_images[i] = { + name = image, + backface_culling = true + } -local function rotate_and_place(itemstack, placer, pointed_thing) - local p0 = pointed_thing.under - local p1 = pointed_thing.above - local param2 = 0 + if worldaligntex then + stair_images[i].align_style = "world" + end + else + stair_images[i] = table.copy(image) - if placer then - local placer_pos = placer:getpos() - if placer_pos then - param2 = minetest.dir_to_facedir(vector.subtract(p1, placer_pos)) - end + if stair_images[i].backface_culling == nil then + stair_images[i].backface_culling = true + end - local finepos = minetest.pointed_thing_to_face_pos(placer, pointed_thing) - local fpos = finepos.y % 1 - - if p0.y - 1 == p1.y or (fpos > 0 and fpos < 0.5) - or (fpos < -0.5 and fpos > -0.999999999) then - param2 = param2 + 20 - if param2 == 21 then - param2 = 23 - elseif param2 == 23 then - param2 = 21 + if worldaligntex and stair_images[i].align_style == nil then + stair_images[i].align_style = "world" end end end - return minetest.item_place(itemstack, placer, pointed_thing, param2) + + return stair_images end --- Register stairs. --- Node will be called stairs:stair_ -function stairs.register_stair(subname, recipeitem, groups, images, description, sounds) - local stair_images = {} - for i, image in ipairs(images) do - if type(image) == "string" then - stair_images[i] = { - name = image, - backface_culling = true, - } - elseif image.backface_culling == nil then -- override using any other value - stair_images[i] = table.copy(image) - stair_images[i].backface_culling = true +-- placement helper +local stair_place = function(itemstack, placer, pointed_thing, stair_node) + + -- if sneak pressed then use param2 in node pointed at when placing + if placer:is_player() and placer:get_player_control().sneak then + + local name = placer:get_player_name() + local pos_a = pointed_thing.above + local node_a = minetest.get_node(pos_a) + local def_a = minetest.registered_nodes[node_a.name] + + if not def_a.buildable_to + or minetest.is_protected(pos_a, name) then + return itemstack + end + + local pos_u = pointed_thing.under + local node_u = minetest.get_node(pos_u) + + if minetest.get_item_group(node_u.name, "stair") > 0 + or minetest.get_item_group(node_u.name, "slab") > 0 then + + minetest.set_node(pos_a, { + name = stair_node, + param2 = node_u.param2 + }) + + if not is_creative_enabled_for(name) then + itemstack:take_item() + end + + return itemstack end end + + core.rotate_and_place(itemstack, placer, pointed_thing, + is_creative_enabled_for(placer:get_player_name()), + {invert_wall = placer:get_player_control().sneak}) + + return itemstack +end + + +-- get node settings to use for stairs +local function get_node_vars(nodename) + + local def = minetest.registered_nodes[nodename] + + if def then + return def.light_source, def.use_texture_alpha, def.sunlight_propagates + end + + return nil, nil, nil +end + + +-- if recipeitem can be burned then stair can be as well +local function set_burn(recipeitem, stair_name, v) + + local burntime = minetest.get_craft_result({ + method = "fuel", width = 1, items = {recipeitem} }).time + + if burntime > 0 then + + minetest.register_craft({ + type = "fuel", + recipe = stair_name, + burntime = math.floor(burntime * v) + }) + end +end + + +-- Node will be called stairs:stair_ +function stairs.register_stair( + subname, recipeitem, groups, images, description, snds, wat) + + local stair_images = set_textures(images, wat) local new_groups = table.copy(groups) + new_groups.stair = 1 + + local light, alpha, propa = get_node_vars(recipeitem) + minetest.register_node(":stairs:stair_" .. subname, { description = description, - drawtype = "mesh", - mesh = "stairs_stair.obj", + drawtype = "nodebox", tiles = stair_images, paramtype = "light", paramtype2 = "facedir", is_ground_content = false, + use_texture_alpha = alpha, + light_source = light, + sunlight_propagates = propa, groups = new_groups, - sounds = sounds, + sounds = snds, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5} + } + }, + + on_place = function(itemstack, placer, pointed_thing) + + return stair_place(itemstack, placer, pointed_thing, + "stairs:stair_" .. subname) + end + }) + + -- if no recipe item provided then skip craft recipes + if not recipeitem then + return + end + + -- stair recipes + minetest.register_craft({ + output = "stairs:stair_" .. subname .. " 8", + recipe = { + {recipeitem, "", ""}, + {recipeitem, recipeitem, ""}, + {recipeitem, recipeitem, recipeitem} + } + }) + + minetest.register_craft({ + output = "stairs:stair_" .. subname .. " 8", + recipe = { + {"", "", recipeitem}, + {"", recipeitem, recipeitem}, + {recipeitem, recipeitem, recipeitem} + } + }) + + -- stair to original material recipe + minetest.register_craft({ + output = recipeitem .. " 3", + recipe = { + {"stairs:stair_" .. subname, "stairs:stair_" .. subname}, + {"stairs:stair_" .. subname, "stairs:stair_" .. subname} + } + }) + + set_burn(recipeitem, "stairs:stair_" .. subname, 0.75) +end + + +-- Node will be called stairs:slab_ +function stairs.register_slab( + subname, recipeitem, groups, images, description, snds, wat) + + local slab_images = set_textures(images, wat) + local new_groups = table.copy(groups) + + new_groups.slab = 1 + + local light, alpha, propa = get_node_vars(recipeitem) + + minetest.register_node(":stairs:slab_" .. subname, { + description = description, + drawtype = "nodebox", + tiles = slab_images, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + use_texture_alpha = alpha, + light_source = light, + sunlight_propagates = propa, + groups = new_groups, + sounds = snds, + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5} + }, + + on_place = function(itemstack, placer, pointed_thing) + + return stair_place(itemstack, placer, pointed_thing, + "stairs:slab_" .. subname) + end + }) + + -- if no recipe item provided then skip craft recipes + if not recipeitem then + return + end + + -- slab recipe + minetest.register_craft({ + output = "stairs:slab_" .. subname .. " 6", + recipe = { + {recipeitem, recipeitem, recipeitem} + } + }) + + -- slab to original material recipe + minetest.register_craft({ + output = recipeitem, + recipe = { + {"stairs:slab_" .. subname}, + {"stairs:slab_" .. subname} + } + }) + + set_burn(recipeitem, "stairs:slab_" .. subname, 0.5) +end + + +-- Node will be called stairs:stair_outer_ +function stairs.register_stair_outer( + subname, recipeitem, groups, images, description, snds, wat, fdesc) + + local stair_images = set_textures(images, wat) + local new_groups = table.copy(groups) + + new_groups.stair = 1 + + local light, alpha, propa = get_node_vars(recipeitem) + + minetest.register_node(":stairs:stair_outer_" .. subname, { + description = fdesc or "Outer " .. description, + drawtype = "nodebox", + tiles = stair_images, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + use_texture_alpha = alpha, + light_source = light, + sunlight_propagates = propa, + groups = new_groups, + sounds = snds, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0, 0.5, 0.5} + }, + }, + + on_place = function(itemstack, placer, pointed_thing) + + return stair_place(itemstack, placer, pointed_thing, + "stairs:stair_outer_" .. subname) + end + }) + + -- add alias for old stairs redo name + minetest.register_alias("stairs:corner_" .. subname, + "stairs:stair_outer_" .. subname) + + -- if no recipe item provided then skip craft recipes + if not recipeitem then + return + end + + -- corner stair recipe + minetest.register_craft({ + output = "stairs:stair_outer_" .. subname .. " 6", + recipe = { + {"", "", ""}, + {"", recipeitem, ""}, + {recipeitem, recipeitem, recipeitem} + }, + }) + + -- corner stair to original material recipe + minetest.register_craft({ + output = recipeitem .. " 2", + recipe = { + {"stairs:stair_outer_" .. subname, + "stairs:stair_outer_" .. subname}, + {"stairs:stair_outer_" .. subname, + "stairs:stair_outer_" .. subname} + } + }) + + set_burn(recipeitem, "stairs:stair_outer_" .. subname, 0.625) +end + + +-- Node will be called stairs:stair_inner_ +function stairs.register_stair_inner( + subname, recipeitem, groups, images, description, snds, wat, fdesc) + + local stair_images = set_textures(images, wat) + local new_groups = table.copy(groups) + + new_groups.stair = 1 + + local light, alpha, propa = get_node_vars(recipeitem) + + minetest.register_node(":stairs:stair_inner_" .. subname, { + description = fdesc or "Inner " .. description, + drawtype = "nodebox", + tiles = stair_images, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + use_texture_alpha = alpha, + light_source = light, + sunlight_propagates = propa, + groups = new_groups, + sounds = snds, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5}, + {-0.5, 0, -0.5, 0, 0.5, 0} + } + }, + + on_place = function(itemstack, placer, pointed_thing) + + return stair_place(itemstack, placer, pointed_thing, + "stairs:stair_inner_" .. subname) + end, + }) + + -- add alias for old stairs redo name + minetest.register_alias("stairs:invcorner_" .. subname, + "stairs:stair_inner_" .. subname) + + -- if no recipe item provided then skip craft recipes + if not recipeitem then + return + end + + -- inside corner stair recipe + minetest.register_craft({ + output = "stairs:stair_inner_" .. subname .. " 9", + recipe = { + {recipeitem, recipeitem, ""}, + {recipeitem, recipeitem, recipeitem}, + {recipeitem, recipeitem, recipeitem}, + } + }) + + -- inside corner stair to original material recipe + minetest.register_craft({ + output = recipeitem .. " 3", + recipe = { + {"stairs:stair_inner_" .. subname, + "stairs:stair_inner_" .. subname}, + {"stairs:stair_inner_" .. subname, + "stairs:stair_inner_" .. subname} + } + }) + + set_burn(recipeitem, "stairs:stair_inner_" .. subname, 0.875) +end + + +-- Node will be called stairs:slope_ +function stairs.register_slope( + subname, recipeitem, groups, images, description, snds, wat) + + local stair_images = set_textures(images, wat) + local new_groups = table.copy(groups) + + new_groups.stair = 1 + + local light, alpha, propa = get_node_vars(recipeitem) + + minetest.register_node(":stairs:slope_" .. subname, { + description = description, + drawtype = "mesh", + mesh = "stairs_slope.obj", + tiles = stair_images, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + use_texture_alpha = alpha, + light_source = light, + sunlight_propagates = propa, + groups = new_groups, + sounds = snds, selection_box = { type = "fixed", fixed = { @@ -83,528 +474,236 @@ function stairs.register_stair(subname, recipeitem, groups, images, description, type = "fixed", fixed = { {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, - {-0.5, 0, 0, 0.5, 0.5, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5} }, }, - on_place = function(itemstack, placer, pointed_thing) - if pointed_thing.type ~= "node" then - return itemstack - end - return rotate_and_place(itemstack, placer, pointed_thing) - end, + on_place = function(itemstack, placer, pointed_thing) + return stair_place(itemstack, placer, pointed_thing, + "stairs:slope_" .. subname) + end }) - -- for replace ABM - if replace then - minetest.register_node(":stairs:stair_" .. subname .. "upside_down", { - replace_name = "stairs:stair_" .. subname, - groups = {slabs_replace = 1}, - }) - end + -- slope recipe + minetest.register_craft({ + output = "stairs:slope_" .. subname .. " 6", + recipe = { + {recipeitem, "", ""}, + {recipeitem, recipeitem, ""} + } + }) - if recipeitem then - -- Recipe matches appearence in inventory - minetest.register_craft({ - output = 'stairs:stair_' .. subname .. ' 8', - recipe = { - {"", "", recipeitem}, - {"", recipeitem, recipeitem}, - {recipeitem, recipeitem, recipeitem}, - }, - }) + -- slope to original material recipe + minetest.register_craft({ + output = recipeitem, + recipe = { + {"stairs:slope_" .. subname, "stairs:slope_" .. subname} + } + }) - -- Fuel - local baseburntime = minetest.get_craft_result({ - method = "fuel", - width = 1, - items = {recipeitem} - }).time - if baseburntime > 0 then - minetest.register_craft({ - type = "fuel", - recipe = 'stairs:stair_' .. subname, - burntime = math.floor(baseburntime * 0.75), - }) - end - end + set_burn(recipeitem, "stairs:slope_" .. subname, 0.5) end --- Slab facedir to placement 6d matching table -local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4} +-- Node will be called stairs:slope_inner_ +function stairs.register_slope_inner( + subname, recipeitem, groups, images, description, snds, wat) --- Register slabs. --- Node will be called stairs:slab_ - -function stairs.register_slab(subname, recipeitem, groups, images, description, sounds) + local stair_images = set_textures(images, wat) local new_groups = table.copy(groups) - new_groups.slab = 1 - minetest.register_node(":stairs:slab_" .. subname, { + + new_groups.stair = 1 + + local light, alpha, propa = get_node_vars(recipeitem) + + minetest.register_node(":stairs:slope_inner_" .. subname, { description = description, - drawtype = "nodebox", - tiles = images, + drawtype = "mesh", + mesh = "stairs_slope_inner.obj", + tiles = stair_images, paramtype = "light", paramtype2 = "facedir", is_ground_content = false, + use_texture_alpha = alpha, + light_source = light, + sunlight_propagates = propa, groups = new_groups, - sounds = sounds, - node_box = { + sounds = snds, + selection_box = { type = "fixed", - fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5}, + {-0.5, 0, -0.5, 0, 0.5, 0} + } }, + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5}, + {-0.5, 0, -0.5, 0, 0.5, 0} + } + }, + on_place = function(itemstack, placer, pointed_thing) - local under = minetest.get_node(pointed_thing.under) - local wield_item = itemstack:get_name() - local player_name = placer and placer:get_player_name() or "" - local creative_enabled = (creative and creative.is_enabled_for - and creative.is_enabled_for(player_name)) - - if under and under.name:find("stairs:slab_") then - -- place slab using under node orientation - local dir = minetest.dir_to_facedir(vector.subtract( - pointed_thing.above, pointed_thing.under), true) - - local p2 = under.param2 - - -- combine two slabs if possible - if slab_trans_dir[math.floor(p2 / 4)] == dir - and wield_item == under.name then - - if not recipeitem then - return itemstack - end - if minetest.is_protected(pointed_thing.under, player_name) and not - minetest.check_player_privs(player_name, "protection_bypass") then - minetest.record_protection_violation(pointed_thing.under, - player_name) - return - end - minetest.set_node(pointed_thing.under, {name = recipeitem, param2 = p2}) - if not creative_enabled then - itemstack:take_item() - end - return itemstack - end - - -- Placing a slab on an upside down slab should make it right-side up. - if p2 >= 20 and dir == 8 then - p2 = p2 - 20 - -- same for the opposite case: slab below normal slab - elseif p2 <= 3 and dir == 4 then - p2 = p2 + 20 - end - - -- else attempt to place node with proper param2 - minetest.item_place_node(ItemStack(wield_item), placer, pointed_thing, p2) - if not creative_enabled then - itemstack:take_item() - end - return itemstack - else - return rotate_and_place(itemstack, placer, pointed_thing) - end - end, - }) - - -- for replace ABM - if replace then - minetest.register_node(":stairs:slab_" .. subname .. "upside_down", { - replace_name = "stairs:slab_".. subname, - groups = {slabs_replace = 1}, - }) - end - - if recipeitem then - minetest.register_craft({ - output = 'stairs:slab_' .. subname .. ' 6', - recipe = { - {recipeitem, recipeitem, recipeitem}, - }, - }) - - -- Fuel - local baseburntime = minetest.get_craft_result({ - method = "fuel", - width = 1, - items = {recipeitem} - }).time - if baseburntime > 0 then - minetest.register_craft({ - type = "fuel", - recipe = 'stairs:slab_' .. subname, - burntime = math.floor(baseburntime * 0.5), - }) + return stair_place(itemstack, placer, pointed_thing, + "stairs:slope_inner_" .. subname) end - end -end - - --- Optionally replace old "upside_down" nodes with new param2 versions. --- Disabled by default. - -if replace then - minetest.register_abm({ - label = "Slab replace", - nodenames = {"group:slabs_replace"}, - interval = 16, - chance = 1, - action = function(pos, node) - node.name = minetest.registered_nodes[node.name].replace_name - node.param2 = node.param2 + 20 - if node.param2 == 21 then - node.param2 = 23 - elseif node.param2 == 23 then - node.param2 = 21 - end - minetest.set_node(pos, node) - end, }) + + -- slope recipe + minetest.register_craft({ + output = "stairs:slope_inner_" .. subname .. " 6", + recipe = { + {"", recipeitem, recipeitem}, + {recipeitem, recipeitem, recipeitem} + } + }) + + -- slope to original material recipe + minetest.register_craft({ + output = recipeitem, + recipe = { + {"stairs:slope_inner_" .. subname, "stairs:slope_inner_" .. subname} + } + }) + + set_burn(recipeitem, "stairs:slope_inner_" .. subname, 0.5) +end + + +-- Node will be called stairs:slope_outer_ +function stairs.register_slope_outer( + subname, recipeitem, groups, images, description, snds, wat) + + local stair_images = set_textures(images, wat) + local new_groups = table.copy(groups) + + new_groups.stair = 1 + + local light, alpha, propa = get_node_vars(recipeitem) + + minetest.register_node(":stairs:slope_outer_" .. subname, { + description = description, + drawtype = "mesh", + mesh = "stairs_slope_outer.obj", + tiles = stair_images, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + use_texture_alpha = alpha, + light_source = light, + sunlight_propagates = propa, + groups = new_groups, + sounds = snds, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0, 0.5, 0.5} + }, + }, + collision_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0, 0.5, 0.5} + }, + }, + + on_place = function(itemstack, placer, pointed_thing) + return stair_place(itemstack, placer, pointed_thing, + "stairs:slope_outer_" .. subname) + end + }) + + -- slope recipe + minetest.register_craft({ + output = "stairs:slope_outer_" .. subname .. " 6", + recipe = { + {"", "", recipeitem}, + {"", recipeitem, recipeitem} + } + }) + + -- slope to original material recipe + minetest.register_craft({ + output = recipeitem, + recipe = { + {"stairs:slope_outer_" .. subname, "stairs:slope_outer_" .. subname} + } + }) + + set_burn(recipeitem, "stairs:slope_outer_" .. subname, 0.5) end --- Stair/slab registration function. -- Nodes will be called stairs:{stair,slab}_ +function stairs.register_stair_and_slab( + subname, recipeitem, groups, images, desc_stair, desc_slab, sounds, wat) -function stairs.register_stair_and_slab(subname, recipeitem, - groups, images, desc_stair, desc_slab, sounds) - stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds) - stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds) + stairs.register_stair( + subname, recipeitem, groups, images, desc_stair, sounds, wat) + + stairs.register_stair_inner( + subname, recipeitem, groups, images, desc_stair, sounds, wat) + + stairs.register_stair_outer( + subname, recipeitem, groups, images, desc_stair, sounds, wat) + + stairs.register_slab( + subname, recipeitem, groups, images, desc_slab, sounds, wat) end --- Register default stairs and slabs +-- Nodes will be called stairs:{stair,slab,corner,invcorner,slope}_ +function stairs.register_all( + subname, recipeitem, groups, images, desc, snds, wat) -stairs.register_stair_and_slab( - "wood", - "default:wood", - {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - {"default_wood.png"}, - "Wooden Stair", - "Wooden Slab", - default.node_sound_wood_defaults() -) + stairs.register_stair( + subname, recipeitem, groups, images, desc .. " Stair", snds, wat) -stairs.register_stair_and_slab( - "junglewood", - "default:junglewood", - {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - {"default_junglewood.png"}, - "Jungle Wood Stair", - "Jungle Wood Slab", - default.node_sound_wood_defaults() -) + stairs.register_slab( + subname, recipeitem, groups, images, desc .. " Slab", snds, wat) -stairs.register_stair_and_slab( - "pine_wood", - "default:pine_wood", - {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, - {"default_pine_wood.png"}, - "Pine Wood Stair", - "Pine Wood Slab", - default.node_sound_wood_defaults() -) + stairs.register_stair_inner( + subname, recipeitem, groups, images, desc .. " Stair", snds, wat) -stairs.register_stair_and_slab( - "acacia_wood", - "default:acacia_wood", - {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, - {"default_acacia_wood.png"}, - "Acacia Wood Stair", - "Acacia Wood Slab", - default.node_sound_wood_defaults() -) + stairs.register_stair_outer( + subname, recipeitem, groups, images, desc .. " Stair", snds, wat) -stairs.register_stair_and_slab( - "aspen_wood", - "default:aspen_wood", - {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, - {"default_aspen_wood.png"}, - "Aspen Wood Stair", - "Aspen Wood Slab", - default.node_sound_wood_defaults() -) + stairs.register_slope( + subname, recipeitem, groups, images, desc .. " Slope", snds, wat) -stairs.register_stair_and_slab( - "stone", - "default:stone", - {cracky = 3}, - {"default_stone.png"}, - "Stone Stair", - "Stone Slab", - default.node_sound_stone_defaults() -) + stairs.register_slope_inner( + subname, recipeitem, groups, images, desc .. " Slope", snds, wat) -stairs.register_stair_and_slab( - "cobble", - "default:cobble", - {cracky = 3}, - {"default_cobble.png"}, - "Cobblestone Stair", - "Cobblestone Slab", - default.node_sound_stone_defaults() -) + stairs.register_slope_outer( + subname, recipeitem, groups, images, desc .. " Slope", snds, wat) +end -stairs.register_stair_and_slab( - "mossycobble", - "default:mossycobble", - {cracky = 3}, - {"default_mossycobble.png"}, - "Mossy Cobblestone Stair", - "Mossy Cobblestone Slab", - default.node_sound_stone_defaults() -) -stairs.register_stair_and_slab( - "stonebrick", - "default:stonebrick", - {cracky = 2}, - {"default_stone_brick.png"}, - "Stone Brick Stair", - "Stone Brick Slab", - default.node_sound_stone_defaults() -) +-- compatibility function for previous stairs:invcorner_ +function stairs.register_invcorner( + subname, recipeitem, groups, images, desc, snds, wat) -stairs.register_stair_and_slab( - "stone_block", - "default:stone_block", - {cracky = 2}, - {"default_stone_block.png"}, - "Stone Block Stair", - "Stone Block Slab", - default.node_sound_stone_defaults() -) + stairs.register_stair_inner( + subname, recipeitem, groups, images, desc .. " Stair", snds, wat) +end -stairs.register_stair_and_slab( - "desert_stone", - "default:desert_stone", - {cracky = 3}, - {"default_desert_stone.png"}, - "Desert Stone Stair", - "Desert Stone Slab", - default.node_sound_stone_defaults() -) -stairs.register_stair_and_slab( - "desert_cobble", - "default:desert_cobble", - {cracky = 3}, - {"default_desert_cobble.png"}, - "Desert Cobblestone Stair", - "Desert Cobblestone Slab", - default.node_sound_stone_defaults() -) +-- compatibility function for previous stairs:corner_ +function stairs.register_corner( + subname, recipeitem, groups, images, desc, snds, wat) -stairs.register_stair_and_slab( - "desert_stonebrick", - "default:desert_stonebrick", - {cracky = 2}, - {"default_desert_stone_brick.png"}, - "Desert Stone Brick Stair", - "Desert Stone Brick Slab", - default.node_sound_stone_defaults() -) + stairs.register_stair_outer( + subname, recipeitem, groups, images, desc .. " Stair", snds, wat) +end -stairs.register_stair_and_slab( - "desert_stone_block", - "default:desert_stone_block", - {cracky = 2}, - {"default_desert_stone_block.png"}, - "Desert Stone Block Stair", - "Desert Stone Block Slab", - default.node_sound_stone_defaults() -) -stairs.register_stair_and_slab( - "sandstone", - "default:sandstone", - {crumbly = 1, cracky = 3}, - {"default_sandstone.png"}, - "Sandstone Stair", - "Sandstone Slab", - default.node_sound_stone_defaults() -) +-- Register stairs +dofile(minetest.get_modpath("stairs") .. "/stairs.lua") -stairs.register_stair_and_slab( - "sandstonebrick", - "default:sandstonebrick", - {cracky = 2}, - {"default_sandstone_brick.png"}, - "Sandstone Brick Stair", - "Sandstone Brick Slab", - default.node_sound_stone_defaults() -) -stairs.register_stair_and_slab( - "sandstone_block", - "default:sandstone_block", - {cracky = 2}, - {"default_sandstone_block.png"}, - "Sandstone Block Stair", - "Sandstone Block Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "desert_sandstone", - "default:desert_sandstone", - {crumbly = 1, cracky = 3}, - {"default_desert_sandstone.png"}, - "Desert Sandstone Stair", - "Desert Sandstone Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "desert_sandstone_brick", - "default:desert_sandstone_brick", - {cracky = 2}, - {"default_desert_sandstone_brick.png"}, - "Desert Sandstone Brick Stair", - "Desert Sandstone Brick Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "desert_sandstone_block", - "default:desert_sandstone_block", - {cracky = 2}, - {"default_desert_sandstone_block.png"}, - "Desert Sandstone Block Stair", - "Desert Sandstone Block Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "silver_sandstone", - "default:silver_sandstone", - {crumbly = 1, cracky = 3}, - {"default_silver_sandstone.png"}, - "Silver Sandstone Stair", - "Silver Sandstone Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "silver_sandstone_brick", - "default:silver_sandstone_brick", - {cracky = 2}, - {"default_silver_sandstone_brick.png"}, - "Silver Sandstone Brick Stair", - "Silver Sandstone Brick Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "silver_sandstone_block", - "default:silver_sandstone_block", - {cracky = 2}, - {"default_silver_sandstone_block.png"}, - "Silver Sandstone Block Stair", - "Silver Sandstone Block Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "obsidian", - "default:obsidian", - {cracky = 1, level = 2}, - {"default_obsidian.png"}, - "Obsidian Stair", - "Obsidian Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "obsidianbrick", - "default:obsidianbrick", - {cracky = 1, level = 2}, - {"default_obsidian_brick.png"}, - "Obsidian Brick Stair", - "Obsidian Brick Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "obsidian_block", - "default:obsidian_block", - {cracky = 1, level = 2}, - {"default_obsidian_block.png"}, - "Obsidian Block Stair", - "Obsidian Block Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "brick", - "default:brick", - {cracky = 3}, - {"default_brick.png"}, - "Brick Stair", - "Brick Slab", - default.node_sound_stone_defaults() -) - -stairs.register_stair_and_slab( - "steelblock", - "default:steelblock", - {cracky = 1, level = 2}, - {"default_steel_block.png"}, - "Steel Block Stair", - "Steel Block Slab", - default.node_sound_metal_defaults() -) - -stairs.register_stair_and_slab( - "copperblock", - "default:copperblock", - {cracky = 1, level = 2}, - {"default_copper_block.png"}, - "Copper Block Stair", - "Copper Block Slab", - default.node_sound_metal_defaults() -) - -stairs.register_stair_and_slab( - "bronzeblock", - "default:bronzeblock", - {cracky = 1, level = 2}, - {"default_bronze_block.png"}, - "Bronze Block Stair", - "Bronze Block Slab", - default.node_sound_metal_defaults() -) - -stairs.register_stair_and_slab( - "goldblock", - "default:goldblock", - {cracky = 1}, - {"default_gold_block.png"}, - "Gold Block Stair", - "Gold Block Slab", - default.node_sound_metal_defaults() -) - -stairs.register_stair_and_slab( - "ice", - "default:ice", - {cracky = 3, puts_out_fire = 1, cools_lava = 1}, - {"default_ice.png"}, - "Ice Stair", - "Ice Slab", - default.node_sound_glass_defaults() -) - -stairs.register_stair_and_slab( - "snowblock", - "default:snowblock", - {crumbly = 3, puts_out_fire = 1, cools_lava = 1, snowy = 1}, - {"default_snow.png"}, - "Snow Block Stair", - "Snow Block Slab", - default.node_sound_dirt_defaults({ - footstep = {name = "default_snow_footstep", gain = 0.15}, - dug = {name = "default_snow_footstep", gain = 0.2}, - dig = {name = "default_snow_footstep", gain = 0.2} - }) -) +print ("[MOD] Stairs Redo loaded") diff --git a/mods/stairs/license.txt b/mods/stairs/license.txt deleted file mode 100644 index 8f16bbd..0000000 --- a/mods/stairs/license.txt +++ /dev/null @@ -1,51 +0,0 @@ -License of source code ----------------------- - -GNU Lesser General Public License, version 2.1 -Copyright (C) 2011-2016 Kahrl -Copyright (C) 2011-2016 celeron55, Perttu Ahola -Copyright (C) 2012-2016 Various Minetest developers and contributors - -This program is free software; you can redistribute it and/or modify it under the terms -of the GNU Lesser General Public License as published by the Free Software Foundation; -either version 2.1 of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; -without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -See the GNU Lesser General Public License for more details: -https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html - - -Licenses of media (models) --------------------------- - -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -Copyright (C) 2015-2016 Jean-Patrick G. (kilbith) - -You are free to: -Share — copy and redistribute the material in any medium or format. -Adapt — remix, transform, and build upon the material for any purpose, even commercially. -The licensor cannot revoke these freedoms as long as you follow the license terms. - -Under the following terms: - -Attribution — You must give appropriate credit, provide a link to the license, and -indicate if changes were made. You may do so in any reasonable manner, but not in any way -that suggests the licensor endorses you or your use. - -ShareAlike — If you remix, transform, or build upon the material, you must distribute -your contributions under the same license as the original. - -No additional restrictions — You may not apply legal terms or technological measures that -legally restrict others from doing anything the license permits. - -Notices: - -You do not have to comply with the license for elements of the material in the public -domain or where your use is permitted by an applicable exception or limitation. -No warranties are given. The license may not give you all of the permissions necessary -for your intended use. For example, other rights such as publicity, privacy, or moral -rights may limit how you use the material. - -For more details: -http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/mods/stairs/mod.conf b/mods/stairs/mod.conf new file mode 100644 index 0000000..2812c31 --- /dev/null +++ b/mods/stairs/mod.conf @@ -0,0 +1,4 @@ +name = stairs +depends = default +optional_depends = creative +description = Adds stairs, slabs, inner and outer corners and slopes. diff --git a/mods/stairs/models/stairs_slope.obj b/mods/stairs/models/stairs_slope.obj new file mode 100644 index 0000000..f5434c3 --- /dev/null +++ b/mods/stairs/models/stairs_slope.obj @@ -0,0 +1,71 @@ +# Blender v2.76 (sub 0) OBJ File: '' +# www.blender.org +mtllib simplyslope_slope.mtl +o stairs_top +v -0.5 0.5 0.5 +v 0.5 0.5 0.5 +o stairs_right +v -0.5 -0.5 -0.5 +v -0.5 -0.5 0.5 +v -0.5 0.5 0.5 +v -0.5 0.0 0.0 +vt 0.0 0.0 +vt 1.0 0.0 +vt 1.0 1.0 +vn -1.0 0.0 0.0 +usemtl None +s 1 +f 3/1/1 4/2/1 5/3/1 +o front +v -0.5 -0.5 -0.5 +v -0.5 0.5 0.5 +v 0.5 0.5 0.5 +v 0.5 -0.5 -0.5 +vt 1.0 0.0 +vt 1.0 0.999938 +vt 0.0 0.999938 +vt 0.0 0.0 +vn 0.0 0.707100 -0.707100 +usemtl None +s 1 +f 7/4/2 8/5/2 9/6/2 10/7/2 +o left +v 0.5 -0.5 -0.5 +v 0.5 0.5 0.5 +v 0.5 -0.5 0.5 +v 0.5 0.0 0.0 +vt 1.0 0.0 +vt 0.0 1.0 +vt 0.0 0.0 +vn 1.0 0.0 0.0 +usemtl None +s 1 +f 11/8/3 12/9/3 13/10/3 +l 14 11 +l 14 12 +o bottom +v -0.5 -0.5 0.5 +v -0.5 -0.5 -0.5 +v 0.5 -0.5 -0.5 +v 0.5 -0.5 0.5 +vt 1.0 0.0 +vt 1.0 1.0 +vt 0.0 1.0 +vt 0.0 0.0 +vn 0.0 -1.0 -0.0 +usemtl None +s 1 +f 15/11/4 16/12/4 17/13/4 18/14/4 +o back +v 0.5 -0.5 0.5 +v 0.5 0.5 0.5 +v -0.5 0.5 0.5 +v -0.5 -0.5 0.5 +vt 1.0 0.0 +vt 1.0 1.0 +vt 0.0 1.0 +vt 0.0 0.0 +vn 0.0 -0.0 1.0 +usemtl None +s 1 +f 19/15/5 20/16/5 21/17/5 22/18/5 \ No newline at end of file diff --git a/mods/stairs/models/stairs_slope_inner.obj b/mods/stairs/models/stairs_slope_inner.obj new file mode 100644 index 0000000..2a780ea --- /dev/null +++ b/mods/stairs/models/stairs_slope_inner.obj @@ -0,0 +1,83 @@ +# Blender v2.76 (sub 0) OBJ File: '' +# www.blender.org +g top +v 0.5 0.5 -0.5 +v 0.5 0.5 0.5 +v -0.5 0.5 0.5 +v -0.5 -0.5 -0.5 +v -0.5 -0.5 -0.5 +vt 1.0 1.0 +vt 0.0 1.0 +vt 1.0 0.0 +vt 1.0 1.0 +vt 0.0 1.0 +vt 0.0 0.0 +vn 0.0 0.7071 -0.7071 +vn -0.7071 0.7071 0.0 +s 1 +f 3/1/1 2/2/1 4/3/1 +f 2/4/2 1/5/2 5/6/2 +g bottom +v 0.5 -0.5 0.5 +v 0.5 -0.5 -0.5 +v -0.5 -0.5 0.5 +v -0.5 -0.5 -0.5 +v 0.5 -0.5 0.5 +vt 1.0 1.0 +vt 0.0 1.0 +vt 0.0 0.0 +vt 1.0 0.0 +vn 0.0 -1.0 -0.0 +s 1 +f 9/7/3 7/8/3 6/9/3 8/10/3 +l 8 10 +g right +v -0.5 0.5 0.5 +v -0.5 -0.5 -0.5 +v -0.5 -0.5 0.5 +vt 1.0 1.0 +vt 0.0 0.0 +vt 1.0 0.0 +vn -1.0 0.0 0.0 +s 1 +f 11/11/4 12/12/4 13/13/4 +g left +v 0.5 0.5 -0.5 +v 0.5 0.5 0.5 +v 0.5 -0.5 0.5 +v 0.5 -0.5 -0.5 +v 0.5 -0.5 0.5 +vt 1.0 1.0 +vt 0.0 1.0 +vt 0.0 0.0 +vt 1.0 0.0 +vn 1.0 0.0 0.0 +s 1 +f 14/14/5 15/15/5 16/16/5 17/17/5 +l 15 18 +g back +v 0.5 0.5 0.5 +v 0.5 -0.5 0.5 +v -0.5 0.5 0.5 +v -0.5 -0.5 0.5 +v 0.5 -0.5 0.5 +vt 0.0 0.0 +vt 1.0 0.0 +vt 1.0 1.0 +vt 0.0 1.0 +vn 0.0 -0.0 1.0 +s 1 +f 22/18/6 20/19/6 19/20/6 21/21/6 +l 22 23 +l 19 23 +g front +v 0.5 0.5 -0.5 +v 0.5 -0.5 -0.5 +v -0.5 -0.5 -0.5 +v -0.5 -0.5 -0.5 +vt 0.0 1.0 +vt 0.0 0.0 +vt 1.0 0.0 +vn 0.0 0.0 -1.0 +s 1 +f 24/22/7 25/23/7 27/24/7 diff --git a/mods/stairs/models/stairs_slope_outer.obj b/mods/stairs/models/stairs_slope_outer.obj new file mode 100644 index 0000000..c95d39b --- /dev/null +++ b/mods/stairs/models/stairs_slope_outer.obj @@ -0,0 +1,50 @@ +# Blender v2.76 (sub 0) OBJ File: '' +# www.blender.org +g top +v -0.5 -0.5 0.5 +v -0.5 -0.5 -0.5 +v 0.5 -0.5 -0.5 +v 0.5 0.5 0.5 +vt 1.0 1.0 +vt 0.0 0.0 +vt 1.0 0.0 +vt 0.0 1.0 +vt 0.0 0.0 +vt 1.0 0.0 +vn -0.7071 0.7071 0.0 +vn 0.0 0.7071 -0.7071 +s off +f 4/1/1 2/2/1 1/3/1 +f 4/4/2 3/5/2 2/6/2 +g bottom +v 0.5 -0.5 0.5 +v -0.5 -0.5 0.5 +v -0.5 -0.5 -0.5 +v 0.5 -0.5 -0.5 +vt 1.0 1.0 +vt 0.0 1.0 +vt 0.0 0.0 +vt 1.0 0.0 +vn 0.0 -1.0 -0.0 +s off +f 5/7/3 6/8/3 7/9/3 8/10/3 +g right +v 0.5 -0.5 0.5 +v -0.5 -0.5 0.5 +v 0.5 0.5 0.5 +vt 0.0 0.0 +vt 1.0 0.0 +vt 1.0 1.0 +vn 0.0 -0.0 1.0 +s off +f 10/11/4 9/12/4 11/13/4 +g left +v 0.5 -0.5 0.5 +v 0.5 -0.5 -0.5 +v 0.5 0.5 0.5 +vt 0.0 1.0 +vt 0.0 0.0 +vt 1.0 0.0 +vn 1.0 0.0 0.0 +s off +f 14/14/5 12/15/5 13/16/5 diff --git a/mods/stairs/models/stairs_stair.obj b/mods/stairs/models/stairs_stair.obj deleted file mode 100644 index 198edf6..0000000 --- a/mods/stairs/models/stairs_stair.obj +++ /dev/null @@ -1,115 +0,0 @@ -# Blender v2.72 (sub 0) OBJ File: '' -# www.blender.org -mtllib stairs.mtl -o stairs_top -v -0.500000 0.000000 -0.500000 -v -0.500000 0.000000 0.000000 -v 0.500000 0.000000 0.000000 -v 0.500000 0.000000 -0.500000 -v -0.500000 0.500000 0.000000 -v 0.500000 0.500000 0.000000 -v -0.500000 0.500000 0.500000 -v 0.500000 0.500000 0.500000 -vt 0.000000 0.000000 -vt 1.000000 0.000000 -vt 1.000000 0.500000 -vt 0.000000 0.500000 -vt 1.000000 1.000000 -vt 0.000000 1.000000 -vn 0.000000 1.000000 0.000000 -g stairs_top -usemtl None -s off -f 4/1/1 1/2/1 2/3/1 3/4/1 -f 7/5/1 8/6/1 6/4/1 5/3/1 -o stairs_bottom -v -0.500000 -0.500000 -0.500000 -v 0.500000 -0.500000 -0.500000 -v -0.500000 -0.500000 0.500000 -v 0.500000 -0.500000 0.500000 -vt 1.000000 0.000000 -vt 1.000000 1.000000 -vt 0.000000 1.000000 -vt 0.000000 0.000000 -vn 0.000000 -1.000000 -0.000000 -g stairs_bottom -usemtl None -s off -f 11/7/2 9/8/2 10/9/2 12/10/2 -o stairs_right -v -0.500000 0.000000 -0.500000 -v -0.500000 -0.500000 -0.500000 -v -0.500000 0.000000 0.000000 -v -0.500000 -0.500000 0.500000 -v -0.500000 0.500000 0.000000 -v -0.500000 0.500000 0.500000 -vt 0.000000 0.500000 -vt 0.000000 0.000000 -vt 0.500000 0.500000 -vt 1.000000 1.000000 -vt 0.500000 1.000000 -vt 1.000000 0.000000 -vn -1.000000 0.000000 0.000000 -g stairs_right -usemtl None -s off -f 13/11/3 14/12/3 15/13/3 -f 15/13/3 18/14/3 17/15/3 -f 14/12/3 16/16/3 15/13/3 -f 16/16/3 18/14/3 15/13/3 -o stairs_left -v 0.500000 0.000000 0.000000 -v 0.500000 -0.500000 -0.500000 -v 0.500000 0.000000 -0.500000 -v 0.500000 -0.500000 0.500000 -v 0.500000 0.500000 0.000000 -v 0.500000 0.500000 0.500000 -vt 0.500000 0.500000 -vt 1.000000 0.000000 -vt 1.000000 0.500000 -vt 0.500000 1.000000 -vt 0.000000 1.000000 -vt 0.000000 0.000000 -vn 1.000000 0.000000 0.000000 -g stairs_left -usemtl None -s off -f 19/17/4 20/18/4 21/19/4 -f 19/17/4 23/20/4 24/21/4 -f 20/18/4 19/17/4 22/22/4 -f 19/17/4 24/21/4 22/22/4 -o stairs_back -v -0.500000 -0.500000 0.500000 -v 0.500000 -0.500000 0.500000 -v -0.500000 0.500000 0.500000 -v 0.500000 0.500000 0.500000 -vt 1.000000 0.000000 -vt 1.000000 1.000000 -vt 0.000000 1.000000 -vt 0.000000 0.000000 -vn 0.000000 -0.000000 1.000000 -g stairs_back -usemtl None -s off -f 26/23/5 28/24/5 27/25/5 25/26/5 -o stairs_front -v -0.500000 0.000000 -0.500000 -v -0.500000 -0.500000 -0.500000 -v -0.500000 0.000000 0.000000 -v 0.500000 0.000000 0.000000 -v 0.500000 -0.500000 -0.500000 -v 0.500000 0.000000 -0.500000 -v -0.500000 0.500000 0.000000 -v 0.500000 0.500000 0.000000 -vt 1.000000 0.000000 -vt 1.000000 0.500000 -vt 0.000000 0.500000 -vt 0.000000 0.000000 -vt 1.000000 1.000000 -vt 0.000000 1.000000 -vn 0.000000 0.000000 -1.000000 -g stairs_front -usemtl None -s off -f 30/27/6 29/28/6 34/29/6 33/30/6 -f 31/28/6 35/31/6 36/32/6 32/29/6 diff --git a/mods/stairs/screenshot.png b/mods/stairs/screenshot.png new file mode 100644 index 0000000..5c32901 Binary files /dev/null and b/mods/stairs/screenshot.png differ diff --git a/mods/stairs/sounds/wool_coat_movement.ogg b/mods/stairs/sounds/wool_coat_movement.ogg new file mode 100644 index 0000000..89df47f Binary files /dev/null and b/mods/stairs/sounds/wool_coat_movement.ogg differ diff --git a/mods/stairs/stairs.lua b/mods/stairs/stairs.lua new file mode 100644 index 0000000..cf3ea93 --- /dev/null +++ b/mods/stairs/stairs.lua @@ -0,0 +1,590 @@ + +local grp = {} -- Helper + +--= Default Minetest + +-- Wood types + +stairs.register_all("wood", "default:wood", + {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + {"default_wood.png"}, + "Wooden", + stairs.wood, false) + +stairs.register_all("junglewood", "default:junglewood", + {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + {"default_junglewood.png"}, + "Jungle Wood", + stairs.wood, false) + +stairs.register_all("pine_wood", "default:pinewood", + {choppy = 3, oddly_breakable_by_hand = 1, flammable = 3}, + {"default_pine_wood.png"}, + "Pine Wood", + stairs.wood, false) + +-- Register aliases for new pine node names +minetest.register_alias("stairs:stair_pinewood", "stairs:stair_pine_wood") +minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood") + +stairs.register_all("acacia_wood", "default:acacia_wood", + {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, + {"default_acacia_wood.png"}, + "Acacia Wood", + stairs.wood, false) + +stairs.register_all("aspen_wood", "default:aspen_wood", + {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, + {"default_aspen_wood.png"}, + "Aspen Wood", + stairs.wood, false) + +-- Stone types + +stairs.register_all("stone", "default:stone", + {cracky = 3}, + {"default_stone.png"}, + "Stone", + stairs.stone, true) + +stairs.register_all("stonebrick", "default:stonebrick", + {cracky = 2}, + {"default_stone_brick.png"}, + "Stone Brick", + stairs.stone, false) + +stairs.register_all("stone_block", "default:stone_block", + {cracky = 2}, + {"default_stone_block.png"}, + "Stone Block", + stairs.stone, true) + +stairs.register_all("cobble", "default:cobble", + {cracky = 3}, + {"default_cobble.png"}, + "Cobble", + stairs.stone, true) + +stairs.register_all("mossycobble", "default:mossycobble", + {cracky = 3}, + {"default_mossycobble.png"}, + "Mossy Cobble", + stairs.stone, true) + +stairs.register_all("desert_stone", "default:desert_stone", + {cracky = 3}, + {"default_desert_stone.png"}, + "Desert Stone", + stairs.stone, true) + +stairs.register_all("desert_stonebrick", "default:desert_stonebrick", + {cracky = 2}, + {"default_desert_stone_brick.png"}, + "Desert Stone Brick", + stairs.stone, false) + +stairs.register_all("desert_stone_block", "default:desert_stone_block", + {cracky = 2}, + {"default_desert_stone_block.png"}, + "Desert Stone Block", + stairs.stone, true) + +stairs.register_all("desert_cobble", "default:desert_cobble", + {cracky = 3}, + {"default_desert_cobble.png"}, + "Desert Cobble", + stairs.stone, true) + +-- Sandstone types + +stairs.register_all("sandstone", "default:sandstone", + {crumbly = 1, cracky = 3}, + {"default_sandstone.png"}, + "Sandstone", + stairs.stone, true) + +stairs.register_all("sandstonebrick", "default:sandstonebrick", + {cracky = 2}, + {"default_sandstone_brick.png"}, + "Sandstone Brick", + stairs.stone, false) + +stairs.register_all("sandstone_block", "default:sandstone_block", + {cracky = 2}, + {"default_sandstone_block.png"}, + "Sandstone Block", + stairs.stone, true) + +stairs.register_all("desert_sandstone", "default:desert_sandstone", + {crumbly = 1, cracky = 3}, + {"default_desert_sandstone.png"}, + "Desert Sandstone", + stairs.stone, true) + +stairs.register_all("desert_sandstone_brick", "default:desert_sandstone_brick", + {cracky = 2}, + {"default_desert_sandstone_brick.png"}, + "Desert Sandstone Brick", + stairs.stone, false) + +stairs.register_all("desert_sandstone_block", "default:desert_sandstone_block", + {cracky = 2}, + {"default_desert_sandstone_block.png"}, + "Desert Sandstone Block", + stairs.stone, true) + +stairs.register_all("silver_sandstone", "default:silver_sandstone", + {crumbly = 1, cracky = 3}, + {"default_silver_sandstone.png"}, + "Silver Sandstone", + stairs.stone, true) + +stairs.register_all("silver_sandstone_brick", "default:silver_sandstone_brick", + {cracky = 2}, + {"default_silver_sandstone_brick.png"}, + "Silver Sandstone Brick", + stairs.stone, false) + +stairs.register_all("silver_sandstone_block", "default:silver_sandstone_block", + {cracky = 2}, + {"default_silver_sandstone_block.png"}, + "Silver Sandstone Block", + stairs.stone, true) + +-- Obsidian + +stairs.register_all("obsidian", "default:obsidian", + {cracky = 1, level = 2}, + {"default_obsidian.png"}, + "Obsidian", + stairs.stone, true) + +stairs.register_all("obsidianbrick", "default:obsidianbrick", + {cracky = 1, level = 2}, + {"default_obsidian_brick.png"}, + "Obsidian Brick", + stairs.stone, false) + +stairs.register_all("obsidian_block", "default:obsidian_block", + {cracky = 1, level = 2}, + {"default_obsidian_block.png"}, + "Obsidian block", + stairs.stone, true) + +-- Cloud (with overrides) + +stairs.register_stair("cloud", "default:cloud", + {unbreakable = 1, not_in_creative_inventory = 1}, + {"default_cloud.png"}, + "Cloud Stair", + stairs.wool) + +minetest.override_item("stairs:stair_cloud", { + on_blast = function() end, + on_drop = function(itemstack, dropper, pos) end, + drop = {}, +}) + +stairs.register_slab("cloud", "default:cloud", + {unbreakable = 1, not_in_creative_inventory = 1}, + {"default_cloud.png"}, + "Cloud Slab", + stairs.wool) + +minetest.override_item("stairs:slab_cloud", { + on_blast = function() end, + on_drop = function(itemstack, dropper, pos) end, + drop = {}, +}) + +-- Ores + +stairs.register_all("coal", "default:coalblock", + {cracky = 3}, + {"default_coal_block.png"}, + "Coal", + stairs.stone, true) + +stairs.register_all("steelblock", "default:steelblock", + {cracky = 1, level = 2}, + {"default_steel_block.png"}, + "Steel", + stairs.metal, true) + +stairs.register_all("copperblock", "default:copperblock", + {cracky = 1, level = 2}, + {"default_copper_block.png"}, + "Copper", + stairs.metal, true) + +stairs.register_all("bronzeblock", "default:bronzeblock", + {cracky = 1, level = 2}, + {"default_bronze_block.png"}, + "Bronze", + stairs.metal, true) + +stairs.register_all("tinblock", "default:tinblock", + {cracky = 1, level = 2}, + {"default_tin_block.png"}, + "Tin", + stairs.metal, true) + +stairs.register_all("mese", "default:mese", + {cracky = 1, level = 2}, + {"default_mese_block.png"}, + "Mese", + stairs.stone) + +stairs.register_all("goldblock", "default:goldblock", + {cracky = 1}, + {"default_gold_block.png"}, + "Gold", + stairs.metal) + +stairs.register_all("diamondblock", "default:diamondblock", + {cracky = 1, level = 3}, + {"default_diamond_block.png"}, + "Diamond", + stairs.stone) + +-- Glass types + +stairs.register_all("glass", "default:glass", + {cracky = 3, oddly_breakable_by_hand = 3}, + {"default_glass.png"}, + "Glass", + stairs.glass) + +stairs.register_all("obsidian_glass", "default:obsidian_glass", + {cracky = 2}, + {"default_obsidian_glass.png"}, + "Obsidian Glass", + stairs.glass) + +-- Brick, Snow and Ice + +stairs.register_all("brick", "default:brick", + {cracky = 3}, + {"default_brick.png"}, + "Brick", + stairs.stone, false) + +stairs.register_all("snowblock", "default:snowblock", + {crumbly = 3, cools_lava = 1, snowy = 1}, + {"default_snow.png"}, + "Snow Block", + default.node_sound_snow_defaults(), true) + +stairs.register_all("ice", "default:ice", + {cracky = 3, cools_lava = 1}, + {"default_ice.png"}, + "Ice", + default.node_sound_glass_defaults(), true) + +--= More Ores Mod + +if minetest.get_modpath("moreores") then + +grp = {cracky = 1, level = 2} + +stairs.register_all("silver_block", "moreores:silver_block", + grp, + {"moreores_silver_block.png"}, + "Silver", + stairs.metal, true) + +stairs.register_all("mithril_block", "moreores:mithril_block", + grp, + {"moreores_mithril_block.png"}, + "Mithril", + stairs.metal, true) + +end + +--= Mobs Mod + +if minetest.registered_nodes["mobs:cheeseblock"] then + +grp = {crumbly = 3, flammable = 2} + +stairs.register_all("cheeseblock", "mobs:cheeseblock", + grp, + {"mobs_cheeseblock.png"}, + "Cheese Block", + stairs.dirt) + +stairs.register_all("honey_block", "mobs:honey_block", + grp, + {"mobs_honey_block.png"}, + "Honey Block", + stairs.dirt) + +end + +--= Lapis Mod + +if minetest.get_modpath("lapis") then + +grp = {cracky = 3} + +stairs.register_all("lapis_block", "lapis:lapis_block", + grp, + {"lapis_block_side.png"}, + "Lapis", + stairs.stone) + +stairs.register_all("lapis_brick", "lapis:lapis_brick", + grp, + {"lapis_brick.png"}, + "Lapis Brick", + stairs.stone) + +stairs.register_all("lapis_cobble", "lapis:lapis_cobble", + grp, + {"lapis_cobble.png"}, + "Lapis Cobble", + stairs.stone) + +end + +--= Homedecor Mod + +if minetest.get_modpath("homedecor") then + +local grp = {snappy = 3} + +stairs.register_all("shingles_asphalt", "homedecor:shingles_asphalt", + grp, + {"homedecor_shingles_asphalt.png"}, + "Asphalt Shingle", + stairs.leaves) + +stairs.register_all("shingles_terracotta", "homedecor:roof_tile_terracotta", + grp, + {"homedecor_shingles_terracotta.png"}, + "Terracotta Shingle", + stairs.leaves) + +stairs.register_all("shingles_wood", "homedecor:shingles_wood", + grp, + {"homedecor_shingles_wood.png"}, + "Wooden Shingle", + stairs.leaves) + +end + +--= Xanadu Mod + +if minetest.get_modpath("xanadu") then + +grp = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3} + +stairs.register_all("stained_wood_white", "xanadu:stained_wood_white", + grp, + {"stained_wood_white.png"}, + "White Wooden", + stairs.wood, false) + +stairs.register_all("stained_wood_red", "xanadu:stained_wood_red", + grp, + {"stained_wood_red.png"}, + "Red Wooden", + stairs.wood, false) + +-- Decorative blocks + +grp = {cracky = 3} + +stairs.register_all("stone1", "xanadu:stone1", + grp, + {"stone1.png"}, + "Decorative Stone 1", + stairs.stone) + +stairs.register_all("stone2", "xanadu:stone2", + grp, + {"stone2.png"}, + "Decorative Stone 2", + stairs.stone) + +stairs.register_all("stone3", "xanadu:stone3", + grp, + {"stone3.png"}, + "Decorative Stone 3", + stairs.stone) + +stairs.register_all("stone4", "xanadu:stone4", + grp, + {"stone4.png"}, + "Decorative Stone 4", + stairs.stone) + +stairs.register_all("stone5", "xanadu:stone5", + grp, + {"stone5.png"}, + "Decorative Stone 5", + stairs.stone) + +stairs.register_all("stone6", "xanadu:stone6", + grp, + {"stone6.png"}, + "Decorative Stone 6", + stairs.stone) + +stairs.register_all("sandstonebrick1", "xanadu:sandstonebrick1", + grp, + {"sandstonebrick1.png"}, + "Decorative Sandstone 1", + stairs.stone) + +stairs.register_all("sandstonebrick2", "xanadu:sandstonebrick2", + grp, + {"sandstonebrick2.png"}, + "Decorative Sandstone 2", + stairs.stone) + +stairs.register_all("sandstonebrick4", "xanadu:sandstonebrick4", + grp, + {"sandstonebrick4.png"}, + "Decorative Sandstone 4", + stairs.stone) + +stairs.register_slab("desert_cobble1", "xanadu:desert_cobble1", + grp, + {"desert_cobble1.png"}, + "Decorative desert cobble 1 slab", + stairs.stone) + +stairs.register_slab("desert_cobble5", "xanadu:desert_cobble5", + grp, + {"desert_cobble5.png"}, + "Decorative desert cobble 5 slab", + stairs.stone) + +stairs.register_slab("desert_stone1", "xanadu:desert_stone1", + grp, + {"desert_stone1.png"}, + "Decorative desert stone 1 slab", + stairs.stone) + +stairs.register_slab("desert_stone3", "xanadu:desert_stone3", + grp, + {"desert_stone3.png"}, + "Decorative desert stone 3 slab", + stairs.stone) + +stairs.register_slab("desert_stone4", "xanadu:desert_stone4", + grp, + {"desert_stone4.png"}, + "Decorative desert stone 4 slab", + stairs.stone) + +stairs.register_stair("desert_stone4", "xanadu:desert_stone4", + grp, + {"desert_stone4.png"}, + "Decorative desert stone 4 stair", + stairs.stone) + +stairs.register_slab("desert_stone5", "xanadu:desert_stone5", + grp, + {"desert_stone5.png"}, + "Decorative desert stone 5 slab", + stairs.stone) + +stairs.register_slab("red1", "xanadu:red1", + grp, + {"baked_clay_red1.png"}, + "Decorative baked red clay 1 slab", + stairs.stone) + +stairs.register_all("bred2", "xanadu:red2", + grp, + {"baked_clay_red2.png"}, + "Decorative baked red clay 2", + stairs.stone) + +stairs.register_all("compressed_cobble", "xanadu:compressed_cobble", + {cracky = 3, level = 2}, + {"compressed_cobble.png"}, + "Compressed Cobble", + stairs.stone) + +stairs.register_all("compressed_dirt", "xanadu:compressed_dirt", + {crumbly = 2}, + {"compressed_dirt.png"}, + "Compressed Dirt", + stairs.stone) + +stairs.register_slope("steelblock1", "xanadu:steelblock1", + {cracky = 1, level = 2}, + {"steel_block1.png"}, + "Decorative Steelblock 1", + stairs.steel) + +stairs.register_slab("steelblock3", "xanadu:steelblock3", + {cracky = 1, level = 2}, + {"steel_block3.png"}, + "Decorative Steelblock 3", + stairs.steel) + +stairs.register_slope("steelblock5", "xanadu:steelblock5", + {cracky = 1, level = 2}, + {"steel_block5.png"}, + "Decorative Steelblock 5", + stairs.steel) +end + + +--= Castle Mod + +if minetest.get_modpath("castle") then + +grp = {cracky = 2} + +stairs.register_all("dungeon_stone", "castle:dungeon_stone", + grp, + {"castle_dungeon_stone.png"}, + "Dungeon", + stairs.stone) + +stairs.register_all("stonewall", "castle:stonewall", + grp, + {"castle_stonewall.png"}, + "Castle Wall", + stairs.stone) + +end + +--= Wool Mod + +if minetest.get_modpath("wool") then + +local colours = { + {"black", "Black", "#000000b0"}, + {"blue", "Blue", "#015dbb70"}, + {"brown", "Brown", "#a78c4570"}, + {"cyan", "Cyan", "#01ffd870"}, + {"dark_green", "Dark Green", "#005b0770"}, + {"dark_grey", "Dark Grey", "#303030b0"}, + {"green", "Green", "#61ff0170"}, + {"grey", "Grey", "#5b5b5bb0"}, + {"magenta", "Magenta", "#ff05bb70"}, + {"orange", "Orange", "#ff840170"}, + {"pink", "Pink", "#ff65b570"}, + {"red", "Red", "#ff000070"}, + {"violet", "Violet", "#2000c970"}, + {"white", "White", "#abababc0"}, + {"yellow", "Yellow", "#e3ff0070"}, +} + +for i = 1, #colours, 1 do + +stairs.register_all("wool_" .. colours[i][1], "wool:" .. colours[i][1], + {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, flammable = 3}, + {"wool_" .. colours[i][1] .. ".png"}, + colours[i][2] .. " Wool", + stairs.wool) + +end -- END for + +end diff --git a/mods/tnt/README.md b/mods/tnt/README.md new file mode 100644 index 0000000..f9d83bc --- /dev/null +++ b/mods/tnt/README.md @@ -0,0 +1,98 @@ +Minetest mod tnt +================ + +Add tnt tool to make explotions + +Information +----------- + +This mod is named `tnt`, it adds TNT to Minetest. TNT is a tool to +help the player in mining or cause mayor damage in area. thiis mod +featured the `tnt_stick` tool + +![screenshot.png](screenshot.png) + +Technical information +--------------------- + +This mod improves more realistic usage of tnt, by the tnt sticks, +for both older and newers engines. + +Craft gunpowder by placing coal and gravel in the crafting area. +The gunpowder can be used to craft TNT sticks or as a fuse trail for TNT. + +The sticks now is the usage for craft TNT's. + +| name | node | craft | usage | +|--- ------ | ------------- | ------------------ | ------ | +| TNT Stick | tnt:tnt_stick | round a paper with 6 tnt sticks | craft tnt | +| TNT | tnt:tnt | using 9 tnt sticks | destruction ratio | +| Gunpowder | tnt:gunpowder | coal and gravel | powder to ignite tnt | + +**NOTE**: The sticks are not usable as an explosive. + +To craft 2 TNT sticks: +``` +G_G +GPG +G_G +``` +* G = gunpowder +* P = paper + +Craft TNT from 9 TNT sticks. + +There are different ways to ignite TNT: + 1. Hit it with a torch. + 2. Hit a gunpowder fuse trail that leads to TNT with a torch or flint-and-steel. + 3. Activate it with mesecons (fastest way). + +* For 1 TNT: Node destruction radius is 3 nodes by default, configurable. +* Player and object damage radius is 6 nodes. + +License +------- + +See [license.txt](license.txt) for license information. + +**Authors of source code** + +PilzAdam (MIT) +ShadowNinja (MIT) +sofar (sofar@foo-projects.org) (MIT) +Various Minetest developers and contributors (MIT) + +**Authors of media** + +BlockMen (CC BY-SA 3.0): +All textures not mentioned below. + +ShadowNinja (CC BY-SA 3.0): +tnt_smoke.png + +Wuzzy (CC BY-SA 3.0): +All gunpowder textures except tnt_gunpowder_inventory.png. + +sofar (sofar@foo-projects.org) (CC BY-SA 3.0): +tnt_blast.png + +paramat (CC BY-SA 3.0) +tnt_tnt_stick.png - Derived from a texture by benrob0329. + +TumeniNodes (CC0 1.0) +tnt_explode.ogg +renamed, edited, and converted to .ogg from Explosion2.wav +by steveygos93 (CC0 1.0) + + +tnt_ignite.ogg +renamed, edited, and converted to .ogg from sparkler_fuse_nm.wav +by theneedle.tv (CC0 1.0) + + +tnt_gunpowder_burning.ogg +renamed, edited, and converted to .ogg from road flare ignite burns.wav +by frankelmedico (CC0 1.0) + + + diff --git a/mods/tnt/README.txt b/mods/tnt/README.txt index 4e74841..f9d83bc 100644 --- a/mods/tnt/README.txt +++ b/mods/tnt/README.txt @@ -1,16 +1,69 @@ -Minetest Game mod: tnt -====================== -See license.txt for license information. +Minetest mod tnt +================ + +Add tnt tool to make explotions + +Information +----------- + +This mod is named `tnt`, it adds TNT to Minetest. TNT is a tool to +help the player in mining or cause mayor damage in area. thiis mod +featured the `tnt_stick` tool + +![screenshot.png](screenshot.png) + +Technical information +--------------------- + +This mod improves more realistic usage of tnt, by the tnt sticks, +for both older and newers engines. + +Craft gunpowder by placing coal and gravel in the crafting area. +The gunpowder can be used to craft TNT sticks or as a fuse trail for TNT. + +The sticks now is the usage for craft TNT's. + +| name | node | craft | usage | +|--- ------ | ------------- | ------------------ | ------ | +| TNT Stick | tnt:tnt_stick | round a paper with 6 tnt sticks | craft tnt | +| TNT | tnt:tnt | using 9 tnt sticks | destruction ratio | +| Gunpowder | tnt:gunpowder | coal and gravel | powder to ignite tnt | + +**NOTE**: The sticks are not usable as an explosive. + +To craft 2 TNT sticks: +``` +G_G +GPG +G_G +``` +* G = gunpowder +* P = paper + +Craft TNT from 9 TNT sticks. + +There are different ways to ignite TNT: + 1. Hit it with a torch. + 2. Hit a gunpowder fuse trail that leads to TNT with a torch or flint-and-steel. + 3. Activate it with mesecons (fastest way). + +* For 1 TNT: Node destruction radius is 3 nodes by default, configurable. +* Player and object damage radius is 6 nodes. + +License +------- + +See [license.txt](license.txt) for license information. + +**Authors of source code** -Authors of source code ----------------------- PilzAdam (MIT) ShadowNinja (MIT) sofar (sofar@foo-projects.org) (MIT) Various Minetest developers and contributors (MIT) -Authors of media (textures) ---------------------------- +**Authors of media** + BlockMen (CC BY-SA 3.0): All textures not mentioned below. @@ -23,22 +76,23 @@ All gunpowder textures except tnt_gunpowder_inventory.png. sofar (sofar@foo-projects.org) (CC BY-SA 3.0): tnt_blast.png -Introduction ------------- -This mod adds TNT to Minetest. TNT is a tool to help the player -in mining. +paramat (CC BY-SA 3.0) +tnt_tnt_stick.png - Derived from a texture by benrob0329. -How to use the mod: -Craft gunpowder by placing coal and gravel in the crafting area. -The gunpowder can be used to craft TNT or as fuse for TNT. -To craft TNT place items like this: --- wood - gunpowder -- wood - -gunpowder gunpowder gunpowder --- wood - gunpowder -- wood - +TumeniNodes (CC0 1.0) +tnt_explode.ogg +renamed, edited, and converted to .ogg from Explosion2.wav +by steveygos93 (CC0 1.0) + + +tnt_ignite.ogg +renamed, edited, and converted to .ogg from sparkler_fuse_nm.wav +by theneedle.tv (CC0 1.0) + + +tnt_gunpowder_burning.ogg +renamed, edited, and converted to .ogg from road flare ignite burns.wav +by frankelmedico (CC0 1.0) + -There are different ways to blow up TNT: - 1. Hit it with a torch. - 2. Hit a gunpowder fuse that leads to a TNT block with a torch or flint-and-steel. - 3. Activate it with mesecons (fastest way). -Be aware of the damage radius of 6 blocks! diff --git a/mods/tnt/api.txt b/mods/tnt/api.txt new file mode 100644 index 0000000..e3a09a3 --- /dev/null +++ b/mods/tnt/api.txt @@ -0,0 +1,35 @@ +TNT mod API + +On load TNT mod will gather two settings from the minetest.conf file: + +'enable_tnt' a boolean switch which defaults to enabled in singleplayer and disabled on mulitplayer +'tnt_radius' an integer which provides the blast radius of a TNT explosion (default: 3) + + +We also have some global functions which can be called by other mods so long as 'tnt' appears in their depends.txt file: + +tnt.register_tnt(def) + + 'name' name of tnt node to register + 'description' node description to appear in inventory + 'tiles' texture table for node + 'radius' size of damage area to inflict on surrounding nodes + 'damage_radius' size of area to inflice damage on surrounding entities (defaults to 2x radius) + + +tnt.burn(pos, nodename) + + 'pos' position of node to burn/ignite + 'nodename' the name of the node to burn/ignite (can be nil as it will be gotten) + + +tnt.boom (pos, def) + + 'pos' centre position of explosion + 'def' table definition containing explosion settings: + 'radius' radius of the explosion which explodes surrounding nodes + 'damage_radius' radius of explosion damage which causes harm to surrounding entities + 'ignore_protection' when true will explode protected areas (default: false) + 'disable_drops' when true will not drop node items (default: false) + 'explode_center' when true will apply on_boom and drops for center 'pos' node + 'sound' custom explosion sound (default: "tnt_boom") diff --git a/mods/tnt/init.lua b/mods/tnt/init.lua index d12e814..588bb36 100644 --- a/mods/tnt/init.lua +++ b/mods/tnt/init.lua @@ -1,18 +1,22 @@ tnt = {} -- Default to enabled when in singleplayer -local enable_tnt = minetest.settings:get_bool("enable_tnt") +local enable_tnt = minetest.settings:get_bool("enable_tnt") or true if enable_tnt == nil then enable_tnt = minetest.is_singleplayer() end +-- minetest 5.x check +local mt_50 = minetest.get_translator + -- loss probabilities array (one in X will be lost) local loss_prob = {} +loss_prob["default:sandstone"] = 3 loss_prob["default:cobble"] = 3 loss_prob["default:dirt"] = 4 -local tnt_radius = tonumber(minetest.settings:get("tnt_radius") or 3) +local tnt_radius = tonumber(minetest.settings:get("tnt_radius") or 1) -- Fill a list with data for content IDs, after all nodes are registered local cid_data = {} @@ -52,14 +56,14 @@ local function eject_drops(drops, pos, radius) local take = math.max(1,math.min(radius * radius, count, item:get_stack_max())) - rand_pos(pos, drop_pos, radius) +-- rand_pos(pos, drop_pos, radius) local dropitem = ItemStack(item) dropitem:set_count(take) local obj = minetest.add_item(drop_pos, dropitem) if obj then obj:get_luaentity().collect = true - obj:setacceleration({x = 0, y = -10, z = 0}) - obj:setvelocity({x = math.random(-3, 3), + obj:set_acceleration({x = 0, y = -10, z = 0}) + obj:set_velocity({x = math.random(-3, 3), y = math.random(0, 10), z = math.random(-3, 3)}) end @@ -152,47 +156,50 @@ end local function entity_physics(pos, radius, drops) local objs = minetest.get_objects_inside_radius(pos, radius) for _, obj in pairs(objs) do - local obj_pos = obj:getpos() + local obj_pos = obj:get_pos() local dist = math.max(1, vector.distance(pos, obj_pos)) local damage = (4 / dist) * radius if obj:is_player() then - -- currently the engine has no method to set - -- player velocity. See #2960 - -- instead, we knock the player back 1.0 node, and slightly upwards - local dir = vector.normalize(vector.subtract(obj_pos, pos)) - local moveoff = vector.multiply(dir, dist + 1.0) - local newpos = vector.add(pos, moveoff) - newpos = vector.add(newpos, {x = 0, y = 0.2, z = 0}) - obj:setpos(newpos) + + -- use player velocity if using minetest 5.x + if mt_50 then + local dir = vector.normalize(vector.subtract(obj_pos, pos)) + local moveoff = vector.multiply(dir, 2 / dist * radius) + obj:add_player_velocity(moveoff) + end obj:set_hp(obj:get_hp() - damage) else - local do_damage = true - local do_knockback = true - local entity_drops = {} local luaobj = obj:get_luaentity() - local objdef = minetest.registered_entities[luaobj.name] - if objdef and objdef.on_blast then - do_damage, do_knockback, entity_drops = objdef.on_blast(luaobj, damage) - end + -- object might have disappeared somehow + if luaobj then + local do_damage = true + local do_knockback = true + local entity_drops = {} + local objdef = minetest.registered_entities[luaobj.name] - if do_knockback then - local obj_vel = obj:getvelocity() - obj:setvelocity(calc_velocity(pos, obj_pos, - obj_vel, radius * 10)) - end - if do_damage then - if not obj:get_armor_groups().immortal then - obj:punch(obj, 1.0, { - full_punch_interval = 1.0, - damage_groups = {fleshy = damage}, - }, nil) + if objdef and objdef.on_blast then + do_damage, do_knockback, entity_drops = objdef.on_blast(luaobj, damage) + end + + if do_knockback then + local obj_vel = obj:get_velocity() + obj:set_velocity(calc_velocity(pos, obj_pos, + obj_vel, radius * 10)) + end + if do_damage then + if not obj:get_armor_groups().immortal then + obj:punch(obj, 1.0, { + full_punch_interval = 1.0, + damage_groups = {fleshy = damage}, + }, nil) + end + end + for _, item in pairs(entity_drops) do + add_drop(drops, item) end - end - for _, item in pairs(entity_drops) do - add_drop(drops, item) end end end @@ -211,7 +218,7 @@ local function add_effects(pos, radius, drops) glow = 15, }) minetest.add_particlespawner({ - amount = 64, + amount = 32, -- 64 time = 0.5, minpos = vector.subtract(pos, radius / 2), maxpos = vector.add(pos, radius / 2), @@ -229,12 +236,16 @@ local function add_effects(pos, radius, drops) -- we just dropped some items. Look at the items entities and pick -- one of them to use as texture local texture = "tnt_blast.png" --fallback texture + local node local most = 0 for name, stack in pairs(drops) do local count = stack:get_count() if count > most then most = count local def = minetest.registered_nodes[name] + if def then + node = {name = name} + end if def and def.tiles and def.tiles[1] then texture = def.tiles[1] end @@ -242,7 +253,7 @@ local function add_effects(pos, radius, drops) end minetest.add_particlespawner({ - amount = 64, + amount = 32, -- 64 time = 0.1, minpos = vector.subtract(pos, radius / 2), maxpos = vector.add(pos, radius / 2), @@ -252,10 +263,12 @@ local function add_effects(pos, radius, drops) maxacc = {x = 0, y = -10, z = 0}, minexptime = 0.8, maxexptime = 2.0, - minsize = radius * 0.66, - maxsize = radius * 2, + minsize = radius * 0.33, -- * 0.66, + maxsize = radius, -- * 2, texture = texture, - collisiondetection = true, + -- ^ only as fallback for clients without support for `node` parameter + node = node, + collisiondetection = false -- true }) end @@ -266,14 +279,16 @@ function tnt.burn(pos, nodename) return elseif def.on_ignite then def.on_ignite(pos) - elseif minetest.get_item_group(name, "tnt") > 0 then - minetest.swap_node(pos, {name = name .. "_burning"}) - minetest.sound_play("tnt_ignite", {pos = pos}) - minetest.get_node_timer(pos):start(1) +-- elseif minetest.get_item_group(name, "tnt") > 0 then +-- minetest.swap_node(pos, {name = name .. "_burning"}) +-- minetest.sound_play("tnt_ignite", {pos = pos}) +-- minetest.get_node_timer(pos):start(1) end end -local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, owner, explode_center) +local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, + owner, explode_center) + pos = vector.round(pos) -- scan for adjacent TNT nodes first, and enlarge the explosion local vm1 = VoxelManip() @@ -282,14 +297,15 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, owne local minp, maxp = vm1:read_from_map(p1, p2) local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) local data = vm1:get_data() - local count = 0 - local c_tnt = minetest.get_content_id("tnt:tnt") + local count = 0 ; if explode_center then count = 1 end + local c_tnt local c_tnt_burning = minetest.get_content_id("tnt:tnt_burning") local c_tnt_boom = minetest.get_content_id("tnt:boom") local c_air = minetest.get_content_id("air") - -- make sure we still have explosion even when centre node isnt tnt related - if explode_center then - count = 1 + if enable_tnt then + c_tnt = minetest.get_content_id("tnt:tnt") + else + c_tnt = c_tnt_burning end for z = pos.z - 2, pos.z + 2 do @@ -380,8 +396,8 @@ local function tnt_explode(pos, radius, ignore_protection, ignore_on_blast, owne queued_data.fn(queued_data.pos) end - minetest.log("action", "TNT owned by " .. owner .. " detonated at " .. - minetest.pos_to_string(pos) .. " with radius " .. radius) +-- minetest.log("action", "TNT owned by " .. owner .. " detonated at " .. +-- minetest.pos_to_string(pos) .. " with radius " .. radius) return drops, radius end @@ -393,9 +409,12 @@ function tnt.boom(pos, def) local meta = minetest.get_meta(pos) local owner = meta:get_string("owner") if not def.explode_center then - minetest.set_node(pos, {name = "tnt:boom"}) + minetest.swap_node(pos, {name = "tnt:boom"}) end - minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64}) + local sound = def.sound or "tnt_explode" + minetest.sound_play(sound, {pos = pos, gain = 1.5, + max_hear_distance = math.min(def.radius * 20, 128)}) + local drops, radius = tnt_explode(pos, def.radius, def.ignore_protection, def.ignore_on_blast, owner, def.explode_center) -- append entity drops @@ -405,16 +424,16 @@ function tnt.boom(pos, def) eject_drops(drops, pos, radius) end add_effects(pos, radius, drops) - minetest.log("action", "A TNT explosion occurred at " .. minetest.pos_to_string(pos) .. - " with radius " .. radius) +-- minetest.log("action", "A TNT explosion occurred at " .. minetest.pos_to_string(pos) .. +-- " with radius " .. radius) end minetest.register_node("tnt:boom", { drawtype = "airlike", light_source = default.LIGHT_MAX, walkable = false, - drop = "", - groups = {dig_immediate = 3}, + drop = {}, + groups = {dig_immediate = 3, not_in_creative_inventory = 1}, -- unaffected by explosions on_blast = function() end, }) @@ -507,13 +526,16 @@ minetest.register_node("tnt:gunpowder_burning", { type = "fixed", fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, }, - drop = "", + drop = {}, groups = { + not_in_creative_inventory = 1, dig_immediate = 2, attached_node = 1, connect_to_raillike = minetest.raillike_group("gunpowder") }, sounds = default.node_sound_leaves_defaults(), + + -- only explode connecting gunpowder on_timer = function(pos, elapsed) for dx = -1, 1 do for dz = -1, 1 do @@ -544,13 +566,28 @@ minetest.register_craft({ recipe = {"default:coal_lump", "default:gravel"} }) +minetest.register_craftitem("tnt:tnt_stick", { + description = "TNT Stick", + inventory_image = "tnt_tnt_stick.png", + groups = {flammable = 5}, +}) + if enable_tnt then + minetest.register_craft({ + output = "tnt:tnt_stick 2", + recipe = { + {"tnt:gunpowder", "", "tnt:gunpowder"}, + {"tnt:gunpowder", "default:paper", "tnt:gunpowder"}, + {"tnt:gunpowder", "", "tnt:gunpowder"}, + } + }) + minetest.register_craft({ output = "tnt:tnt", recipe = { - {"group:wood", "tnt:gunpowder", "group:wood"}, - {"tnt:gunpowder", "tnt:gunpowder", "tnt:gunpowder"}, - {"group:wood", "tnt:gunpowder", "group:wood"} + {"tnt:tnt_stick", "tnt:tnt_stick", "tnt:tnt_stick"}, + {"tnt:tnt_stick", "tnt:tnt_stick", "tnt:tnt_stick"}, + {"tnt:tnt_stick", "tnt:tnt_stick", "tnt:tnt_stick"} } }) @@ -568,7 +605,7 @@ end function tnt.register_tnt(def) local name - if not def.name:find(':') then + if not def.name:find(":") then name = "tnt:" .. def.name else name = def.name @@ -640,9 +677,9 @@ function tnt.register_tnt(def) tnt_bottom, tnt_side }, light_source = 5, - drop = "", + drop = {}, sounds = default.node_sound_wood_defaults(), - groups = {falling_node = 1}, + groups = {falling_node = 1, not_in_creative_inventory = 1}, on_timer = function(pos, elapsed) tnt.boom(pos, def) end, @@ -653,6 +690,15 @@ function tnt.register_tnt(def) minetest.get_node_timer(pos):start(4) minetest.check_for_falling(pos) end, + + -- when falling run custom function to continue timer + falling_step = function(self, pos, dtime) + self.tnt_timer = (self.tnt_timer or 0) + dtime + if self.tnt_timer >= 4 then + tnt.boom(pos, def) + self.object:remove() + end + end }) end diff --git a/mods/tnt/license.txt b/mods/tnt/license.txt index 210f2bd..c289e1c 100644 --- a/mods/tnt/license.txt +++ b/mods/tnt/license.txt @@ -26,15 +26,17 @@ DEALINGS IN THE SOFTWARE. For more details: https://opensource.org/licenses/MIT +=================================== -Licenses of media (textures) ----------------------------- +Licenses of media +----------------- Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) Copyright (C) 2014-2016 BlockMen Copyright (C) 2014-2016 ShadowNinja Copyright (C) 2015-2016 Wuzzy Copyright (C) 2016 sofar (sofar@foo-projects.org) +Copyright (C) 2018 paramat You are free to: Share — copy and redistribute the material in any medium or format. @@ -63,3 +65,35 @@ rights may limit how you use the material. For more details: http://creativecommons.org/licenses/by-sa/3.0/ + +==================================================== + +CC0 1.0 Universal (CC0 1.0) Public Domain Dedication +for audio files (found in sounds folder) +TumeniNodes +steveygos93 +theneedle.tv +frankelmedico + +No Copyright + +The person who associated a work with this deed has dedicated the work to the public domain +by waiving all of his or her rights to the work worldwide under copyright law, including all +related and neighboring rights, to the extent allowed by law. + +You can copy, modify, distribute and perform the work, even for commercial purposes, all +without asking permission. See Other Information below. + +In no way are the patent or trademark rights of any person affected by CC0, nor are the +rights that other persons may have in the work or in how the work is used, such as publicity +or privacy rights. + +Unless expressly stated otherwise, the person who associated a work with this deed makes no +warranties about the work, and disclaims liability for all uses of the work, to the fullest +extent permitted by applicable law. + +When using or citing the work, you should not imply endorsement by the author or the affirmer. + +This license is acceptable for Free Cultural Works. +For more Information: +https://creativecommons.org/publicdomain/zero/1.0/ diff --git a/mods/tnt/mod.conf b/mods/tnt/mod.conf new file mode 100644 index 0000000..9385e82 --- /dev/null +++ b/mods/tnt/mod.conf @@ -0,0 +1,3 @@ +name = tnt +description = Minetest Game mod: tnt +depends = default, fire diff --git a/mods/tnt/screenshot.png b/mods/tnt/screenshot.png new file mode 100644 index 0000000..aa9b0b0 Binary files /dev/null and b/mods/tnt/screenshot.png differ diff --git a/mods/tnt/sounds/tnt_explode.ogg b/mods/tnt/sounds/tnt_explode.ogg index a414ea0..e00a16c 100644 Binary files a/mods/tnt/sounds/tnt_explode.ogg and b/mods/tnt/sounds/tnt_explode.ogg differ diff --git a/mods/tnt/sounds/tnt_ignite.ogg b/mods/tnt/sounds/tnt_ignite.ogg index 199f206..1a7062e 100644 Binary files a/mods/tnt/sounds/tnt_ignite.ogg and b/mods/tnt/sounds/tnt_ignite.ogg differ diff --git a/mods/tnt/textures/tnt_blast.png b/mods/tnt/textures/tnt_blast.png index bbb1096..9f32d3c 100644 Binary files a/mods/tnt/textures/tnt_blast.png and b/mods/tnt/textures/tnt_blast.png differ diff --git a/mods/tnt/textures/tnt_tnt_stick.png b/mods/tnt/textures/tnt_tnt_stick.png new file mode 100644 index 0000000..bc47a29 Binary files /dev/null and b/mods/tnt/textures/tnt_tnt_stick.png differ diff --git a/mods/wool/README.md b/mods/wool/README.md new file mode 100644 index 0000000..96e3b99 --- /dev/null +++ b/mods/wool/README.md @@ -0,0 +1,58 @@ +minetest mod wool +================= + +Improved Wool mod for Minetest + +Information +----------- + +It's a simple replacement for the wool mod that allows you to dye any +wool any colour including white, and also added a wool sound when walking +on top of the wool blocks to replace the leaves sound. + +![screenshot.png](screenshot.png) + +Technical info +-------------- + +This is a improved fork from TenPlus1 + +#### Dependencies + +* default + +#### Nodes + +| node name | Description | +| --------------- | --------------- | +| wool:white | White Wool | +| wool:grey | Grey Wool | +| wool:black | Black Wool | +| wool:red | Red Wool | +| wool:yellow | Yellow Wool | +| wool:green | Green Wool | +| wool:cyan | Cyan Wool | +| wool:blue | Blue Wool | +| wool:magenta | Magenta Wool | +| wool:orange | Orange Wool | +| wool:violet | Violet Wool | +| wool:brown | Brown Wool | +| wool:pink | Pink Wool | +| wool:dark_grey | Dark Grey Wool | +| wool:dark_green | Dark Green Wool | +| wool:dark_blue | Dark Blue Wool | +| wool:gold | Gold Wool | + +#### Alias + +| node name | node alias | +| --------------- | --------------- | +| wool:dark_blue | wool:blue | +| wool:gold | wool:yellow | + +License +------- + +Textures are from Gambit's PixelBox texture pack. + +Sound is from freeSFX.co.uk and has a creative-commons license diff --git a/mods/wool/README.txt b/mods/wool/README.txt deleted file mode 100644 index a66677d..0000000 --- a/mods/wool/README.txt +++ /dev/null @@ -1,16 +0,0 @@ -Minetest Game mod: wool -======================= -See license.txt for license information. - -Authors of source code ----------------------- -Originally by Perttu Ahola (celeron55) (MIT) -Various Minetest developers and contributors (MIT) - -Authors of media (textures) ---------------------------- -Cisoun (CC BY-SA 3.0): - wool_black.png wool_brown.png wool_dark_green.png wool_green.png - wool_magenta.png wool_pink.png wool_violet.png wool_yellow.png - wool_blue.png wool_cyan.png wool_dark_grey.png wool_grey.png - wool_orange.png wool_red.png wool_white.png diff --git a/mods/wool/init.lua b/mods/wool/init.lua index a36e4dd..b93fff5 100644 --- a/mods/wool/init.lua +++ b/mods/wool/init.lua @@ -1,47 +1,67 @@ --- This uses a trick: you can first define the recipes using all of the base --- colors, and then some recipes using more specific colors for a few non-base --- colors available. When crafting, the last recipes will be checked first. - -local dyes = { - {"white", "White", "basecolor_white"}, - {"grey", "Grey", "basecolor_grey"}, - {"black", "Black", "basecolor_black"}, - {"red", "Red", "basecolor_red"}, - {"yellow", "Yellow", "basecolor_yellow"}, - {"green", "Green", "basecolor_green"}, - {"cyan", "Cyan", "basecolor_cyan"}, - {"blue", "Blue", "basecolor_blue"}, - {"magenta", "Magenta", "basecolor_magenta"}, - {"orange", "Orange", "excolor_orange"}, - {"violet", "Violet", "excolor_violet"}, - {"brown", "Brown", "unicolor_dark_orange"}, - {"pink", "Pink", "unicolor_light_red"}, - {"dark_grey", "Dark Grey", "unicolor_darkgrey"}, - {"dark_green", "Dark Green", "unicolor_dark_green"}, -} - -for i = 1, #dyes do - local name, desc, craft_color_group = unpack(dyes[i]) - - minetest.register_node("wool:" .. name, { - description = desc .. " Wool", - tiles = {"wool_" .. name .. ".png"}, - is_ground_content = false, - groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, - flammable = 3, wool = 1}, - sounds = default.node_sound_defaults(), - }) - - minetest.register_craft{ - type = "shapeless", - output = "wool:" .. name, - recipe = {"group:dye," .. craft_color_group, "group:wool"}, - } -end - - --- legacy - --- Backwards compatibility with jordach's 16-color wool mod minetest.register_alias("wool:dark_blue", "wool:blue") minetest.register_alias("wool:gold", "wool:yellow") + +function default.node_wool_defaults(table) + + table = table or {} + + table.footstep = table.footstep or + {name = "wool_coat_movement", gain = 1.0} + + table.dug = table.dug or + {name = "default_dug_node", gain = 0.25} + + table.place = table.place or + {name = "default_place_node", gain = 1.0} + + return table +end + +local wool_sound = default.node_wool_defaults() +--local wool_sound = default.node_sound_defaults() + +local wool_dyes = { + {"white", "White"}, + {"grey", "Grey"}, + {"black", "Black"}, + {"red", "Red"}, + {"yellow", "Yellow"}, + {"green", "Green"}, + {"cyan", "Cyan"}, + {"blue", "Blue"}, + {"magenta", "Magenta"}, + {"orange", "Orange"}, + {"violet", "Violet"}, + {"brown", "Brown"}, + {"pink", "Pink"}, + {"dark_grey", "Dark Grey"}, + {"dark_green", "Dark Green"}, +} + +for _, row in pairs(wool_dyes) do + + minetest.register_node("wool:" .. row[1], { + description = row[2] .. " Wool", + tiles = {"wool_" .. row[1] .. ".png"}, + groups = { + snappy = 2, choppy = 2, oddly_breakable_by_hand = 3, + flammable = 3, wool = 1 + }, + sounds = wool_sound, + }) + + minetest.register_craft({ + type = "shapeless", + output = "wool:" .. row[1], + recipe = {"dye:" .. row[1], "group:wool"}, + }) + +end + +minetest.register_craft({ + type = "fuel", + recipe = "group:wool", + burntime = 2, +}) + +print ("[MOD] Wool mod loaded") diff --git a/mods/wool/license.txt b/mods/wool/license.txt deleted file mode 100644 index 9310163..0000000 --- a/mods/wool/license.txt +++ /dev/null @@ -1,60 +0,0 @@ -License of source code ----------------------- - -The MIT License (MIT) -Copyright (C) 2012-2016 Perttu Ahola (celeron55) -Copyright (C) 2012-2016 Various Minetest developers and contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy of this -software and associated documentation files (the "Software"), to deal in the Software -without restriction, including without limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or -substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -For more details: -https://opensource.org/licenses/MIT - - -Licenses of media (textures) ----------------------------- - -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -Copyright (C) 2012-2016 Cisoun - -You are free to: -Share — copy and redistribute the material in any medium or format. -Adapt — remix, transform, and build upon the material for any purpose, even commercially. -The licensor cannot revoke these freedoms as long as you follow the license terms. - -Under the following terms: - -Attribution — You must give appropriate credit, provide a link to the license, and -indicate if changes were made. You may do so in any reasonable manner, but not in any way -that suggests the licensor endorses you or your use. - -ShareAlike — If you remix, transform, or build upon the material, you must distribute -your contributions under the same license as the original. - -No additional restrictions — You may not apply legal terms or technological measures that -legally restrict others from doing anything the license permits. - -Notices: - -You do not have to comply with the license for elements of the material in the public -domain or where your use is permitted by an applicable exception or limitation. -No warranties are given. The license may not give you all of the permissions necessary -for your intended use. For example, other rights such as publicity, privacy, or moral -rights may limit how you use the material. - -For more details: -http://creativecommons.org/licenses/by-sa/3.0/ diff --git a/mods/wool/mod.conf b/mods/wool/mod.conf new file mode 100644 index 0000000..5ab8865 --- /dev/null +++ b/mods/wool/mod.conf @@ -0,0 +1,3 @@ +name = wool +depends = default +description = Adds wool blocks into game. diff --git a/mods/wool/screenshot.png b/mods/wool/screenshot.png new file mode 100644 index 0000000..d9b1836 Binary files /dev/null and b/mods/wool/screenshot.png differ diff --git a/mods/wool/sounds/wool_coat_movement.ogg b/mods/wool/sounds/wool_coat_movement.ogg new file mode 100644 index 0000000..89df47f Binary files /dev/null and b/mods/wool/sounds/wool_coat_movement.ogg differ diff --git a/mods/wool/textures/wool_black.png b/mods/wool/textures/wool_black.png index 700d439..9a8e140 100644 Binary files a/mods/wool/textures/wool_black.png and b/mods/wool/textures/wool_black.png differ diff --git a/mods/wool/textures/wool_blue.png b/mods/wool/textures/wool_blue.png index a074986..b890e37 100644 Binary files a/mods/wool/textures/wool_blue.png and b/mods/wool/textures/wool_blue.png differ diff --git a/mods/wool/textures/wool_brown.png b/mods/wool/textures/wool_brown.png index 2620dfd..a699732 100644 Binary files a/mods/wool/textures/wool_brown.png and b/mods/wool/textures/wool_brown.png differ diff --git a/mods/wool/textures/wool_cyan.png b/mods/wool/textures/wool_cyan.png index 395b6ac..2a2e625 100644 Binary files a/mods/wool/textures/wool_cyan.png and b/mods/wool/textures/wool_cyan.png differ diff --git a/mods/wool/textures/wool_dark_green.png b/mods/wool/textures/wool_dark_green.png index 0e73999..d701c7e 100644 Binary files a/mods/wool/textures/wool_dark_green.png and b/mods/wool/textures/wool_dark_green.png differ diff --git a/mods/wool/textures/wool_dark_grey.png b/mods/wool/textures/wool_dark_grey.png index 7253696..c071cbf 100644 Binary files a/mods/wool/textures/wool_dark_grey.png and b/mods/wool/textures/wool_dark_grey.png differ diff --git a/mods/wool/textures/wool_green.png b/mods/wool/textures/wool_green.png index dcb663b..d6c5fa7 100644 Binary files a/mods/wool/textures/wool_green.png and b/mods/wool/textures/wool_green.png differ diff --git a/mods/wool/textures/wool_grey.png b/mods/wool/textures/wool_grey.png index 2f4c338..9e2f4b7 100644 Binary files a/mods/wool/textures/wool_grey.png and b/mods/wool/textures/wool_grey.png differ diff --git a/mods/wool/textures/wool_magenta.png b/mods/wool/textures/wool_magenta.png index 5c2c4a7..d93273d 100644 Binary files a/mods/wool/textures/wool_magenta.png and b/mods/wool/textures/wool_magenta.png differ diff --git a/mods/wool/textures/wool_orange.png b/mods/wool/textures/wool_orange.png index a059f36..6ce44fc 100644 Binary files a/mods/wool/textures/wool_orange.png and b/mods/wool/textures/wool_orange.png differ diff --git a/mods/wool/textures/wool_pink.png b/mods/wool/textures/wool_pink.png index 8e90140..7d7d9e8 100644 Binary files a/mods/wool/textures/wool_pink.png and b/mods/wool/textures/wool_pink.png differ diff --git a/mods/wool/textures/wool_red.png b/mods/wool/textures/wool_red.png index da12ecf..0a0ce71 100644 Binary files a/mods/wool/textures/wool_red.png and b/mods/wool/textures/wool_red.png differ diff --git a/mods/wool/textures/wool_violet.png b/mods/wool/textures/wool_violet.png index d7d6783..155b018 100644 Binary files a/mods/wool/textures/wool_violet.png and b/mods/wool/textures/wool_violet.png differ diff --git a/mods/wool/textures/wool_white.png b/mods/wool/textures/wool_white.png index 88f1e2f..0798592 100644 Binary files a/mods/wool/textures/wool_white.png and b/mods/wool/textures/wool_white.png differ diff --git a/mods/wool/textures/wool_yellow.png b/mods/wool/textures/wool_yellow.png index 2b0f048..a29c047 100644 Binary files a/mods/wool/textures/wool_yellow.png and b/mods/wool/textures/wool_yellow.png differ