From 644e71f0ee28a245c91cd27474114b1256561b68 Mon Sep 17 00:00:00 2001 From: PrairieWind Date: Tue, 13 Sep 2022 14:34:53 -0600 Subject: [PATCH] The End...Again... Advancement --- mods/HUD/mcl_achievements/init.lua | 7 +++++++ mods/HUD/mcl_achievements/locale/template.txt | 2 ++ mods/ITEMS/mcl_end/end_crystal.lua | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index 049b4d4ac..99845120c 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -291,6 +291,13 @@ awards.register_achievement("mcl:maxed_beacon", { icon = "beacon_achievement_icon.png", }) +-- Triggered in mcl_end +awards.register_achievement("mcl:theEndAgain", { + title = S("The End... Again..."), + description = S("Respawn the Ender Dragon."), + icon = "mcl_end_crystal_item.png", +}) + -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) if non_pc_achievements then diff --git a/mods/HUD/mcl_achievements/locale/template.txt b/mods/HUD/mcl_achievements/locale/template.txt index 9e829e6e6..09cee8606 100644 --- a/mods/HUD/mcl_achievements/locale/template.txt +++ b/mods/HUD/mcl_achievements/locale/template.txt @@ -81,3 +81,5 @@ Beaconator= Use a fully powered beacon.= The Next Generation= Hold the Dragon Egg.@nHint: Pick up the egg from the ground and have it in your inventory.= +The End... Again...= +Respawn the Ender Dragon.= diff --git a/mods/ITEMS/mcl_end/end_crystal.lua b/mods/ITEMS/mcl_end/end_crystal.lua index d6f488b33..b7882a155 100644 --- a/mods/ITEMS/mcl_end/end_crystal.lua +++ b/mods/ITEMS/mcl_end/end_crystal.lua @@ -1,5 +1,7 @@ local S = minetest.get_translator(minetest.get_current_modname()) +local peaceful = minetest.settings:get_bool("only_peaceful_mobs", false) + local vector = vector local explosion_strength = 6 @@ -68,6 +70,11 @@ local function spawn_crystal(pos) for _,o in pairs(minetest.get_objects_inside_radius(pos,64)) do local l = o:get_luaentity() if l and l.name == "mobs_mc:enderdragon" then return end + if not peaceful then + if o:is_player() then + awards.unlock(o:get_player_name(), "mcl:theEndAgain") + end + end end for _, crystal in pairs(crystals) do crystal_explode(crystal)