From 5023e0247d06608c465588ef6ae1af9790efecc9 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 8 Aug 2017 23:28:06 +0200 Subject: [PATCH] Disallow placement of void and realm barrier --- mods/ITEMS/mcl_core/nodes_misc.lua | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mods/ITEMS/mcl_core/nodes_misc.lua b/mods/ITEMS/mcl_core/nodes_misc.lua index a86a30d296..81274a49aa 100644 --- a/mods/ITEMS/mcl_core/nodes_misc.lua +++ b/mods/ITEMS/mcl_core/nodes_misc.lua @@ -161,17 +161,11 @@ minetest.register_node("mcl_core:realm_barrier", { drop = "", _mcl_blast_resistance = 18000003, _mcl_hardness = -1, - after_place_node = function (pos, placer, itemstack, pointed_thing) - if placer == nil then - return - end - minetest.add_particle({ - pos = pos, - expirationtime = 1, - size = 8, - texture = "mcl_core_barrier.png^[colorize:#FF00FF:127^[transformFX", - playername = placer:get_player_name() - }) + -- Prevent placement to protect player from screwing up the world, because the node is not pointable and hard to get rid of. + node_placement_prediction = "", + on_place = function(pos, placer, itemstack, pointed_thing) + minetest.chat_send_player(placer:get_player_name(), core.colorize("#FF0000", "You can't just place a realm barrier by hand!")) + return end, }) @@ -197,6 +191,12 @@ minetest.register_node("mcl_core:void", { is_ground_content = false, groups = { not_in_creative_inventory = 1 }, on_blast = function() end, + -- Prevent placement to protect player from screwing up the world, because the node is not pointable and hard to get rid of. + node_placement_prediction = "", + on_place = function(pos, placer, itemstack, pointed_thing) + minetest.chat_send_player(placer:get_player_name(), core.colorize("#FF0000", "You can't just place the void by hand!")) + return + end, drop = "", -- Infinite blast resistance; it should never be destroyed by explosions _mcl_blast_resistance = -1,