[Mod] Wrench [wrench]

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

[Mod] Wrench [wrench]

by ashenk69 » Wed Jul 31, 2013 03:37

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.
 

User avatar
Chinchow
Member
 
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Wed Jul 31, 2013 03:55

This Mod is Simply Awesome
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

User avatar
RealBadAngel
Member
 
Posts: 556
Joined: Wed Jul 18, 2012 16:30

by RealBadAngel » Wed Jul 31, 2013 06:12

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 :)
 

User avatar
Evergreen
Member
 
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
Location: A forest in the midwest
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Wed Jul 31, 2013 12:04

YES!
Back from the dead!
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Wed Jul 31, 2013 13:35

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.
 

Nore
Developer
 
Posts: 498
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Wed Jul 31, 2013 13:51

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?
Last edited by Nore on Wed Jul 31, 2013 13:52, edited 1 time in total.
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Wed Jul 31, 2013 15:01

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!!!
 

User avatar
Chinchow
Member
 
Posts: 684
Joined: Tue Sep 18, 2012 21:37

by Chinchow » Wed Jul 31, 2013 15:44

So with this my house only needs one chest with all my other chests inside?
Easy Storage
Sometimes, it's harder to think up a mod than it is to create it.
Mods: Orichalcum Stonebricks Extra Chests
 

Nore
Developer
 
Posts: 498
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Wed Jul 31, 2013 16:14

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?
 

User avatar
LionsDen
Member
 
Posts: 530
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Wed Jul 31, 2013 17:01

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.
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Wed Jul 31, 2013 18:12

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.
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Wed Jul 31, 2013 18:14

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.
 

User avatar
Casimir
Member
 
Posts: 1154
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Wed Jul 31, 2013 22:59

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.
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Wed Jul 31, 2013 23:02

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.
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Thu Aug 01, 2013 00:42

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.
 

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

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Fri Aug 02, 2013 17:59

Mito551 wrote:not iron ingot, but iron lumps...

For some reason I thought I had put steel ingots not iron lumps. Fixed it.
 

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

by Mito551 » Fri Aug 02, 2013 18:02

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
 

User avatar
Evergreen
Member
 
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
Location: A forest in the midwest
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat Aug 03, 2013 01:51

I just tested this, and this is the best thing since sliced bread. Great job. :D
Back from the dead!
 

ashenk69
Member
 
Posts: 230
Joined: Tue Jul 03, 2012 00:08

by ashenk69 » Sat Aug 03, 2013 02:32

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.
 


Return to WIP Mods



Who is online

Users browsing this forum: davidthecreator, texmex and 3 guests