[Mod] Item Frames [itemframes]

User avatar
Calinou
Moderator
 
Posts: 3137
Joined: Mon Aug 01, 2011 14:26
Location: France
GitHub: Calinou
IRC: Calinou
In-game: Calinou

[Mod] Item Frames [itemframes]

by Calinou » Sun Jun 29, 2014 18:00

Another item frames and pedestals mod. Based on Zeg9's item frames mod.

This mod is originating from Carbone. You don't install this mod if you're playing that particular game; it's already included and enabled by default there.

Download

No dependencies on non-default mods.
License for code: CC0
License for textures: CC BY-SA 3.0


Crafting

X = stick, P = paper.

X X X
X P X
X X X

S = stone, _ = nothing.

S S S
_ S _
S S S
 

User avatar
Inocudom
Member
 
Posts: 2909
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: [Mod] Item Frames [itemframes]

by Inocudom » Sun Jun 29, 2014 18:11

It looks like Zeg9 might be gone for some time, so I am glad that you are doing this. Along with the frames and the pedestals, glass cases would be useful too.

Could the displays work like locked treasure chests, but have only one slot for the item to be put on display to be placed in? That way, if clearobjects is performed, they could reshow the single item that they have either by the player getting close enough to them or by being punched.
 

User avatar
TenPlus1
Member
 
Posts: 2018
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Item Frames [itemframes]

by TenPlus1 » Sun Jun 29, 2014 20:14

Glad to see this mod getting some attention... what differs between this and Zeg's ?
 

User avatar
Calinou
Moderator
 
Posts: 3137
Joined: Mon Aug 01, 2011 14:26
Location: France
GitHub: Calinou
IRC: Calinou
In-game: Calinou

Re: [Mod] Item Frames [itemframes]

by Calinou » Wed Jul 02, 2014 09:20

TenPlus1 wrote:Glad to see this mod getting some attention... what differs between this and Zeg's ?


Textures were redone, items rotate slower on pedestals, code style fixed and cleaned up.
 

User avatar
TenPlus1
Member
 
Posts: 2018
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Item Frames [itemframes]

by TenPlus1 » Wed Jul 02, 2014 19:30

Nice, I did however notice that using a screwdriver to rotate the item frame then adding an item crashes minetest and servers it runs on and the only fix I could see was to tweak the screwdriver mod slightly to ignore frames... ADDED below...
Attachments
screwdriver(frame_fix).zip
(5.33 KiB) Downloaded 36 times
 

User avatar
Inocudom
Member
 
Posts: 2909
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: [Mod] Item Frames [itemframes]

by Inocudom » Thu Aug 07, 2014 18:13

In the topic of the original item_frames mod, thus was spoken:
Inocudom wrote:This mod was updated yesterday, so displayed objects will now reappear after /clearobjects actions.

Very significant, very significant.
 

User avatar
Inocudom
Member
 
Posts: 2909
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom
 

User avatar
Wuzzy
Member
 
Posts: 2564
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Mod] Item Frames [itemframes]

by Wuzzy » Sat Feb 11, 2017 12:06

You can't place the following Minetest Game items on item frames and pedestals:

  • Boat
  • Cart
  • Screwdriver
  • Wheat Seed
  • Cotton Seed
  • Skeleton Key
  • Key

You can rotate item frames with a screwdriver, which looks very weird. I think the easiest fix would be to disallow screwdriver rotation of item frames.

Also, the Minetest mod manager gets confused if you have this mod and Homedecor installed. If you try to enable this mod, it doesn't get enabled!
I noticed this mod has the identical name as a homedecor mod. This is a very confusing bug, please consider a rename.
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
TenPlus1
Member
 
Posts: 2018
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Item Frames [itemframes]

by TenPlus1 » Sat Feb 11, 2017 13:40

We could easily add the following code to the on_rightclick for each item that doesn't work for itemframes so that they do (like I did with Farming Redo crop/seed):

Code: Select all
   local def = minetest.registered_nodes[under.name]
   if def and def.on_rightclick then
      return def.on_rightclick(pt.under, under, placer, itemstack)
   end
 

User avatar
sorcerykid
Member
 
Posts: 391
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
In-game: Nemo

Re: [Mod] Item Frames [itemframes]

by sorcerykid » Tue Feb 21, 2017 20:36

Thanks for the heads up Wuzzy. I didn't realize those items were incompatible with the itemframes mod. I think TenPlus has the right solution. I'll get the fix in place on the JT2 server.
 

User avatar
Lord_Vlad
Member
 
Posts: 49
Joined: Thu Jul 20, 2017 07:58
 

User avatar
sorcerykid
Member
 
Posts: 391
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
In-game: Nemo

Re: [Mod] Item Frames [itemframes]

by sorcerykid » Mon Jul 24, 2017 23:42

My solution was to override the registration functions. This affords a universal means for interactive nodes (like those used in the itemframes mod) to intercept right-clicks whenever a player is wielding a craftitem or a node with an on_place handler. With this code it is also possible to open doors and chests while a cart, a boat, a wheat seed, or a cotton seed is currently selected in the inventory.

Code: Select all
local old_register_node = minetest.register_node
local old_register_craftitem = minetest.register_craftitem

minetest.register_craftitem = function ( name, fields )
   if fields.on_place then
      fields._on_place = fields.on_place
      fields.on_place = function( itemstack, player, pointed_thing )
         local pos = pointed_thing.under
         local node = minetest.get_node( pos )

         -- allow on_rightclick callback of pointed_thing to intercept item placement
         if minetest.registered_nodes[ node.name ].on_rightclick then
            minetest.registered_nodes[ node.name ].on_rightclick( pos, node, player, itemstack )
         -- otherwise placement is dependent on anti-grief rules of this item (if hook is defined)
         elseif not fields.allow_place or fields.allow_place( pos, player ) then
            return fields._on_place( itemstack, player, pointed_thing )
         end
         return itemstack
      end
   end
   old_register_craftitem( name, fields )
end

minetest.register_node = function ( name, fields )
   if fields.on_place and fields.on_place ~= minetest.rotate_node then
      fields._on_place = fields.on_place
      fields.on_place = function( itemstack, player, pointed_thing )
         local pos = pointed_thing.under
         local node = minetest.get_node( pos )

         -- allow on_rightclick callback of pointed_thing to intercept item placement
         if minetest.registered_nodes[ node.name ].on_rightclick then
            minetest.registered_nodes[ node.name ].on_rightclick( pos, node, player, itemstack )
         -- otherwise placement is dependent on anti-grief rules of this item (if hook is defined)
         elseif not fields.allow_place or fields.allow_place( pos, player ) then
            return fields._on_place( itemstack, player, pointed_thing )
         end
         return itemstack
      end
   end
   if fields.on_punch then
      fields._on_punch = fields.on_punch
      fields.on_punch = function( pos, node, player )
         -- punching is dependent on anti-grief rules of this item (currently only used by tnt)
         if not fields.allow_punch or fields.allow_punch( pos, player ) then
            fields._on_punch( pos, node, player )
         end
      end
   end
   old_register_node( name, fields )
end


The above code snippet is a global dependency, so obviously needs to be executed ahead of all other mods. A suitable location would be default/init.lua.
 


Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 4 guests