From f3ac2bde3e6fa010cc71217aa08b423ddcafca6f Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 8 Nov 2023 19:55:43 +0100 Subject: [PATCH] * Simplify photo meta (wield image falls back to inventory image) --- init.lua | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/init.lua b/init.lua index 5d0eb49..8e0c1ab 100644 --- a/init.lua +++ b/init.lua @@ -22,17 +22,9 @@ local create_photo_item = function( pixels ) local image = tga_encoder.image( pixels ) image:encode() local texture_string = "[png:" .. minetest.encode_base64( image.data ) - meta:set_string( - "xcam:texture", - texture_string - ) meta:set_string( "inventory_image", - "${xcam:texture}" - ) - meta:set_string( - "wield_image", - "${xcam:texture}" + texture_string ) return itemstack @@ -252,7 +244,7 @@ minetest.register_entity( assert( self._itemstring ) local itemstack = ItemStack(self._itemstring) local meta = itemstack:get_meta() - local texture = meta:get_string("xcam:texture") + local texture = meta:get_string("inventory_image") self.object:set_properties({ selectionbox = sbox,