From 0cd3577481e3635685b126991dfa1a38d3d29be3 Mon Sep 17 00:00:00 2001 From: cx384 Date: Sat, 27 Jan 2024 13:22:30 +0100 Subject: [PATCH 1/2] Make bugs only pointable with Bug Net --- mods/butterflies/init.lua | 1 + mods/fireflies/init.lua | 2 ++ 2 files changed, 3 insertions(+) diff --git a/mods/butterflies/init.lua b/mods/butterflies/init.lua index 0d61b33ded..278fea14e2 100644 --- a/mods/butterflies/init.lua +++ b/mods/butterflies/init.lua @@ -33,6 +33,7 @@ for i in ipairs (butter_list) do sunlight_propagates = true, buildable_to = true, walkable = false, + pointable = false, groups = {catchable = 1}, selection_box = { type = "fixed", diff --git a/mods/fireflies/init.lua b/mods/fireflies/init.lua index 5593afe4ac..50cac00710 100644 --- a/mods/fireflies/init.lua +++ b/mods/fireflies/init.lua @@ -23,6 +23,7 @@ minetest.register_node("fireflies:firefly", { sunlight_propagates = true, buildable_to = true, walkable = false, + pointable = false, groups = {catchable = 1}, selection_box = { type = "fixed", @@ -91,6 +92,7 @@ minetest.register_node("fireflies:hidden_firefly", { minetest.register_tool("fireflies:bug_net", { description = S("Bug Net"), inventory_image = "fireflies_bugnet.png", + pointabilities = {nodes = {["group:catchable"] = true}}, on_use = function(itemstack, player, pointed_thing) local player_name = player and player:get_player_name() or "" if not pointed_thing or pointed_thing.type ~= "node" or From 5c8b6c171a596c5473027a6f8ef284406ba0e531 Mon Sep 17 00:00:00 2001 From: cx384 Date: Sat, 27 Jan 2024 14:03:12 +0100 Subject: [PATCH 2/2] Add legacy compatibility --- mods/butterflies/init.lua | 5 ++++- mods/fireflies/init.lua | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mods/butterflies/init.lua b/mods/butterflies/init.lua index 278fea14e2..16b6791059 100644 --- a/mods/butterflies/init.lua +++ b/mods/butterflies/init.lua @@ -3,6 +3,9 @@ -- Load support for MT game translation. local S = minetest.get_translator("butterflies") +-- Legacy compatibility, when pointabilities don't exist, pointable is set to true. +local pointable_compat = not minetest.features.item_specific_pointabilities + -- register butterflies local butter_list = { {"white", S("White Butterfly")}, @@ -33,7 +36,7 @@ for i in ipairs (butter_list) do sunlight_propagates = true, buildable_to = true, walkable = false, - pointable = false, + pointable = pointable_compat, groups = {catchable = 1}, selection_box = { type = "fixed", diff --git a/mods/fireflies/init.lua b/mods/fireflies/init.lua index 50cac00710..4aba655df0 100644 --- a/mods/fireflies/init.lua +++ b/mods/fireflies/init.lua @@ -3,6 +3,8 @@ -- Load support for MT game translation. local S = minetest.get_translator("fireflies") +-- Legacy compatibility, when pointabilities don't exist, pointable is set to true. +local pointable_compat = not minetest.features.item_specific_pointabilities minetest.register_node("fireflies:firefly", { description = S("Firefly"), @@ -23,7 +25,7 @@ minetest.register_node("fireflies:firefly", { sunlight_propagates = true, buildable_to = true, walkable = false, - pointable = false, + pointable = pointable_compat, groups = {catchable = 1}, selection_box = { type = "fixed",