fireflies - sync with oiginal and add support for ethereal

* sync with fireflies of upstream original mod and from minenux
* Add vessels group to firefly vessel
* Detect creative mode and creative privilegies, using creative mod
* Detect ethereal mod and provide more biomes of place
stable-5.2
mckaygerhard 2023-06-18 03:00:01 -04:00
parent 1c50f2a3cb
commit fc4ab2538d
6 changed files with 128 additions and 30 deletions

69
mods/fireflies/README.md Normal file
View File

@ -0,0 +1,69 @@
minetest mod Fireflies
======================
Adds fireflies which can be caught in a net and placed in bottles for lighting
Information
-----------
This is a simple Minetest mod by Shara RedCat that adds fireflies to the world on mapgen, which can then be caught in a net and placed in bottles to provide light. Note that they only appear on newly generated map.
This mod was originally adapted from original but with featured ethereal more biomes, that was adapted from the Hidden Worlds subgame to work with Minetest Game, and has since been added to Minetest Game itself. This version (at https://github.com/Ezhh/fireflies) is now maintained independently from the main Minetest Game version for the purpose of possible expansions to the mod which may or may not also be added to Minetest Game at a later time.
Thanks to shivajiva for helping work through the original idea and for assisting with the code, and to all those who helped test this mod so far.
![](screenshot.png)
## Techinal info
-------------
Please note that the current stable version of Minetest (0.4.16) is unable to position the fireflies above groundlevel. The mod is otherwise fully functional and can be used; but requires the current dev version of Minetest for optimal firefly placement.
#### nodes
| node name | Description | Aditional info |
| ------------------------ | ------------------- | ---------------------------------------- |
| fireflies:firefly | Firefly | is not a mob, really a node |
| fireflies:bug_net | Bug net | tool type, to catch fireflies |
| fireflies:firefly_bottle | Firefly in a Bottle | When you catch a firefly with the bottle |
#### Crafts
`fireflies:firefly_bottle`
```
{"fireflies:firefly"},
{"vessels:glass_bottle"}
```
`fireflies:bug_net`
```
{"farming:string", "farming:string"},
{"farming:string", "farming:string"},
```
## License
-------
Code for this mod is released under MIT (https://opensource.org/licenses/MIT).
#### Authors of source code
Shara RedCat (MIT)
#### Authors of media (textures)
Shara RedCat (CC BY-SA 3.0):
fireflies_firefly.png
fireflies_firefly_animated.png
fireflies_bugnet.png
fireflies_bottle.png
fireflies_bottle_animated.png
fireflies_bugnet.png is modified from a texture by tenplus1 (CC0)
fireflies_bottle.png and fireflies_bottle_animated.png are
modified from a texture by Vanessa Ezekowitz (CC BY-SA 3.0)
check [license.txt](license.txt)

View File

@ -0,0 +1,3 @@
default
vessels
ethereal?

View File

@ -0,0 +1 @@
Adds fireflies which can be caught in a net and placed in bottles for lighting.

View File

@ -2,8 +2,12 @@
-- Load support for MT game translation.
local S = minetest.get_translator("fireflies")
-- support to more biomes if ethereal is detected
local m_eth = minetest.get_modpath("ethereal")
-- detecting cretive engine over creative privilegies
local m_cre = minetest.get_modpath("creative")
-- firefly
minetest.register_node("fireflies:firefly", {
description = S("Firefly"),
drawtype = "plantlike",
@ -106,9 +110,11 @@ minetest.register_tool("fireflies:bug_net", {
minetest.add_item(pointed_thing.under, node_name.." 1")
end
end
if not (creative and creative.is_enabled_for(player:get_player_name())) then
itemstack:add_wear(256)
return itemstack
if not m_cre then
if creative.is_enabled_for(player:get_player_name())) then
itemstack:add_wear(256)
return itemstack
end
end
end
})
@ -142,7 +148,7 @@ minetest.register_node("fireflies:firefly_bottle", {
sunlight_propagates = true,
light_source = 9,
walkable = false,
groups = {vessel = 1, dig_immediate = 3, attached_node = 1},
groups = {vessel = 1, dig_immediate = 3, snappy = 3, attached_node = 1},
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
@ -181,6 +187,44 @@ minetest.register_craft( {
}
})
local biomes_allowed = {}
local places_allowed = {}
if m_eth then
biomes_allowed = {
"deciduous_forest",
"coniferous_forest",
"rainforest",
"rainforest_swamp",
"grassland",
"junglee",
"junglee_ocean",
"bamboo"
}
places_allowed = {
"default:dirt_with_grass",
"default:dirt_with_coniferous_litter",
"default:dirt_with_rainforest_litter",
"default:dirt",
"default:dirt_with_grass",
"ethereal:junglee_dirt",
"default:sand",
"ethereal:bamboo_dirt"
}
else
biomes_allowed = {
"deciduous_forest",
"coniferous_forest",
"rainforest",
"rainforest_swamp"
}
places_allowed = {
"default:dirt_with_grass",
"default:dirt_with_coniferous_litter",
"default:dirt_with_rainforest_litter",
"default:dirt"
}
end
-- register fireflies as decorations
@ -215,21 +259,11 @@ else
minetest.register_decoration({
name = "fireflies:firefly_low",
deco_type = "simple",
place_on = {
"default:dirt_with_grass",
"default:dirt_with_coniferous_litter",
"default:dirt_with_rainforest_litter",
"default:dirt"
},
place_on = places_allowed,
place_offset_y = 2,
sidelen = 80,
fill_ratio = 0.0005,
biomes = {
"deciduous_forest",
"coniferous_forest",
"rainforest",
"rainforest_swamp"
},
biomes = biomes_allowed,
y_max = 31000,
y_min = -1,
decoration = "fireflies:hidden_firefly",
@ -238,21 +272,11 @@ else
minetest.register_decoration({
name = "fireflies:firefly_high",
deco_type = "simple",
place_on = {
"default:dirt_with_grass",
"default:dirt_with_coniferous_litter",
"default:dirt_with_rainforest_litter",
"default:dirt"
},
place_on = places_allowed,
place_offset_y = 3,
sidelen = 80,
fill_ratio = 0.0005,
biomes = {
"deciduous_forest",
"coniferous_forest",
"rainforest",
"rainforest_swamp"
},
biomes = biomes_allowed,
y_max = 31000,
y_min = -1,
decoration = "fireflies:hidden_firefly",

View File

@ -1,3 +1,4 @@
name = fireflies
description = Minetest Game mod: fireflies
description = Adds fireflies which can be caught in a net and placed in bottles for lighting.
depends = default, vessels
optional_depends = ethereal

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB