Skip to content

Commit

Permalink
Make bugs only pointable with Bug Net (#3099)
Browse files Browse the repository at this point in the history
  • Loading branch information
cx384 committed Mar 10, 2024
1 parent 5a80084 commit ef788d0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mods/butterflies/init.lua
Expand Up @@ -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")},
Expand Down Expand Up @@ -33,6 +36,7 @@ for i in ipairs (butter_list) do
sunlight_propagates = true,
buildable_to = true,
walkable = false,
pointable = pointable_compat,
groups = {catchable = 1},
selection_box = {
type = "fixed",
Expand Down
4 changes: 4 additions & 0 deletions mods/fireflies/init.lua
Expand Up @@ -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"),
Expand All @@ -23,6 +25,7 @@ minetest.register_node("fireflies:firefly", {
sunlight_propagates = true,
buildable_to = true,
walkable = false,
pointable = pointable_compat,
groups = {catchable = 1},
selection_box = {
type = "fixed",
Expand Down Expand Up @@ -91,6 +94,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
Expand Down

0 comments on commit ef788d0

Please sign in to comment.