From 526217a21b2dfb25470437943f1fed0e4dfbbb4a Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 21 Nov 2017 02:05:52 +0100 Subject: [PATCH] Disable Nether portals in the End --- mods/ITEMS/mcl_portals/portal_nether.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index c54bbc73..f469642c 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -288,6 +288,11 @@ end -- If no Nether portal can be lit, nothing happens. -- Returns true on success and false on failure. function mcl_portals.light_nether_portal(pos) + -- Only allow to make portals in Overworld and Nether + local _, dim = mcl_util.y_to_layer(pos.y) + if dim ~= "overworld" and dim ~= "nether" then + return false + end -- Create Nether portal nodes local p1, p2 = is_portal(pos) if not p1 or not p2 then @@ -449,7 +454,7 @@ minetest.register_abm({ local longdesc = minetest.registered_nodes["mcl_core:obsidian"]._doc_items_longdesc longdesc = longdesc .. "\n" .. "Obsidian is also used as the frame of Nether portals." -local usagehelp = "To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame." +local usagehelp = "To open a Nether portal, place an upright frame of obsidian with a width of 4 blocks and a height of 5 blocks, leaving only air in the center. After placing this frame, light a fire in the obsidian frame. Nether portals only work in the Overworld and the Nether." minetest.override_item("mcl_core:obsidian", { _doc_items_longdesc = longdesc,