diff --git a/license.txt b/LICENSE similarity index 96% rename from license.txt rename to LICENSE index 2c38778..aea3838 100644 --- a/license.txt +++ b/LICENSE @@ -1,7 +1,7 @@ The MIT License (MIT) -Copyright (c) 2020 philipmi +Copyright (c) 2020-2023 philipmi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 9fe570b..a323901 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,22 @@ Regrowing Fruits === +[![ContentDB](https://content.minetest.net/packages/philipmi/regrowing_fruits/shields/title/)](https://content.minetest.net/packages/philipmi/regrowing_fruits/) +[![ContentDB](https://content.minetest.net/packages/philipmi/regrowing_fruits/shields/downloads/)](https://content.minetest.net/packages/philipmi/regrowing_fruits/stats/) +[![Forums](https://img.shields.io/badge/Forums-Regrowing_Fruits-lightgrey)](https://forum.minetest.net/viewtopic.php?t=24986) +[![License](https://img.shields.io/badge/license-MIT-brightgreen)](#license) +![Screenshot](screenshot.png) Info ---- -This mod causes fruits on trees from various other mods to regrow like apples in the 5.0 release of Minetest Game. If you placed the fruits by hand or removed the tree leaves, the fruits don't regrow. - -Cool_trees modpack, ethereal, farming_plus, multibiomegen, australia, aotearoa and moretrees are supported, but maybe there are other mods with this problem that I don't know about. Please tell me in the Minetest Forum topic! +This mod causes fruits on trees from various other mods to regrow like apples in the 5.0 release of Minetest Game. +If you placed the fruits by hand or removed the tree leaves, the fruits don't regrow. +Cool_trees modpack, ethereal, farming_plus, multibiomegen, australia, aotearoa and moretrees are currently supported. Default apples in older versions than Minetest 5.0 will also regrow. +Ideas, bug reports or requests for more mod support are always welcome in the [Minetest Forum topic](https://forum.minetest.net/viewtopic.php?f=9&t=24986) or via the [Git Issue Tracker](https://git.sp-codes.de/minetest/regrowing_fruits/issues)! + Credits ---- @@ -18,7 +25,4 @@ This mod is inspired by "endless_apples" by Shara RedCat (2018). License ---- -Code for this mod is released under MIT (https://opensource.org/licenses/MIT). - - -If you got ideas or found bugs, please let me know on the Forum topic(https://forum.minetest.net/viewtopic.php?f=9&t=24986)! \ No newline at end of file +Code for this mod is released under [MIT](https://spdx.org/licenses/MIT.html) (see [LICENSE](LICENSE)). diff --git a/init.lua b/init.lua index 7fff9b7..a7e800f 100644 --- a/init.lua +++ b/init.lua @@ -46,14 +46,15 @@ local add_fruit_regrowable = function(fruit, node, leaves) end) end - local groups = minetest.registered_nodes[node]["groups"] + -- make sure (moretrees) fruits don't fall on dig + local groups = minetest.registered_nodes[node].groups groups.attached_node = 0 -- wait until mods are loaded to ensure that other mods do not override overrides minetest.after(0.1, function() -- override fruit minetest.override_item(node, { - groups = groups, -- make sure (moretrees) fruits don't fall on dig + --groups = groups, after_place_node = function(pos, placer) -- make sure (moretrees and plumtree) fruits aren't placed by player if placer:is_player() and node == "plumtree:plum" then minetest.set_node(pos, {name = node, param2 = 0}) diff --git a/screenshot.png b/screenshot.png index 82146a1..d5d99a2 100644 Binary files a/screenshot.png and b/screenshot.png differ