muhdnurhidayat wrote:This mod is now on Minetest wiki, if you feel something needs to be updated, edited or added in the wiki, feel free to edit it... (^-^) http://wiki.minetest.net/Mods/Storage_Drawers
GamingAssociation39 wrote:Is it possible 4 someone to create the drawer controller for the storage mod?
I think that a drawer controller would do more harm than good seeing as the same functions can already be done simply with pipeworks. Also it would take a long time to create a functioning drawer controller time that could be spent to say make more upgrades like a void upgrade or duct tape to move the drawers
while yes it probably would be possible for somebody to create a drawer controller which functions like the Minecraft drawers mod drawer controller it would be very difficult and time-consuming
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.
GamingAssociation39 wrote:Is it possible 4 someone to create the drawer controller for the storage mod?
I think that a drawer controller would do more harm than good seeing as the same functions can already be done simply with pipeworks. Also it would take a long time to create a functioning drawer controller time that could be spent to say make more upgrades like a void upgrade or duct tape to move the drawers
while yes it probably would be possible for somebody to create a drawer controller which functions like the Minecraft drawers mod drawer controller it would be very difficult and time-consuming
take all that back just found this mod which is a controller for chests viewtopic.php?f=9&t=18429
if all licenses are followed right you might be able to turn this into a functioning drawer controller
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.
I know how to make this hopper compatible!
add a formspec to the draws and put 1 slot called input
any item in the input slot will be placed in the draw if it can and if it cant then something else happens
then make the formspec hopper compatible using the api
The great quest of alchemy neither failed nor attained gold; programmers are those great alchemists who transmute caffeine into code.
I gave my best effort to create a drawer controller. It's currently merged in the latest development build on GitHub, however, more changes might be made. If you find bugs or errors please report them.
The controller can deposit items in drawers that are adjacent to it. Currently the width and height is set to 8. That means you could put a controller down, place 8 drawers outwards from the 4 sides of the controller and then expand those rows to be 8 drawers tall allowing for 64 drawers on each side. Drawers below the y level of the controller and directly above the controller are not included. If a horizontal row of drawers has a block that isn't a drawer, it doesn't check for any more drawers on that row. The drawers have to be touching each other. If a row starts with a block that isn't a drawer, it doesn't check for any more drawers on that side of the controller.
The controller has 1 inventory slot and will attempt to deposit the entire stack of items in that slot every 7 seconds. If an item couldn't be deposited the controller changes to a jammed state to signify it couldn't deposit the item. You can see the controller state in the upper left of the controller formspec. It also keeps a tally for the number of consecutive attempts that depositing the same item has failed. If the tally reaches 8, the controller switches to a stopped state. When the controller is stopped, it no longer attempt to deposit the jammed item. Items that are only stackable by 1, such as tools, can't be deposited in drawers causing the controller to go in to a stopped state as well. Removing the jammed item or changing the item with a different one will clear the stopped and jammed states and the tally goes back to 0. This is mostly a safety feature to ensure that the controller will not indefinitely keep indexing all of the drawers to find a spot for a jammed item. If there isn't room for an item after 8 attempts at depositing it spread across 7 second intervals, chances are there isn't going to be space until the player either adds more drawers or makes space for the item.
Performance wise, the controller didn't appear to make an impact on CPU usage on my computer. The part that requires the most work is when the controller has to re-index all of the drawers. This occurs due to the item it is attempting to deposit not already existing in a drawer or it does exist but the drawer is full. I expect most people will build a wall of drawers, fill it with items, and continue depositing those same items in to the controller. In that case, the controller doesn't need to re-index the drawers. If the controller is empty (no item to deposit) it does nothing.
The controller can have items deposited in to it from pipeworks. It shouldn't be hard to make it work with other mods, such as hoppers, if you don't use pipeworks. You will need to do that yourself though.
isaiah658 wrote:I gave my best effort to create a drawer controller. It's currently merged in the latest development build on GitHub, however, more changes might be made. If you find bugs or errors please report them.
The controller can deposit items in drawers that are adjacent to it. Currently the width and height is set to 8. That means you could put a controller down, place 8 drawers outwards from the 4 sides of the controller and then expand those rows to be 8 drawers tall allowing for 64 drawers on each side. Drawers below the y level of the controller and directly above the controller are not included. If a horizontal row of drawers has a block that isn't a drawer, it doesn't check for any more drawers on that row. The drawers have to be touching each other. If a row starts with a block that isn't a drawer, it doesn't check for any more drawers on that side of the controller.
The controller has 1 inventory slot and will attempt to deposit the entire stack of items in that slot every 7 seconds. If an item couldn't be deposited the controller changes to a jammed state to signify it couldn't deposit the item. You can see the controller state in the upper left of the controller formspec. It also keeps a tally for the number of consecutive attempts that depositing the same item has failed. If the tally reaches 8, the controller switches to a stopped state. When the controller is stopped, it no longer attempt to deposit the jammed item. Items that are only stackable by 1, such as tools, can't be deposited in drawers causing the controller to go in to a stopped state as well. Removing the jammed item or changing the item with a different one will clear the stopped and jammed states and the tally goes back to 0. This is mostly a safety feature to ensure that the controller will not indefinitely keep indexing all of the drawers to find a spot for a jammed item. If there isn't room for an item after 8 attempts at depositing it spread across 7 second intervals, chances are there isn't going to be space until the player either adds more drawers or makes space for the item.
Performance wise, the controller didn't appear to make an impact on CPU usage on my computer. The part that requires the most work is when the controller has to re-index all of the drawers. This occurs due to the item it is attempting to deposit not already existing in a drawer or it does exist but the drawer is full. I expect most people will build a wall of drawers, fill it with items, and continue depositing those same items in to the controller. In that case, the controller doesn't need to re-index the drawers. If the controller is empty (no item to deposit) it does nothing.
The controller can have items deposited in to it from pipeworks. It shouldn't be hard to make it work with other mods, such as hoppers, if you don't use pipeworks. You will need to do that yourself though.
Just one thing, instead of doing that every 7 seconds, you could also just always sort the items when a stack is inserted into the controller or a stack arrives via. pipeworks. That would avoid the timer.
Just one thing, instead of doing that every 7 seconds, you could also just always sort the items when a stack is inserted into the controller or a stack arrives via. pipeworks. That would avoid the timer.
I wasn't sure how well performance wise it would be to allow that. If you set up a bunch of empty drawers and feed it items fast, it has to re-index all those drawers to ensure there isn't already a spot for that item before putting it in an empty drawer. There would also need to be a cool-down for items that didn't go in the last time it ran. Maybe I'm being overly cautious about it.
In current dev version, when opening jungle drawer (simplest):
2018-09-09 03:03:27: ERROR[Main]: generateImage(): Could not load image "gui_formbg.png" while building texture; Creating a dummy imag
Edit:
Ok, can fixed with editing file "init.lua", changing line 61 that begins with "drawers.gui_bg_img" to: drawers.gui_bg_img = "background[5,5;1,1;crafting_creative_bg.png;true]"
Also, can confirm if drawer is punched by hand - it disappears with its contents. This bug was reported on github and is unfixed.
minerdudetest wrote:In current dev version, when opening jungle drawer (simplest):
2018-09-09 03:03:27: ERROR[Main]: generateImage(): Could not load image "gui_formbg.png" while building texture; Creating a dummy imag
Edit:
Ok, can fixed with editing file "init.lua", changing line 61 that begins with "drawers.gui_bg_img" to: drawers.gui_bg_img = "background[5,5;1,1;crafting_creative_bg.png;true]"
Also, can confirm if drawer is punched by hand - it disappears with its contents. This bug was reported on github and is unfixed.
The texture bug should be fixed now. When you have found a solution for the second bug, please share. [I'm not actively developing and have other projects.] :)
2019-05-02 22:26:38: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod '' in callback luaentity_Step(): Runtime error from mod '' in callback luaentity_Punch(): C:\test\bin\..\games\twt\mods\drawers/lua/visual.lua:187: attempt to index local 'inv' (a nil val 2019-05-02 22:26:38: ERROR[Main]: ue) 2019-05-02 22:26:38: ERROR[Main]: stack traceback: 2019-05-02 22:26:38: ERROR[Main]: C:\test\bin\..\games\twt\mods\drawers/lua/visual.lua:187: in function <C:\test\bin\..\games\twt\mods\drawers/lua/visual.lua:171> 2019-05-02 22:26:38: ERROR[Main]: [C]: in function 'punch'
A players arrows using the throwing mod are able to take items from drawer without crash
Server Owner trainwrecktony.serveminecraft.net:30000 irc.freenode.net ##minetest-trainwrecktony
I created a pull request that will fix the MCL2 formspec issue and potentially fix the archer arrows (and other non player entities) from crashing the game by punching the drawers. I could not test the punching drawers bug though as I couldn't get the archers to attack anything. They seemed broken.
If LNJ is ok with the changes, they should get merged sometime soon.
Edit: Also for anyone only reading the forum posts, the Mineclone 2 drawer punching disappearing bug has been fixed for awhile now. Just thought I would mention it otherwise people might think it's still broken. If it's not fixed, please let me know.
Edit #2: LNJ is incredibly fast and already merged the changes! Walker and trainwrecktony, please download the latest Github version and report any issues if you find anything.
Ahh yeah I know what it is. MCL2 uses different node groups than what default does. I've fixed it in the past for the drawers themselves but forgot to add the same thing to the drawer controller.
Edit: Nevermind. LNJ2 merged the changes already. You know the drill. Download it again and report any problems.
Edit #2: Also the controller has the same groups as cobble, so you'll need a pick to break it and get the item. I think the controller needs to be empty as well. No items in it.
isaiah658 wrote:Edit #2: Also the controller has the same groups as cobble, so you'll need a pick to break it and get the item. I think the controller needs to be empty as well. No items in it.
The drawer doesn't need to be empty, the items will be dropped.