Make bugs only pointable with Bug Net
* Add legacy compatibility making to work with older clients
* backported https://github.com/minetest/minetest_game/pull/3099
* backported commit ef788d0307
This commit is contained in:
parent
0ca6bc101a
commit
45e4ebf607
@ -2,6 +2,8 @@
|
||||
|
||||
-- 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 = {
|
||||
@ -33,6 +35,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",
|
||||
|
@ -1,3 +1,4 @@
|
||||
name = butterflies
|
||||
description = Minetest Game mod: Butterflies
|
||||
depends = default, flowers
|
||||
optional_depends = fireflies
|
||||
|
@ -6,6 +6,8 @@ local S = minetest.get_translator("fireflies")
|
||||
local m_eth = minetest.get_modpath("ethereal")
|
||||
-- detecting cretive engine over creative privilegies
|
||||
local m_cre = minetest.get_modpath("creative")
|
||||
-- Legacy compatibility, when pointabilities don't exist, pointable is set to true.
|
||||
local pointable_compat = not minetest.features.item_specific_pointabilities
|
||||
|
||||
-- firefly
|
||||
minetest.register_node("fireflies:firefly", {
|
||||
@ -27,6 +29,7 @@ minetest.register_node("fireflies:firefly", {
|
||||
sunlight_propagates = true,
|
||||
buildable_to = true,
|
||||
walkable = false,
|
||||
pointable = pointable_compat,
|
||||
groups = {catchable = 1},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
@ -95,6 +98,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)
|
||||
if not pointed_thing or pointed_thing.type ~= "node" or
|
||||
minetest.is_protected(pointed_thing.under, player:get_player_name()) then
|
||||
|
Loading…
x
Reference in New Issue
Block a user