[Mod] Item shelf [itemshelf]

zorman2000
Member
Posts: 84
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

[Mod] Item shelf [itemshelf]

by zorman2000 » Post

Description:
The item shelf mod is a simple mod that adds to shelves that can hold up to 4 or 6 items. This small limitation is due to the fact that shelves show the items they are holding using entities. The entities are purely static and consume 0 CPU (like the ones in itemframes for example), but still the limitation is to avoid lag.

There are no crafting recipes at the moment. To get an item shelf, play on creative or use:

Code: Select all

/giveme itemshelf:small_shelf
or

Code: Select all

/giveme itemshelf:large_shelf
Both shelves are of the same size, however they can hold 4 or 6 items respectively.

Screenshot:
Image

Developers API:
Developers using this mod can register a particular node to use the item shelf functionality. To do that, the following function is used:

Code: Select all

itemshelf.register_shelf(name, def)
See more here: https://github.com/hkzorman/itemshelf/b ... /readme.md

License:
MIT

Dependencies:
  • default
Download:
Download here: https://github.com/hkzorman/itemshelf/a ... master.zip
Or, browse the code here: https://github.com/hkzorman/itemshelf
Attachments
screenshot_20180119_101009.png
screenshot_20180119_101009.png (274.53 KiB) Viewed 1454 times

User avatar
Lone_Wolf
Member
Posts: 2577
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [Mod] Item shelf [itemshelf]

by Lone_Wolf » Post

Nice idea. Great work!
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

Yep, I want!
Check out my Mods: BBQ Mod Crops Plus

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: [Mod] Item shelf [itemshelf]

by TumeniNodes » Post

Haven't even tried it yet and I already like it!
The visual alone is appealing
A Wonderful World

User avatar
the_raven_262
Member
Posts: 343
Joined: Mon Sep 22, 2014 09:30
GitHub: theraven262
IRC: [Discord unfortunately] corvus262

Re: [Mod] Item shelf [itemshelf]

by the_raven_262 » Post

I never knew that I needed something like this. Nice work!

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: [Mod] Item shelf [itemshelf]

by ShadMOrdre » Post

zorman,

Love the AdvancedNPCs and the gramaphone. This one will get some love too, I'm sure.

However, let's talk context. AdvancedNPCs cannot navigate formspecs. They have to eyes, ears, mouth or mouse. And navigating formspecs really deadens a world anyway.

Anyway you can implement this fine mod without the formspecs? Same for the gramaphone, since your already more than half way there. This way, NPCs only need rudimentary knowledge of a given mechanism. Put record on gramaphone, punch to start. Put item on shelf, and well, no formspeccythingymerbober.

Take a peak at my lib_tools, for where I'm going with this. Look especially at the anvil, not my creation, and the altar of enchantment, totally my creation, with some help from xdecor.enchanting table and aforementioned anvil.

I'm looking to bring interactive life to the worlds I create, versus just more formspec based stuff, which IMHO, takes away from both the gameplay and immersion.

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Item shelf [itemshelf]

by azekill_DIABLO » Post

wow, i thought i was impossible!!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

What about half deep shelves? I started messing with it but the items were in front of the cabinet instead of within.
Check out my Mods: BBQ Mod Crops Plus

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Item shelf [itemshelf]

by Sokomine » Post

Where can those shelves be ordered? My houses need some. An open version without the back side and with slightly smaller sides might also look great.
ShadMOrdre wrote: However, let's talk context. AdvancedNPCs cannot navigate formspecs. They have to eyes, ears, mouth or mouse. And navigating formspecs really deadens a world anyway.
It's just some other inventory for them - like chests. No problem there :-) Learning to punch and right-click items is also something they're not exactly born with (they need context). To avoid formspecs is just your personal preference. It has some appeal, but...it is not useful for all situations.
A list of my mods can be found here.

hajo
Member
Posts: 606
Joined: Thu Oct 13, 2016 10:45
Location: DE
Contact:

Re: [Mod] Item shelf [itemshelf]

by hajo » Post

zorman2000 wrote:shelves that can hold up to 4 or 6 items .. show the items they are holding
Less packing density, but much more decorative and homely :)
There are no crafting recipes at the moment.
How about a recipe like for a chest, but with glass instead of steel ?

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Item shelf [itemshelf]

by azekill_DIABLO » Post

good craft idea!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

Any idea why items don't rotate to match the itemshelf?

Image
Attachments
Screenshot from 2018-02-03 21-11-17.png
Screenshot from 2018-02-03 21-11-17.png (339.61 KiB) Viewed 1454 times
Check out my Mods: BBQ Mod Crops Plus

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: [Mod] Item shelf [itemshelf]

by TumeniNodes » Post

I believe you need to add

Code: Select all

paramtype2 = "facedir",
A Wonderful World

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

I don't think it's that simple. If it is, I am completely missing it. I am pretty sure its in the api.

