mirror of
https://github.com/minetest/minetest_game.git
synced 2024-11-08 08:43:51 +01:00
Make bugs only pointable with Bug Net (#3099)
This commit is contained in:
parent
5a80084800
commit
ef788d0307
@ -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,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",
|
||||
|
@ -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,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",
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user