From 42224d9df6da551cc411ec653df754daed500020 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Fri, 26 May 2017 17:56:09 +0200 Subject: [PATCH] Make ender pearls collide on plants, too --- mods/ITEMS/mcl_throwing/throwable.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_throwing/throwable.lua b/mods/ITEMS/mcl_throwing/throwable.lua index 265cc0f7b6..4cb6f031d8 100644 --- a/mods/ITEMS/mcl_throwing/throwable.lua +++ b/mods/ITEMS/mcl_throwing/throwable.lua @@ -164,6 +164,7 @@ local pearl_on_step = function(self, dtime) local pos = self.object:getpos() pos.y = math.floor(pos.y) local node = minetest.get_node(pos) + local nn = node.name local def = minetest.registered_nodes[node.name] -- Destroy when hitting a solid node @@ -172,7 +173,8 @@ local pearl_on_step = function(self, dtime) -- FIXME: This also means the player loses an ender pearl for throwing into unloaded areas if node.name == "ignore" then self.object:remove() - elseif (def and def.walkable) or not def then + -- Activate when hitting a solid node or a plant + elseif nn == "mcl_core:vine" or nn == "mcl_core:deadbush" or minetest.get_item_group(nn, "flower") ~= 0 or minetest.get_item_group(nn, "sapling") ~= 0 or minetest.get_item_group(nn, "plant") ~= 0 or minetest.get_item_group(nn, "mushroom") ~= 0 or (def and def.walkable) or not def then local player = minetest.get_player_by_name(self._thrower) if player then -- Teleport and hurt player