[Mod] Inventory Tweaks [2.0.1] [beta] [invtweak]

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

[Mod] Inventory Tweaks [2.0.1] [beta] [invtweak]

by BlockMen » Sun Apr 21, 2013 11:57

Hello everyone,

this mod adds some improvements to the players inventory.

Main feature: This mod adds 3 different buttons to player inventory. With those buttons you can sort your inventory easily.
"›•"-Button concernates all stacks to their maximum size.
"^"-Button sorts all items in an ascending order
"v"-Button sorts all items in an descending order

See demonstration video here: https://www.youtube.com/watch?v=PeOXqyP6h7o

Note: It's currently only working for the player inventory, not for chests or other formspecs.


Furthermore this mod has the ability to refill your wielded items automaticly. For example your current tool breaks and you have one more of the same type (e.g. a stone pickaxe) this mod puts it right in you hand and you can keep digging our placing nodes without opening the inventory.
You can disable this setting by adding/changing following to your minetest.conf file: "invtweak_autorefill = false"

As a small gimmick it adds also a sound when a tool breaks, just to improve the atmosphere of the gameplay. :)

Currently supported mods:
- unified_inventory
- 3d_armor

Notice:
This mod is in beta state, please report any issues you notice.

Download:
Version 2.0.1 beta: Download (tested on 0.4.12, should work on 0.4.10 or newer)
Source code: Github

Depends:
default
unified_inventory (optional)
3d_armor (optional)


License:
- source code: WTFPL
- sound by EdgardEdition (CC-BY-3.0)
Last edited by BlockMen on Thu Jul 16, 2015 21:13, edited 4 times in total.
 

User avatar
Jordach
Member
 
Posts: 4412
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach

by Jordach » Sun Apr 21, 2013 12:16

Okay. Breaking sound is a really good idea as I usually count down the uses before the tool breaks, so that's one thing I don't have todo anymore.

Secondly, I've used Tekkit before and the automatic refill in there is useful, provided you have the items to "fake" refill the stack.

In a nutshell, this mod makes life much, much easier for me, don't know about you.

( ͡° ͜ʖ ͡°) ( ͡o ͜ʖ ͡o) [$ ( ͡° ͜ʖ ͡°) $] ( ͡$ ͜ʖ ͡$) ヽ༼ຈل͜ຈ༽ノ



My image and media server is back online and is functioning as normal.
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Sun Apr 21, 2013 12:19

I like it. This should be in the default game. :D
 

User avatar
Zeg9
Member
 
Posts: 608
Joined: Fri Sep 21, 2012 11:02

by Zeg9 » Sun Apr 21, 2013 12:23

Calinou wrote:I like it. This should be in the default game. :D

Auto-refill would fit more in the "build" game, but I agree.

By the way, nice mod.
Last edited by Zeg9 on Sun Apr 21, 2013 12:25, edited 1 time in total.
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03

by Mito551 » Sun Apr 21, 2013 12:37

what part of the code does the auto-refill?
 

User avatar
Zeg9
Member
 
Posts: 608
Joined: Fri Sep 21, 2012 11:02

by Zeg9 » Sun Apr 21, 2013 12:57

Mito551 wrote:what part of the code does the auto-refill?

The first 22 lines.
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sun Apr 21, 2013 13:08

I have accidentally ziped und uploaded the wrong files. Please download again, if you want sound. Thanks
 

User avatar
cHyper
Member
 
Posts: 587
Joined: Fri May 06, 2011 08:49
IRC: cHyper
In-game: cHyper

by cHyper » Sun Apr 21, 2013 15:41

awesome tweak tool for minetest...
--------------------------------------------------------
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Sun Apr 21, 2013 16:31

could you make this work for all tools like if an item has minetest.register_tool then the things happen. In minitest there are 2 tools that dont do this. Also maybe adding an optional group would be nice if you have set some node/craftitems to do something like a tool
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sun Apr 21, 2013 16:35

jojoa1997 wrote:could you make this work for all tools like if an item has minetest.register_tool then the things happen. In minitest there are 2 tools that dont do this. Also maybe adding an optional group would be nice if you have set some node/craftitems to do something like a tool


Could you say me which tools that are? And the auto-refill should work for any stack, no matter what it contains.
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Sun Apr 21, 2013 16:52

