diff --git a/mods/ITEMS/mcl_armor/register.lua b/mods/ITEMS/mcl_armor/register.lua index e6ed664cc..f4f1fb4d0 100644 --- a/mods/ITEMS/mcl_armor/register.lua +++ b/mods/ITEMS/mcl_armor/register.lua @@ -241,7 +241,7 @@ minetest.register_tool("mcl_armor:elytra", { local cape = mcl_skins.player_skins[obj].cape if cape ~= "blank.png" then local skinval = mcl_player.player_get_skin(obj) - skinval = skinval:gsub("^" .. cape, "") + skinval = skinval:gsub("%^" .. cape, "") mcl_player.player_set_skin(obj, skinval) -- this doesn't mess with the data mcl_skins has, so when mcl_skins reloads (which happens when the elytra is unequipped), the normal cape returns end diff --git a/mods/PLAYER/mcl_skins/edit_skin.lua b/mods/PLAYER/mcl_skins/edit_skin.lua index 09374c70a..61f290fb9 100644 --- a/mods/PLAYER/mcl_skins/edit_skin.lua +++ b/mods/PLAYER/mcl_skins/edit_skin.lua @@ -161,8 +161,16 @@ function mcl_skins.update_player_skin(player) end local skin = mcl_skins.player_skins[player] + local skinval = mcl_skins.compile_skin(skin) - mcl_player.player_set_skin(player, mcl_skins.compile_skin(skin)) + if player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra" then + skinval = skinval:gsub("%^" .. skin.cape, "") + -- don't render the "normal" cape on players while wearing the elytra. + -- this is NOT used when the player puts an elytra on, see register.lua in mcl_armor for that. + -- this is used when a player joins or changes something regarding their skin. + end + + mcl_player.player_set_skin(player, skinval) local slim_arms if skin.simple_skins_id then @@ -705,7 +713,7 @@ end init() if not minetest.settings:get_bool("mcl_keepInventory", false) then - minetest.register_on_dieplayer(function(player) + minetest.register_on_respawnplayer(function(player) mcl_skins.update_player_skin(player) -- ensures players have their cape again after dying with an elytra end) end \ No newline at end of file