From ede968b5710299cd2a8030610434aa0e75b2f2cf Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Tue, 13 Sep 2022 16:03:07 -0600 Subject: [PATCH] Free The End Advancement --- mods/ENTITIES/mobs_mc/ender_dragon.lua | 7 +++++++ mods/HUD/mcl_achievements/init.lua | 6 ++++++ mods/HUD/mcl_achievements/locale/template.txt | 2 ++ 3 files changed, 15 insertions(+) diff --git a/mods/ENTITIES/mobs_mc/ender_dragon.lua b/mods/ENTITIES/mobs_mc/ender_dragon.lua index 382d9e958d..cdab915350 100644 --- a/mods/ENTITIES/mobs_mc/ender_dragon.lua +++ b/mods/ENTITIES/mobs_mc/ender_dragon.lua @@ -127,6 +127,13 @@ mcl_mobs:register_mob("mobs_mc:enderdragon", { minetest.set_node(vector.add(self._portal_pos, vector.new(0, 5, 0)), {name = "mcl_end:dragon_egg"}) end end + + -- Free The End Advancement + for _,players in pairs(minetest.get_objects_inside_radius(pos,64)) do + if players:is_player() then + awards.unlock(o:get_player_name(), "mcl:freeTheEnd") + end + end end, fire_resistant = true, }) diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index ff325c4035..8f0c8dd89b 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -249,6 +249,12 @@ awards.register_achievement("mcl:witheringHeights", { icon = "mcl_mobitems_nether_star.png", }) +awards.register_achievement("mcl:freeTheEnd", { + title = S("Free the End"), + description = S("Kill the ender dragon. Good Luck!"), + icon = "mobs_mc_spawn_icon_dragon.png", -- TODO: Dragon Head Icon +}) + -- Triggered in mcl_fishing awards.register_achievement("mcl:fishyBusiness", { title = S("Fishy Business"), diff --git a/mods/HUD/mcl_achievements/locale/template.txt b/mods/HUD/mcl_achievements/locale/template.txt index d2c0954b4c..cd3726b05d 100644 --- a/mods/HUD/mcl_achievements/locale/template.txt +++ b/mods/HUD/mcl_achievements/locale/template.txt @@ -85,3 +85,5 @@ The End... Again...= Respawn the Ender Dragon.= Sky's The Limit= Find the elytra and prepare to fly above and beyond!= +Free the End= +Kill the ender dragon. Good Luck!=