From ec5b0903be5eb5abce822a2c7b87eef918452228 Mon Sep 17 00:00:00 2001 From: MrRar Date: Tue, 4 Apr 2023 14:05:15 -0600 Subject: [PATCH 1/3] Make enchanted elytra usable --- mods/PLAYER/mcl_playerplus/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 8ace0a9a9..782ac039e 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -239,7 +239,7 @@ minetest.register_globalstep(function(dtime) elytra.speed = 1 - (direction.y/2 + 0.5) end - elytra.active = player:get_inventory():get_stack("armor", 3):get_name() == "mcl_armor:elytra" + elytra.active = player:get_inventory():get_stack("armor", 3):get_name():find("mcl_armor:elytra") and not parent and (elytra.active or (is_just_jumped and player_velocity.y < -0)) and ((not minetest.registered_nodes[fly_node].walkable) or fly_node == "ignore") From 1a7f9fe8eccb69bda023de67a55897b73625d325 Mon Sep 17 00:00:00 2001 From: FlamingRCCars Date: Tue, 4 Apr 2023 14:06:41 -0600 Subject: [PATCH 2/3] Make elytra enchantable --- mods/ITEMS/mcl_armor/register.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_armor/register.lua b/mods/ITEMS/mcl_armor/register.lua index 89ff5ca9f..29a53003b 100644 --- a/mods/ITEMS/mcl_armor/register.lua +++ b/mods/ITEMS/mcl_armor/register.lua @@ -219,7 +219,7 @@ minetest.register_tool("mcl_armor:elytra", { _doc_items_longdesc = mcl_armor.longdesc, _doc_items_usagehelp = mcl_armor.usage, inventory_image = "mcl_armor_inv_elytra.png", - groups = {armor = 1, non_combat_armor = 1, armor_torso = 1, non_combat_torso = 1, mcl_armor_uses = 10}, + groups = {armor = 1, non_combat_armor = 1, armor_torso = 1, non_combat_torso = 1, mcl_armor_uses = 10, enchantability = 1}, sounds = { _mcl_armor_equip = "mcl_armor_equip_leather", _mcl_armor_unequip = "mcl_armor_unequip_leather", From b001e4e06f6de1c61d9a8a2f36a2f445fe330f33 Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Thu, 27 Apr 2023 13:16:15 -0600 Subject: [PATCH 3/3] Make elytra active checks use groups instead So that modders can easily add their own varients of elytra that work --- mods/ITEMS/mcl_armor/register.lua | 2 +- mods/PLAYER/mcl_playerplus/init.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_armor/register.lua b/mods/ITEMS/mcl_armor/register.lua index 29a53003b..c7fa91475 100644 --- a/mods/ITEMS/mcl_armor/register.lua +++ b/mods/ITEMS/mcl_armor/register.lua @@ -219,7 +219,7 @@ minetest.register_tool("mcl_armor:elytra", { _doc_items_longdesc = mcl_armor.longdesc, _doc_items_usagehelp = mcl_armor.usage, inventory_image = "mcl_armor_inv_elytra.png", - groups = {armor = 1, non_combat_armor = 1, armor_torso = 1, non_combat_torso = 1, mcl_armor_uses = 10, enchantability = 1}, + groups = {armor = 1, non_combat_armor = 1, armor_torso = 1, non_combat_torso = 1, mcl_armor_uses = 10, enchantability = 1, elytra = 1}, sounds = { _mcl_armor_equip = "mcl_armor_equip_leather", _mcl_armor_unequip = "mcl_armor_unequip_leather", diff --git a/mods/PLAYER/mcl_playerplus/init.lua b/mods/PLAYER/mcl_playerplus/init.lua index 782ac039e..1de839456 100644 --- a/mods/PLAYER/mcl_playerplus/init.lua +++ b/mods/PLAYER/mcl_playerplus/init.lua @@ -239,7 +239,7 @@ minetest.register_globalstep(function(dtime) elytra.speed = 1 - (direction.y/2 + 0.5) end - elytra.active = player:get_inventory():get_stack("armor", 3):get_name():find("mcl_armor:elytra") + elytra.active = minetest.get_item_group(player:get_inventory():get_stack("armor", 3):get_name(), "elytra") ~= 0 and not parent and (elytra.active or (is_just_jumped and player_velocity.y < -0)) and ((not minetest.registered_nodes[fly_node].walkable) or fly_node == "ignore")