diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-04-04 13:16:09 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-04-04 13:16:09 +0300 |
commit | b22168d3da597d61c40cc93dd690ba143fd5e4cc (patch) | |
tree | 8a0e13767f6761a35c4dd7eaa2f6b38ac6246483 /builtin | |
parent | b9b56bac6bf5a9701c2898d254a2df9cdf99425c (diff) | |
download | minetest-b22168d3da597d61c40cc93dd690ba143fd5e4cc.tar.gz minetest-b22168d3da597d61c40cc93dd690ba143fd5e4cc.tar.bz2 minetest-b22168d3da597d61c40cc93dd690ba143fd5e4cc.zip |
Fix dropped nodeitem visuals
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/item_entity.lua | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/builtin/item_entity.lua b/builtin/item_entity.lua index 8468ebedf..ad0060b48 100644 --- a/builtin/item_entity.lua +++ b/builtin/item_entity.lua @@ -12,7 +12,7 @@ minetest.register_entity("__builtin:item", { initial_properties = { hp_max = 1, physical = true, - collisionbox = {-0.25,-0.25,-0.25, 0.25,0.25,0.25}, + collisionbox = {-0.17,-0.17,-0.17, 0.17,0.17,0.17}, visual = "sprite", visual_size = {x=0.5, y=0.5}, textures = {""}, @@ -33,14 +33,26 @@ minetest.register_entity("__builtin:item", { itemname = stack:to_table().name end local item_texture = nil + local item_type = "" if minetest.registered_items[itemname] then item_texture = minetest.registered_items[itemname].inventory_image + item_type = minetest.registered_items[itemname].type end - item_texture = item_texture or "unknown_item.png" - self.object:set_properties({ - textures = {item_texture}, + prop = { is_visible = true, - }) + visual = "sprite", + textures = {"unknown_item.png"} + } + if item_texture and item_texture ~= "" then + prop.visual = "sprite" + prop.textures = {item_texture} + else + prop.visual = "wielditem" + prop.textures = {itemname} + prop.visual_size = {x=0.20, y=0.20} + prop.automatic_rotate = math.pi * 0.25 + end + self.object:set_properties(prop) end, get_staticdata = function(self) |