[Mod] Inventory Tweaks [2.0.1] [beta] [invtweak]
[Mod] Inventory Tweaks [2.0.1] [beta] [invtweak]
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)
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.
-
- Member
- Posts: 4534
- Joined: Mon Oct 03, 2011 17:58
- GitHub: Jordach
- IRC: Jordach
- In-game: Jordach
- Location: Blender Scene
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.
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.
Auto-refill would fit more in the "build" game, but I agree.Calinou wrote:I like it. This should be in the default game.
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).
See also the MT-Faithful texture pack (work in progress).
The first 22 lines.Mito551 wrote:what part of the code does the auto-refill?
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).
See also the MT-Faithful texture pack (work in progress).
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
1X coding
3X debugging
12X tweaking to be just right
Could you say me which tools that are? And the auto-refill should work for any stack, no matter what it contains.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
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
Prevent the game from crashing when there is no digger/placer/puncher:
btw.: Nice mod. Tried to code the auto refill some time ago but failed. And your solution is more simple than I expected.
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)
Last edited by Casimir on Sun Apr 21, 2013 16:55, edited 1 time in total.
Thanks, but where is the change in my code? And i tried that, there was no crash. Did you had one?Casimir wrote:Prevent the game from crashing when there is no digger/placer/puncher:btw.: Nice mod. Tried to code the auto refill some time ago but failed. And your solution is more simple than I expected.Code: Select all
#code
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
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.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.
-
- Member
- Posts: 160
- Joined: Tue Sep 18, 2012 22:11
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.
- Casimir
- Member
- Posts: 1207
- Joined: Fri Aug 03, 2012 16:59
- GitHub: CasimirKaPazi
- Mossmanikin
- Member
- Posts: 599
- Joined: Sun May 19, 2013 16:26
- Location: where we don't speak english.
Both. Auto-refill = feature, sound = bugMossmanikin 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?
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/co ... 3e9cb5409d
Last edited by BlockMen on Fri Jul 26, 2013 13:07, edited 1 time in total.
- onpon4
- Member
- Posts: 518
- Joined: Thu Mar 21, 2013 01:54
- GitHub: onpon4
- In-game: diligentcircle
- Contact:
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.)
(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.
My website: https://onpon4.github.io
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.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.)
Who is online
Users browsing this forum: No registered users and 11 guests