From 327bb68927c1a96c4eb491e36605cb40a969ff1b Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Fri, 19 Mar 2021 12:03:32 +0100 Subject: [PATCH] Fix crystal on_place handler --- mods/ITEMS/mcl_end/end_crystal.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mods/ITEMS/mcl_end/end_crystal.lua b/mods/ITEMS/mcl_end/end_crystal.lua index 8686f1de..b6b9fdd6 100644 --- a/mods/ITEMS/mcl_end/end_crystal.lua +++ b/mods/ITEMS/mcl_end/end_crystal.lua @@ -85,14 +85,15 @@ minetest.register_craftitem("mcl_end:crystal", { on_place = function(itemstack, placer, pointed_thing) if pointed_thing.type == "node" then local pos = minetest.get_pointed_thing_position(pointed_thing) - local node = minetest.get_node(pos).name + local node = minetest.get_node(pos) + local node_name = node.name if placer and not placer:get_player_control().sneak then - if minetest.registered_nodes[node.name] and minetest.registered_nodes[node.name].on_rightclick then - return minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack + if minetest.registered_nodes[node_name] and minetest.registered_nodes[node_name].on_rightclick then + return minetest.registered_nodes[node_name].on_rightclick(pointed_thing.under, node, placer, itemstack) or itemstack end end if find_crystal(pos) then return itemstack end - if node == "mcl_core:obsidian" or node == "mcl_core:bedrock" then + if node_name == "mcl_core:obsidian" or node_name == "mcl_core:bedrock" then if not minetest.is_creative_enabled(placer:get_player_name()) then itemstack:take_item() end