Prevent the game from crashing when there is no digger/placer/puncher:
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
local auto_refill = true  -- set to false if you dont want get refilled your stack automatic

function refill(player, stck_name, index)
    local inv = player:get_inventory()
    for i,stack in ipairs(inv:get_list("main")) do
        if stack:get_name() == stck_name then
            inv:set_stack("main", index, stack)
            stack:clear()
            inv:set_stack("main", i, stack)
            return
        end
    end
end

if auto_refill == true then
    minetest.register_on_placenode(function(pos, newnode, placer, oldnode)
        if not placer then return end
        local index = placer:get_wield_index()
        local cnt = placer:get_wielded_item():get_count()-1
        if cnt == 0 then minetest.after(0.01, refill, placer, newnode.name, index) end
    end)
end


local tname = ""
minetest.register_on_punchnode(function(pos, node, puncher)
    if not puncher then return end
    if puncher:get_wielded_item():get_wear() ~= 0 then
        tname = puncher:get_wielded_item():get_name()
    else
        tname = ""
    end
end)

minetest.register_on_dignode(function(pos, oldnode, digger)
        if not digger then return end
        local num = digger:get_wielded_item():get_wear()
        local index = digger:get_wield_index()
        if num == 0 and tname ~= "" then
            minetest.sound_play("intweak_tool_break", {gain = 1.5, max_hear_distance = 5})
            if auto_refill == true then minetest.after(0.01, refill, digger, tname, index) end
        end
end)

btw.: Nice mod. Tried to code the auto refill some time ago but failed. And your solution is more simple than I expected.
Last edited by Casimir on Sun Apr 21, 2013 16:55, edited 1 time in total.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sun Apr 21, 2013 17:24

Casimir wrote:Prevent the game from crashing when there is no digger/placer/puncher:
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
#code

btw.: Nice mod. Tried to code the auto refill some time ago but failed. And your solution is more simple than I expected.


Thanks, but where is the change in my code? And i tried that, there was no crash. Did you had one?
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Sun Apr 21, 2013 17:55

Lines 17, 27, 36. Is a rare bug caused by certain mods that use place_node without a placer, or dig_node without a digger.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sun Apr 21, 2013 18:10

Casimir wrote:Lines 17, 27, 36. Is a rare bug caused by certain mods that use place_node without a placer, or dig_node without a digger.


Ok, thx. I think i will add this, but im not convinced that it is neccesary. I have tested with minetest.env:dig_node(), place_node(), and punch_node() (all have no placer) and it does have no effect. No error, no crash, nothing.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Thu Apr 25, 2013 20:53

Update: Version 1.1

Changelog:
- Added Casimir's crash prevention

- supports now also costum tools, that don't digg nodes

Notice: Inventory Tweaks works always for the default tools. The support of costum tools brings no interference for usage.
 

Iqualfragile
Member
 
Posts: 160
Joined: Tue Sep 18, 2012 22:11

by Iqualfragile » Sat Apr 27, 2013 09:23

please upload this mod into a repository ( https://bitbucket.org )
Gr8 b8, m8. I rel8, str8 appreci8, and congratul8. I r8 this b8 an 8/8. Plz no h8, I'm str8 ir8. Cr8 more, can't w8. We should convers8, I won't ber8, my number is 8888888, ask for N8. No calls l8 or out of st8. If on a d8, ask K8 to loc8. Even with a full pl8, I always have time to communic8 so don't hesit8.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Thu May 16, 2013 14:21

Update: Version 1.2

Changelog:
- Fixed sound-bug in multiplayer
- Fixed bug in creative mode
- full Multiplayer support
- improved support for costum tools
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Sun Jul 21, 2013 15:31

I noticed a bug: when you have a unused tool and use it on something it is not made for it breaks instantly. E.g. dig dirt with a brand new pickaxe.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Wed Jul 24, 2013 10:22

Casimir wrote:I noticed a bug: when you have a unused tool and use it on something it is not made for it breaks instantly. E.g. dig dirt with a brand new pickaxe.


Thanks for feedback.

Survival or creative mode? Because i noticed that issue in creative already but had no time to update yet.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Thu Jul 25, 2013 19:40

Version 1.2.1 released

Changelog:
- fix instant break of unused tools in creative mode
 

User avatar
Mossmanikin
Member
 
Posts: 599
Joined: Sun May 19, 2013 16:26

by Mossmanikin » Thu Jul 25, 2013 23:38

Very cool this mod. Minetest has far too less sounds and the auto-refilling is very handy.

Both features seem not to work in creative mode for me (stable 0.4.7, no other mods).
Don't know if it's a bug or a feature, but who needs anything but building blocks in creative mode anyway?

Noob 4 life!
My stuff
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Fri Jul 26, 2013 12:23

Mossmanikin wrote:Very cool this mod. Minetest has far too less sounds and the auto-refilling is very handy.

Both features seem not to work in creative mode for me (stable 0.4.7, no other mods).
Don't know if it's a bug or a feature, but who needs anything but building blocks in creative mode anyway?


Both. Auto-refill = feature, sound = bug :P

I will check that, thx.

EDIT: This bug (and its fix in 1.2.1) is only occuring in dev-versions of Minetest. So if you are using Minetest 0.4.7 stable, then stay at Version 1.2 of this mod.

Caused is this bug by this commit -> https://github.com/minetest/minetest/commit/90b095aa54b5a96b1100966adc0f083e9cb5409d
Last edited by BlockMen on Fri Jul 26, 2013 13:07, edited 1 time in total.
 

User avatar
onpon4
Member
 
Posts: 517
Joined: Thu Mar 21, 2013 01:54

by onpon4 » Fri Oct 04, 2013 17:23

I find it really annoying that this instantly breaks many tools when you use them on the wrong thing. I was annoyed when I lost a perfectly good diamond sword because I was wielding it while I picked up a torch, and I've lost a compass from another mod more than once because of it.

(It's not whatever bug you fixed in 1.2.1. This is version 0.4.7 without creative mode.)
Last edited by onpon4 on Fri Oct 04, 2013 17:24, edited 1 time in total.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sun Oct 06, 2013 11:38

onpon4 wrote:I find it really annoying that this instantly breaks many tools when you use them on the wrong thing. I was annoyed when I lost a perfectly good diamond sword because I was wielding it while I picked up a torch, and I've lost a compass from another mod more than once because of it.

(It's not whatever bug you fixed in 1.2.1. This is version 0.4.7 without creative mode.)


Thanks for reporting that bug. I will fix that as soon as possible, but it seems i have to rewrite the mod for that, so it could take a while.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Mon Oct 21, 2013 23:02

Update: Version 1.2.2

Changelog:
- Fixed instantly break of unused tools when digging wrong block
- lowered volume of break sound a bit

Version 1.2 (for Minetest 0.4.7 stable) is also fixed
 

User avatar
Johnyknowhow
Member
 
Posts: 358
Joined: Fri Sep 21, 2012 15:17
In-game: Minetestian

by Johnyknowhow » Sun Nov 17, 2013 23:06

cool, i iz gettin it,
I lost interest in Minetest for a couple of years and... I am still not really paying much attention. I rarely browse these forums anymore but it's nice to see old faces.

obligatory fancy signature goes here
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33

by hoodedice » Mon Nov 18, 2013 04:34

BlockMen: IT IS CUSTOM, NOT COSTUM, DAMMIT XD
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 

User avatar
Johnyknowhow
Member
 
Posts: 358
Joined: Fri Sep 21, 2012 15:17
In-game: Minetestian

by Johnyknowhow » Thu Nov 21, 2013 22:00

i dont like the sound, it freaked me out, so i used the minecraft sound,
I lost interest in Minetest for a couple of years and... I am still not really paying much attention. I rarely browse these forums anymore but it's nice to see old faces.

obligatory fancy signature goes here
 

User avatar
Linxx
Member
 
Posts: 401
Joined: Wed May 16, 2012 00:37

by Linxx » Wed Apr 09, 2014 12:12

does this mod work for current version?
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

by Casimir » Wed Apr 09, 2014 13:00

Yes. Using it with both 0.4.9 and the latest git works. The only bug I know of happens when using unknown items.
Last edited by Casimir on Wed Apr 09, 2014 13:00, edited 1 time in total.
 

Next

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 62 guests

cron