I was thinking it was in these three lines, if I am interpreting them right it looks like they are trying to figure out which direct the shelf is facing and setting the item on it to match.

Code: Select all

	local node = minetest.get_node(pos)
	local node_dir = minetest.facedir_to_dir(((node.param2 + 2) % 4))
	local obj_dir = minetest.facedir_to_dir(get_obj_dir(node.param2))
Or in this offshoot

Code: Select all

local function get_obj_dir(param2)
	return ((param2) % 4)
Check out my Mods: BBQ Mod Crops Plus

User avatar
azekill_DIABLO
Member
Posts: 7507
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Item shelf [itemshelf]

by azekill_DIABLO » Post

it might work.
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

Meh, I'm in over my head. Hoping the original author can swat this bug.
Check out my Mods: BBQ Mod Crops Plus

zorman2000
Member
Posts: 84
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Item shelf [itemshelf]

by zorman2000 » Post

Hello everyone, first of all, huge thanks for all the positive comments!

My apologies I have not been active over here, I have been looking at the feedback and doing some work on this mod, but haven't updated yet. Here is an update:
  • Add half-width shelf, with open back as well (asked by GrizzlyAdam and Sokomine)
  • API updated to support custom vertical and depth displacement of items (allowing for different types of shelves)
  • Fixed bug with item not rotating with shefl
The bug should be fixed by now.
Image

Please download the latest version in GitHub

Regarding crafting recipes, I like the idea by hajo, however I don't think crafting recipes will work for this mod, given all the possibilities there are. I'm already working on an idea for this that will solve the issue with this mod and other mods I'm planning to make in the future.
Attachments
screenshot_20180206_185018.png
screenshot_20180206_185018.png (220.2 KiB) Viewed 1454 times

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

Any word on the items not rotating with the shelf bug?
Check out my Mods: BBQ Mod Crops Plus

User avatar
Lone_Wolf
Member
Posts: 2577
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: LandarVargan
In-game: LandarVargan

Re: [Mod] Item shelf [itemshelf]

by Lone_Wolf » Post

Grizzly Adam wrote:Any word on the items not rotating with the shelf bug?
Reread :P (Or did I misunderstand you?)
zorman2000 wrote:Hello everyone, first of all, huge thanks for all the positive comments!

My apologies I have not been active over here, I have been looking at the feedback and doing some work on this mod, but haven't updated yet. Here is an update:
  • Add half-width shelf, with open back as well (asked by GrizzlyAdam and Sokomine)
  • API updated to support custom vertical and depth displacement of items (allowing for different types of shelves)
  • Fixed bug with item not rotating with shefl
The bug should be fixed by now.
Image

Please download the latest version in GitHub

Regarding crafting recipes, I like the idea by hajo, however I don't think crafting recipes will work for this mod, given all the possibilities there are. I'm already working on an idea for this that will solve the issue with this mod and other mods I'm planning to make in the future.
My ContentDB -|- Working on CaptureTheFlag -|- Minetest Forums Dark Theme!! (You need it)

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

Sorry, I didn't see that. But I did just download and test before replying and at least with the small shelf it was still persisting.
Check out my Mods: BBQ Mod Crops Plus

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

OK, I see. It is now being placed in in the proper direction but when the shelf is rotated it does not rotate with.
Check out my Mods: BBQ Mod Crops Plus

zorman2000
Member
Posts: 84
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Item shelf [itemshelf]

by zorman2000 » Post

Grizzly Adam wrote:OK, I see. It is now being placed in in the proper direction but when the shelf is rotated it does not rotate with.
Are you rotating the shelf with the screwdriver by any chance?
I haven't considered this usecase I guess.

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

Yes sir. I am going through all the current changes and working them into my mediapack for the laptops-- its a definite improvement at this point.
Check out my Mods: BBQ Mod Crops Plus

User avatar
Grizzly Adam
Member
Posts: 252
Joined: Sat Aug 05, 2017 01:28
GitHub: Grizzly-Adam
Location: Lost in America
Contact:

Re: [Mod] Item shelf [itemshelf]

by Grizzly Adam » Post

Might I suggest group choppy instead of group cracky since these are wooden shelves?

When I destroy the shelf I get items back but not the shelf itself. Can anything be done about that?
Check out my Mods: BBQ Mod Crops Plus

zorman2000
Member
Posts: 84
Joined: Tue Jul 26, 2016 18:18
GitHub: hkzorman
In-game: zorman2000

Re: [Mod] Item shelf [itemshelf]

by zorman2000 » Post

Grizzly Adam wrote:Might I suggest group choppy instead of group cracky since these are wooden shelves?

When I destroy the shelf I get items back but not the shelf itself. Can anything be done about that?
Yes, everything added! Check out the latest code changes in GitHub.
  • Group changed to "choppy" now instead of "cracky"
  • Support added for screwdriver rotation
  • Shelf drops on dig and on blast
Thanks for the feedback, enjoy!

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest