Page 1 of 1

Dropping mined blocks to ground

PostPosted: Sun Mar 18, 2012 21:08
by lkjoel
I'm working on a patch that will drop mined blocks to the ground instead of automatically getting them in your inventory. As a side effect of this, whenever you walk on a Q'd item or tool, you will automatically get it (instead of having to click on it).

PostPosted: Mon Mar 19, 2012 06:25
by sfan5
+5

PostPosted: Mon Mar 19, 2012 12:00
by jordan4ibanez
THANK YOU! i've been begging everyone to make this :D will you make them into entities instead of those weird "dropped items" ??

PostPosted: Mon Mar 19, 2012 13:20
by Utilisatrice
Great idea !

PostPosted: Mon Mar 19, 2012 13:33
by sfan5
+1 again :D

PostPosted: Mon Mar 19, 2012 14:10
by Death Dealer
dunamite mining:D for real

PostPosted: Mon Mar 19, 2012 16:54
by lkjoel
jordan4ibanez wrote:THANK YOU! i've been begging everyone to make this :D will you make them into entities instead of those weird "dropped items" ??

Entities? How would I do that?

PostPosted: Tue Mar 20, 2012 20:01
by randomproof
lkjoel wrote:
jordan4ibanez wrote:THANK YOU! i've been begging everyone to make this :D will you make them into entities instead of those weird "dropped items" ??

Entities? How would I do that?

Those "dropped items" are entities. I think you mean LUAentities, but to do what with them? I guess you could use the on_step function to look for a player standing on the entity and automatically add it to the player's inventory as they walk over them. Or have them destroy themselves if they fall into lava (or the like).

PostPosted: Fri Mar 23, 2012 17:36
by lkjoel
ok thanks

PostPosted: Sun Mar 25, 2012 00:21
by lkjoel
Very simple patch (for now). The speed of dropping is so slow, and you cannot walk over it to pick it up, but it works.
Patch builtin.lua with this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
348c348,349
<                       digger:get_inventory():add_item("main", dropped_item)
---
>                       -- digger:get_inventory():add_item("main", dropped_item)
>                       minetest.item_drop(dropped_item, digger, pos)

PostPosted: Sun Apr 01, 2012 07:59
by LorenzoVulcan
I've already made this,Without automatic take.

PostPosted: Sun Apr 01, 2012 08:45
by neko259
What is this for? Just to make 'like in minecraft'? Getting blocks to the inventory is more comfortable.

PostPosted: Sun Apr 01, 2012 08:50
by LorenzoVulcan
neko259 wrote:What is this for? Just to make 'like in minecraft'? Getting blocks to the inventory is more comfortable.

This can prevent many stacks of useless blocks like cobble stone.

PostPosted: Sun Apr 01, 2012 17:36
by Death Dealer
This would work well with a level/attribute system like a block has so much chance to drop more than one block per node based on your level. I hope there some progress being made with this:D

PostPosted: Sun Apr 01, 2012 19:11
by JoseMing
good idea +2

PostPosted: Sun Apr 01, 2012 19:26
by neko259
LorenzoVulcan wrote:
neko259 wrote:What is this for? Just to make 'like in minecraft'? Getting blocks to the inventory is more comfortable.

This can prevent many stacks of useless blocks like cobble stone.

And make useless hundreds of entities lying on the ground and causing lags.

PostPosted: Sun Apr 01, 2012 19:34
by JoseMing
lkjoel wrote:Very simple patch (for now). The speed of dropping is so slow, and you cannot walk over it to pick it up, but it works.
Patch builtin.lua with this:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
348c348,349
<                       digger:get_inventory():add_item("main", dropped_item)
---
>                       -- digger:get_inventory():add_item("main", dropped_item)
>                       minetest.item_drop(dropped_item, digger, pos)

how you put that?

PostPosted: Mon Apr 02, 2012 02:33
by lkjoel
Actually, I do NOT use this, and the walking over to pick up is hard for me (I'm working on the modding app, so I'm probably not going to do this). Anyways, to patch it, you can either use the patch utility, or you can just look for lines 348 and 349, and replace what is shown (< is to delete, and > is to add). The line numbers might differ slightly, but it should be around that.

PostPosted: Mon Apr 02, 2012 02:41
by lkjoel
btw, I was talking about patching builtin.lua (minetestdatadir/builtin/builtin.lua), just in case you didn't know which file to patch ;)

PostPosted: Mon Apr 02, 2012 16:02
by lkjoel
Actually, ignore what I said about not being able to finish it. Thanks celeron55 for this: https://github.com/celeron55/minetest/commit/f0e7da8a63d858f3b511872cf41cde0eaff6585d

PostPosted: Mon Apr 02, 2012 16:04
by Death Dealer
how exactly do i use this stuff?

PostPosted: Mon Apr 02, 2012 16:44
by Calinou
You'll have to compile the git version, or wait for the next windows version if you can't compile it.

PostPosted: Mon Apr 02, 2012 16:50
by Death Dealer
Calinou wrote:You'll have to compile the git version, or wait for the next windows version if you can't compile it.

ok thanks.