Skip to content

Instantly share code, notes, and snippets.

@GreenXenith GreenXenith/init.lua Secret
Created Apr 19, 2017

Embed
What would you like to do?
wieldview item preview
wieldview.get_item_texture = function(self, item)
local texture = "3d_armor_trans.png"
if item ~= "" then
if minetest.registered_items[item] then
if minetest.registered_items[item].wieldview_image ~= "" then
texture = minetest.registered_items[item].wieldview_image
elseif minetest.registered_items[item].inventory_image ~= "" then
texture = minetest.registered_items[item].inventory_image
elseif node_tiles == true and minetest.registered_items[item].tiles
and type(minetest.registered_items[item].tiles[1]) == "string"
and minetest.registered_items[item].tiles[1] ~= "" then
texture = minetest.inventorycube(minetest.registered_items[item].tiles[1])
end
end
if wieldview.transform[item] then
texture = texture.."^[transform"..wieldview.transform[item]
end
end
return texture
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.