From: Elias Fleckenstein Date: Sat, 12 Dec 2020 19:35:57 +0000 (+0100) Subject: Fixed invalid 3rd person wielditem rotation for tools; Fixed broken craft recipe... X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=4f5c280179374450b6a2f7cb7294a02d619db357;p=Crafter.git Fixed invalid 3rd person wielditem rotation for tools; Fixed broken craft recipe preview --- diff --git a/mods/client_version_checker/init.lua b/mods/client_version_checker/init.lua index 91fc5d4..6f7739b 100644 --- a/mods/client_version_checker/init.lua +++ b/mods/client_version_checker/init.lua @@ -12,13 +12,13 @@ minetest.register_on_joinplayer(function(player) local name = player:get_player_name() client_version_channels[name] = minetest.mod_channel_join(name..":client_version_channel") client_has_clientmod[name] = nil - minetest.after(3, function() - if not client_has_clientmod[name] then + minetest.after(5, function() + if client_has_clientmod[name] then + client_has_clientmod[name] = nil + else minetest.chat_send_player(name, minetest.colorize("orange", "It seems like you don't have Crafter client installed." .. " You will not be able to use all features of this server without the clientmod." .. " Please dowload it here: https://github.com/EliasFleckenstein03/crafter_client")) - else - client_has_clientmod[name] = nil end end) end) diff --git a/mods/inventory/init.lua b/mods/inventory/init.lua index 9488aa7..0437b0b 100644 --- a/mods/inventory/init.lua +++ b/mods/inventory/init.lua @@ -117,7 +117,7 @@ local output_constant = "button[5,3.5;1,1;inventory.back;back]" --back button local output local recipe -local usable_recipe +local usable_table local function create_craft_formspec(item) --don't do air if item == "" then @@ -279,7 +279,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) else craft_inv = create_craft_formspec(item) if craft_inv and craft_inv ~= "" then - minetest.show_formspec(name, id, empty_armor_slots(player)..tmi_master_inventory["page_"..temp_pool.page]..craft_inv..cheat_button(name)) + minetest.show_formspec(name, id, tmi_master_inventory["page_"..temp_pool.page]..craft_inv..cheat_button(name)) minetest.sound_play("lever", {to_player = name,gain=0.7}) end end diff --git a/mods/player_api/init.lua b/mods/player_api/init.lua index dd7829b..3632ef0 100644 --- a/mods/player_api/init.lua +++ b/mods/player_api/init.lua @@ -48,7 +48,7 @@ local update_wield_item = function(player) entity.wielder = name - object:set_attach(player, "Right_Hand", vector.new(0,0,0), vector.new(0,0,0)) + object:set_attach(player, "Right_Hand", vector.new(0,0,0), vector.new(0, 0, 0)) temp_pool.wield_item = object end @@ -422,12 +422,27 @@ local set_item = function(self, item) itemname = stack:is_known() and stack:get_name() or "unknown" def = minetest.registered_nodes[itemname] + tooldef = minetest.registered_tools[itemname] self.object:set_properties({ textures = {itemname}, wield_item = self.itemstring, glow = def and def.light_source, }) + + local parent, bone, offset, rotation, forced_visible = self.object:get_attach() + + if not parent then + return + end + + if tooldef then + rotation = vector.new(90, 45, 90) + else + rotation = vector.new(0, 0, 0) + end + + self.object:set_attach(parent, bone, offset, rotation, forced_visible) end minetest.register_entity("player_api:item", { @@ -455,4 +470,4 @@ minetest.register_entity("player_api:item", { self.object:remove() end end, -}) \ No newline at end of file +}) diff --git a/todo.txt b/todo.txt index 3352df7..a0050d4 100644 --- a/todo.txt +++ b/todo.txt @@ -1,8 +1,6 @@ - Equip armor with rightclick - Shift-click fuel into furnace - Throwing eggs -- 3d person visuals: Fix invalid rotation of wield tools -- Sprinting - Rebalancing of ore generation probabilities and tool speeds - More sophisticated particle effects - Season effects (only affecting audiovisuals like textures and music)