From 7ce64857178eb4387ba075247606f750bf27d4d7 Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Sun, 14 Mar 2021 20:10:12 +0800 Subject: [PATCH 1/2] Allow portals to break only in creative and to be pointed. --- mods/ITEMS/mcl_portals/portal_nether.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index 7e23a9f7b..d8efc1067 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -64,7 +64,7 @@ local function destroy_nether_portal(pos) local meta = minetest.get_meta(pos) local node = minetest.get_node(pos) local nn, orientation = node.name, node.param2 - local obsidian = nn == "mcl_core:obsidian" + local obsidian = nn == "mcl_core:obsidian" local has_meta = minetest.string_to_pos(meta:get_string("portal_frame1")) if has_meta then @@ -138,8 +138,6 @@ minetest.register_node("mcl_portals:portal", { sunlight_propagates = true, use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "blend" or true, walkable = false, - diggable = false, - pointable = false, buildable_to = false, is_ground_content = false, drop = "", @@ -152,7 +150,7 @@ minetest.register_node("mcl_portals:portal", { {-0.5, -0.5, -0.1, 0.5, 0.5, 0.1}, }, }, - groups = {portal=1, not_in_creative_inventory = 1}, + groups = { creative_breakable = 1, portal = 1, not_in_creative_inventory = 1 }, on_destruct = destroy_nether_portal, _mcl_hardness = -1, @@ -583,7 +581,7 @@ local function check_and_light_shape(pos, orientation) meta:set_string("portal_time", tostring(0)) meta:set_string("portal_target", "") end - return true + return true end -- Attempts to light a Nether portal at pos @@ -842,7 +840,7 @@ minetest.override_item("mcl_core:obsidian", { _on_ignite = function(user, pointed_thing) local x, y, z = pointed_thing.under.x, pointed_thing.under.y, pointed_thing.under.z -- Check empty spaces around obsidian and light all frames found: - local portals_placed = + local portals_placed = mcl_portals.light_nether_portal({x = x - 1, y = y, z = z}) or mcl_portals.light_nether_portal({x = x + 1, y = y, z = z}) or mcl_portals.light_nether_portal({x = x, y = y - 1, z = z}) or mcl_portals.light_nether_portal({x = x, y = y + 1, z = z}) or mcl_portals.light_nether_portal({x = x, y = y, z = z - 1}) or mcl_portals.light_nether_portal({x = x, y = y, z = z + 1}) @@ -863,4 +861,3 @@ minetest.override_item("mcl_core:obsidian", { end end, }) - From 1b003467904564e41d8d71a938ce2479c77fb02d Mon Sep 17 00:00:00 2001 From: iliekprogrammar Date: Sun, 14 Mar 2021 20:39:10 +0800 Subject: [PATCH 2/2] Add breaking sounds. --- mods/ITEMS/mcl_portals/portal_nether.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/mods/ITEMS/mcl_portals/portal_nether.lua b/mods/ITEMS/mcl_portals/portal_nether.lua index d8efc1067..32a24e092 100644 --- a/mods/ITEMS/mcl_portals/portal_nether.lua +++ b/mods/ITEMS/mcl_portals/portal_nether.lua @@ -151,6 +151,7 @@ minetest.register_node("mcl_portals:portal", { }, }, groups = { creative_breakable = 1, portal = 1, not_in_creative_inventory = 1 }, + sounds = mcl_sounds.node_sound_glass_defaults(), on_destruct = destroy_nether_portal, _mcl_hardness = -1,