From 92941534f822df83e36be65813b5686ee9b8bcce Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Fri, 19 Mar 2021 23:28:33 +0800 Subject: [PATCH] Slightly lift your right arm when holding an item. --- mods/PLAYER/wieldview/init.lua | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/mods/PLAYER/wieldview/init.lua b/mods/PLAYER/wieldview/init.lua index 6c0f0856..a5e04ced 100644 --- a/mods/PLAYER/wieldview/init.lua +++ b/mods/PLAYER/wieldview/init.lua @@ -106,14 +106,25 @@ minetest.register_entity("wieldview:wieldnode", { if player then local wielded = player:get_wielded_item() local itemstring = wielded:get_name() + if self.itemstring ~= itemstring then + minetest.chat_send_all(dump2(itemstring, "itemstring")) local def = minetest.registered_items[itemstring] self.object:set_properties({glow = def and def.light_source or 0}) + + -- wield item as cubic if armor.textures[self.wielder].wielditem == "blank.png" then self.object:set_properties({textures = {itemstring}}) - else + else -- displayed item as flat self.object:set_properties({textures = {""}}) end + + if itemstring == "" then -- holding item + player:set_bone_position("Arm_Right", vector.new(0, 0, 0), vector.new(0, 0, 0)) + else -- empty hands + player:set_bone_position("Arm_Right", vector.new(0, 0, 0), vector.new(20, 0, 0)) + end + self.itemstring = itemstring end else