From f9a2607200c272fef657792cdc3df8e160dc643d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 27 Nov 2017 07:57:02 +0100 Subject: [PATCH] Make falling anvils crush some nodes --- GROUPS.md | 1 + mods/ENTITIES/mcl_falling_nodes/init.lua | 2 +- mods/ITEMS/mcl_anvils/init.lua | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/GROUPS.md b/GROUPS.md index 93ae95183..94ef54b39 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -29,6 +29,7 @@ Please read to learn how digging times ### Groups for interactions +* `crush_after_fall=1`: For falling nodes. These will crush whatever they hit after falling, not dropping as an item * `dig_by_water=1`: Blocks with this group will drop when they are near flowing water * `destroy_by_lava_flow=1`: Blocks with this group will be destroyed by flowing lava * `dig_by_piston=1`: Blocks which will drop as an item when pushed by a piston. They also cannot be pulled by sticky pistons diff --git a/mods/ENTITIES/mcl_falling_nodes/init.lua b/mods/ENTITIES/mcl_falling_nodes/init.lua index 7ddcd2fd2..a0882ce96 100644 --- a/mods/ENTITIES/mcl_falling_nodes/init.lua +++ b/mods/ENTITIES/mcl_falling_nodes/init.lua @@ -92,7 +92,7 @@ minetest.register_entity(":__builtin:falling_node", { if n2.name == "mcl_portals:portal_end" then -- TODO: Teleport falling node. - elseif nd and nd.buildable_to == true then + elseif (nd and nd.buildable_to == true) or minetest.get_item_group(self.node.name, "crush_after_fall") ~= 0 then -- Replace destination node if it's buildable to minetest.remove_node(np) -- Run script hook diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index f97555cae..c3c68f98a 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -1,5 +1,5 @@ local anvildef = { - groups = {pickaxey=1, falling_node=1, deco_block=1, anvil=1}, + groups = {pickaxey=1, falling_node=1, crush_after_fall=1, deco_block=1, anvil=1}, tiles = {"mcl_anvils_anvil_top_damaged_0.png^[transformR90", "mcl_anvils_anvil_base.png", "mcl_anvils_anvil_side.png"}, paramtype = "light", sunlight_propagates = true,