Page 1 of 1

[Mod] Wrench [wrench]

Posted: Wed Jul 31, 2013 03:37
by ashenk69
This is a cool wrench that is unlike any other. Instead of having to tediously move items from multiple inventories to move a chest to a new spot, you can now use the wrench to pickup the chest and then place it where you want. The items will automatically be added from the original chest.

Depends: default
License: WTFPL
github

Craft
O = iron ingot
[O][ ][O]
[ ][O][ ]
[ ][O][ ]

This is something that I hope would get merged into the Technic mod because it has a lot of potential to be useful within that modpack. It works with chest, furnaces, and active furnaces. The fuel amount is not stored but all items in each list are perserved.

Interested in how it works?
It first converts inventories into strings. This string is then saved to the itemstack's metadata. The itemstack is just a holder item for the information so each supported node in the system has a duplicate holder item. Once the item is placed in the world it then converts the string from the item back in to a table and sets the tables to the corresponding list.

Posted: Wed Jul 31, 2013 03:55
by Chinchow
This Mod is Simply Awesome

Posted: Wed Jul 31, 2013 06:12
by RealBadAngel
ashenk69 wrote:This is a cool wrench that is unlike any other. Instead of having to tediously move items from multiple inventories to move a chest to a new spot, you can now use the wrench to pickup the chest and then place it where you want. The items will automatically be added from the original chest.

Depends: default
License: WTFPL
github

Craft
O = iron ingot
[O][ ][O]
[ ][O][ ]
[ ][O][ ]

This is something that I hope would get merged into the Technic mod because it has a lot of potential to be useful within that modpack. It works with chest, furnaces, and active furnaces. The fuel amount is not stored but all items in each list are perserved.

Interested in how it works?
It first converts inventories into strings. This string is then saved to the itemstack's metadata. The itemstack is just a holder item for the information so each supported node in the system has a duplicate holder item. Once the item is placed in the world it then converts the string from the item back in to a table and sets the tables to the corresponding list.
Just pull the commit to Technic repo :)

Posted: Wed Jul 31, 2013 12:04
by Evergreen
YES!

Posted: Wed Jul 31, 2013 13:35
by ashenk69
RealBadAngel wrote:Just pull the commit to Technic repo :)
I want to make it more compatible with Technic before I do a pull and also test it with Technic to make sure there aren't any weird errors.

Posted: Wed Jul 31, 2013 13:51
by Nore
A suggestion: save node metadata as well, so it will save furnace state, infotexts of technic chests (and you could also use it for signs). Moreover, you should save item metadata (sorry if you already do it, but I didn't saw it while looking at the code). And why do you check if placer is player?

Posted: Wed Jul 31, 2013 15:01
by ashenk69
Nore wrote:A suggestion: save node metadata as well, so it will save furnace state, infotexts of technic chests (and you could also use it for signs). Moreover, you should save item metadata (sorry if you already do it, but I didn't saw it while looking at the code). And why do you check if placer is player?
Item data is how I do all of the storing so you are correct in using that. If you mean storing itemdata and wear from items within the chest than it already does that as well. When you convert the itemstack to a string, everything else is converted along with it. This actually creates a cool system in which you can store chests containing chests inside of chests. Chestception forever!!!

Posted: Wed Jul 31, 2013 15:44
by Chinchow
So with this my house only needs one chest with all my other chests inside?
Easy Storage

Posted: Wed Jul 31, 2013 16:14
by Nore
ashenk69 wrote:
Nore wrote:A suggestion: save node metadata as well, so it will save furnace state, infotexts of technic chests (and you could also use it for signs). Moreover, you should save item metadata (sorry if you already do it, but I didn't saw it while looking at the code). And why do you check if placer is player?
Item data is how I do all of the storing so you are correct in using that. If you mean storing itemdata and wear from items within the chest than it already does that as well. When you convert the itemstack to a string, everything else is converted along with it. This actually creates a cool system in which you can store chests containing chests inside of chests. Chestception forever!!!
I like it... (and this was the purpose of my question). Will you add metadate storing, and if so, will you add signs, and others? I reckon you need to add it before merging in technic because of the chests infotexts. And what is the check for placer = player for?

Posted: Wed Jul 31, 2013 17:01
by LionsDen
Nore wrote:[And what is the check for placer = player for?
My guess would be so that you couldn't steal some other players items.

Posted: Wed Jul 31, 2013 18:12
by ashenk69
placer = player is a check that I have learned to put in whenever you use a method that gives you access to the player. That way if the player ends up to be nil because it is placed by code instead, it won't throw an error because that case is handled. I probably could remove the checks at some places but it is a very small amount of bloated code that could prevent an unexpected crash.

Posted: Wed Jul 31, 2013 18:14
by ashenk69
I didn't think of doing metadata storage but it is something I think could be added fairly easy. It just requires a little more string manipulation.

Posted: Wed Jul 31, 2013 19:27
by Casimir
Uhm... how to use it?

Posted: Wed Jul 31, 2013 22:59
by ashenk69
Casimir wrote:Uhm... how to use it?
With the wrench equipped, right click on a chest, and you'll now have a chest with the inventory perserved. You'll have to also sneak so you don't activate the chest's formspec but i see it as a safety measure so you don't acidentally dig it up.

Posted: Wed Jul 31, 2013 23:02
by ashenk69
If you can't see the default chest or furnace that is because of a little issue that i figured out. I'm just not at my computer to commit it right now. You can still use the giveme command to get one.

Posted: Thu Aug 01, 2013 00:42
by ashenk69
Fixed a bunch of issues. Items are not hidden anymore in creative mode. Added support for Technic mod. Added node metadata storage. Inventory and metadata is added .5 seconds after a node is added to make sure the info is transferred.

Posted: Fri Aug 02, 2013 16:17
by Mito551
not iron ingot, but iron lumps...

Posted: Fri Aug 02, 2013 17:59
by ashenk69
Mito551 wrote:not iron ingot, but iron lumps...
For some reason I thought I had put steel ingots not iron lumps. Fixed it.

Posted: Fri Aug 02, 2013 18:02
by Mito551
ashenk69 wrote:
Mito551 wrote:not iron ingot, but iron lumps...
For some reason I thought I had put steel ingots not iron lumps. Fixed it.
oke, i'm gonna go now and fix it in dwarves version... for iron ingots

Posted: Sat Aug 03, 2013 01:51
by Evergreen
I just tested this, and this is the best thing since sliced bread. Great job. :D

Posted: Sat Aug 03, 2013 02:32
by ashenk69
Evergreen wrote:I just tested this, and this is the best thing since sliced bread. Great job. :D
You should try it in the stable version of technic. It works with most of the machines.