[Abandoned] [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

Post Reply
User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

[Abandoned] [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Hamlet » Post

Prevents digging trees by punching them.

Version: 0.2.0
Source code's license: EUPL v1.2 or later.
Textures and locale files' license: CC BY-SA 4.0 International or later.

Dependencies: default, farming (found in Minetest Game)
Supported: bonemeal, intllib, fallen_nodes, fallen_trees

Description:
Leaf nodes will drop sticks, dirt/cobble/stone/etc. nodes will drop rocks.
Wooden axe and wooden pick will be removed.
Stone tools can be crafted using sticks and rocks (or flints).
Rocks can be used to craft cobblestone nodes, recipe:

R = Rock

RRR
RRR
RRR

9 rocks give 1 cobblestone node.

These game mechanics have been ported from Voxelands.


Downloads:
Archives: .zip .tar.gz
Source code: Codeberg


Installation
Unzip the archive, rename the folder to hard_trees_redo and place it in
../minetest/mods/

If you only want this to be used in a single world, place it in
../minetest/worlds/WORLD_NAME/worldmods/

GNU+Linux - If you use a system-wide installation place it in
~/.minetest/mods/

For further information or help see:
https://wiki.minetest.net/Help:Installing_Mods
Last edited by Hamlet on Fri Oct 02, 2020 17:07, edited 6 times in total.
My repositories: Codeberg.org | My ContentDB's page

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Hard Trees Redo [0.1.1] [hard_trees_redo]

by Hamlet » Post

Notice: git repository back online.
My repositories: Codeberg.org | My ContentDB's page

ThorfinnS
Member
Posts: 311
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [Mod] Hard Trees Redo [0.1.1] [hard_trees_redo]

by ThorfinnS » Post

I'm not sure how to code it, but until you figure out how to add drops to nodes instead of overriding them, you might want to make a note that this is incompatible with TenPlus1's bonemeal. Only mention it because it seems that's a really popular mod in the server list I looked at. And it won't work with ours.

Someone added pebbles and sticks just lying on the ground (nature or forest_litter or something) that I always meant to port over with oddly_breakable_by_hand. That's a possible answer to making it compatible, if someone remembers what that was called.

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Hard Trees Redo [0.1.1] [hard_trees_redo]

by Hamlet » Post

ThorfinnS wrote:I'm not sure how to code it, but until you figure out how to add drops to nodes instead of overriding them, you might want to make a note that this is incompatible with TenPlus1's bonemeal. Only mention it because it seems that's a really popular mod in the server list I looked at. And it won't work with ours.
As far as I know, once that you have defined and registered a node the only way to modify its behavior is to override it.

E.g.:
I register a stone that when dug does not drop anything, the node's definition will not have the field

Code: Select all

drops = {}
Bob decides that it should drop dollars, thus it adds the field

Code: Select all

drops = {"bob_mod:dollar"}
by using an overrider.

Anyway, thanks for the heads up: the conflicting code is here for BoneMeal and here for HardTreesRedo.

I will add support for BoneMeal's drop, maybe someone growing forests underground might use it.

ThorfinnS wrote: Someone added pebbles and sticks just lying on the ground (nature or forest_litter or something) that I always meant to port over with oddly_breakable_by_hand. That's a possible answer to making it compatible, if someone remembers what that was called.
Uh I can't remember either. I saw that in RealTest, but to be honest I don't like the look of it - I mean, it's realistic to find rocks laying on the ground (I'm thinking about rivers' sides, especially) but for some reason I can't get to like them.
My repositories: Codeberg.org | My ContentDB's page

User avatar
TenPlus1
Member
Posts: 3722
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Hard Trees Redo [0.1.1] [hard_trees_redo]

by TenPlus1 » Post

Thorfinss: here's a little code snippet to insert item drops into a current node without overriding the existing ones:

viewtopic.php?f=9&t=9741&p=361200#p361200

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Hamlet » Post

Released v0.2.0

Added:
- Support for Minetest Game v5.x new nodes.
- Support for Bonemeal.

Changed:
- License changed to EUPL v1.2.
- mod.conf set to follow Minetest v5.x specifics.
- Textures have been optimized with optipng.
- Code cleaning.

Removed:
- Support for Minetest Game v0.4.x
- ../doc/
My repositories: Codeberg.org | My ContentDB's page

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Nordal » Post

I like your 5.x safe updated version.
Just an idea: Stones drop rock pieces still when you have metal or mese pickaxe/axe and don't need them anymore. Thus while mining you constantly have to get rid of them to avoid an overflow of your inventory. Maybe it's possible to stop dropping rocks if the player has a pickaxe tool in his inventory. I think sand and dirt is not digged too often. But digging stone is the main activity.
CFS - still widely unknown

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Nordal » Post

Code: Select all

local picks = {"default:pick_steel", "default:pick_mese", "default:pick_diamond", "default:pick_obsidian"}
local inv = minetest.get_inventory({type="player", name="main"})
for i, p in ipairs(picks) do
    if inv:contains_item(p)
        --do not drop rocks => remove from drop-list
         break
    end
end
If you used the code proposed by TenPlus1, which only adds drops to nodes so that they can drop more than one thing instead of overriding, it would be easy to remove the rocks from the drops-lists of the nodes stone and dirt. If you leave sand droping rocks, player still has rocks available in a transitional phase from stone to metal. Otherwise one had to constantly test the inventory and add or remove rock dropping. If I think right.
CFS - still widely unknown

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Hamlet » Post

Remember that you can turn rocks into cobblestone nodes: placing 9 rocks in the crafting grid will give you 1 cobblestone.

99 rocks = 11 cobblestone nodes.

Or simply /pulverize while holding the stack.

I am not sure that preventing the rocks drop if the inventory contains a steel or better pick would be a good idea: following this reasoning, one might not want cobblestone drops as well - I have chests filled of cobblestone.

I'd rather change from the Craft Guide to the Unified Inventory, because the latter has a trash-can slot that can be used to delete unwanted items without using the /pulverize command; this would be useful both for rocks and cobblestone stacks.

What do you think?
My repositories: Codeberg.org | My ContentDB's page

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Nordal » Post

Remember that you can turn rocks into cobblestone nodes: placing 9 rocks in the crafting grid will give you 1 cobblestone.

99 rocks = 11 cobblestone nodes.

Or simply /pulverize while holding the stack.
Yes, of course, these are possible ways. If you have a levelled up diamond pickaxe the inventory is just very fast full of rocks and cobblestone. From another point of view, rocks are even very realistic. Particularly concerning digging earth or mining. :)

I just thought about an elegant programmatically solution. The linked code snippet of TenPlus1 pointing out a different way of handling drops made me start thinking. I'm working on a more complex mod than bunkbed. I will need clay in the sense of loam for it and I want to run it together with darkage and hard_trees_redo. Darkage makes the default:clay to powder clay. So I just thought where can I get the loam from: As a dirt's drop would make sense. (Or somehow as an additional special sort of dirt. But that is far too complicated for me.)

I am not convinced of unified inventory. Since MT 5.x it shows items belonging into a creative mode inventory guide though you're in survival mode. And VanessaE has handed over maintaining the mod. sfinv based craftign guides are actively improved at the moment. This is just my impression. And I prefer the look and feel of sfinv. And backpacks. But I admit a trash slot can be an advantage. :)
CFS - still widely unknown

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Hamlet » Post

Nordal wrote: I just thought about an elegant programmatically solution. The linked code snippet of TenPlus1 pointing out a different way of handling drops made me start thinking. I'm working on a more complex mod than bunkbed. I will need clay in the sense of loam for it and I want to run it together with darkage and hard_trees_redo. Darkage makes the default:clay to powder clay. So I just thought where can I get the loam from: As a dirt's drop would make sense. (Or somehow as an additional special sort of dirt. But that is far too complicated for me.)
Oh thanks for mentioning this: I've just discovered your bunkbed mod; some months ago I was pondering about adding a mod that added a campfire and a bedroll, for exploration or simply to skip nights in the game's early stages. Then I forgot about it, I'll keep an eye on your mod. :)
Nordal wrote: I am not convinced of unified inventory. Since MT 5.x it shows items belonging into a creative mode inventory guide though you're in survival mode. And VanessaE has handed over maintaining the mod. sfinv based craftign guides are actively improved at the moment. This is just my impression. And I prefer the look and feel of sfinv. And backpacks. But I admit a trash slot can be an advantage. :)
Uh I wasn't aware of those issues; about the look and feel, I agree: I prefer sfinv over UI.

About the trash slot, I did a little research and I've found that there are a couple of mods that add a trashcan item in-game, but no inventory slot. Except one coded by prestidigitator, which I used to make a mod: link.

I've tested it on Minetest Game, it works properly.
Unfortunately it does not work in Hamlet's Quest, no idea why: my knowledge of formspecs is zero.
If you have the time and the will, you could give it a look and see if it can be adapted for today's Minetest Game's inventory's look, and perhaps for Hamlet's Quest - I would surely add that utility!
My repositories: Codeberg.org | My ContentDB's page

ThorfinnS
Member
Posts: 311
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by ThorfinnS » Post

It's been a while, so I wouldn't swear to it, but I think bell07 turned in a PR to add trash can to the smart_sfinv.

What is the creative/survival thing about UI? Do you mean that items that don't have a craft recipe are still listed?

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Hamlet » Post

ThorfinnS wrote:It's been a while, so I wouldn't swear to it, but I think bell07 turned in a PR to add trash can to the smart_sfinv.
Just downloaded and tried, no trashcan slot yet. However thanks for mentioning it, I'll keep an eye on it!
My repositories: Codeberg.org | My ContentDB's page

ThorfinnS
Member
Posts: 311
Joined: Mon Feb 25, 2019 22:05
GitHub: ThorfinnS

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by ThorfinnS » Post

Hamlet wrote:
ThorfinnS wrote: Someone added pebbles and sticks just lying on the ground (nature or forest_litter or something) that I always meant to port over with oddly_breakable_by_hand. That's a possible answer to making it compatible, if someone remembers what that was called.
Uh I can't remember either. I saw that in RealTest, but to be honest I don't like the look of it - I mean, it's realistic to find rocks laying on the ground (I'm thinking about rivers' sides, especially) but for some reason I can't get to like them.
Found it. There are several, but this has the best looking ones I found, and I'm pretty sure the one I was thinking of.

VanessaE's plantlife modpack, specifically components cavestuff and trunks.

https://gitlab.com/VanessaE/plantlife_modpack

viewtopic.php?f=11&t=3898

Just replace "cracky" and "choppy"with "dig_immediate" for the twigs and pebbles, and it operates pretty much how I'd like. Maybe the pebbles are too common to be a replacement for cobble, IMO, they are not common enough to be 9:1.

User avatar
Hamlet
Member
Posts: 766
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Hamlet » Post

ThorfinnS wrote: VanessaE's plantlife modpack, specifically components cavestuff and trunks.

https://gitlab.com/VanessaE/plantlife_modpack

viewtopic.php?f=11&t=3898

Just replace "cracky" and "choppy"with "dig_immediate" for the twigs and pebbles, and it operates pretty much how I'd like. Maybe the pebbles are too common to be a replacement for cobble, IMO, they are not common enough to be 9:1.
Oh thanks for the info, I will check it for sure.
I did some tests with node decorations, that is, a blue cube to be randomly scattered on surface; I wanted to see if I could find a good perlin noise to implement surface rocks - my flat map got covered with blue nodes.
I guess I'll have to apply myself far better than what I did. :)

Speaking of pebbles... they could be good for a slingshot. No, surely not a cobble node for 9 pebbles, not even a gravel node I think.
I'd like rocks to be throw-able, to give players a cheap ranged weapon - well maybe not that good for a server, but for a local game it would be realistic.
My repositories: Codeberg.org | My ContentDB's page

Nordal
Member
Posts: 158
Joined: Mon Jul 30, 2018 15:46
GitHub: Nordall

Re: [Mod] Hard Trees Redo [0.2.0] [hard_trees_redo]

by Nordal » Post

@ThorfinnS
What is the creative/survival thing about UI? Do you mean that items that don't have a craft recipe are still listed?
Yes. If you have mob_animal of TenPlus1 installed UI lists every animal and every spawn-egg in it's inventory. No matter which mode (survival/creative).
CFS - still widely unknown

Post Reply

Who is online

Users browsing this forum: No registered users and 75 guests