included the reduced and external mantanied fireflies mod for older engines
* the mt5 game already has a improved version of fireflies with timer nodes that hide the fireflies at day
This commit is contained in:
parent
f208b6312d
commit
1624147edc
@ -21,6 +21,7 @@ Most of those mods have mirror at http://git.mirror.org
|
|||||||
| dye | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
| dye | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
||||||
| farming | https://codeberg.org/minenux/minetest-mod-farming | https://codeberg.org/minenux/minetest-mod-farming/commit/08c3a9b37bab5d8a0f5971b168aef412db5fc424 | [farming/README.md](farming/README.md) |
|
| farming | https://codeberg.org/minenux/minetest-mod-farming | https://codeberg.org/minenux/minetest-mod-farming/commit/08c3a9b37bab5d8a0f5971b168aef412db5fc424 | [farming/README.md](farming/README.md) |
|
||||||
| fire | https://codeberg.org/minenux/minetest-mod-fire | https://codeberg.org/minenux/minetest-mod-fire/commit/4e5f7ad55314bd9b126fb133cfc5a32fa58b20d2 | [fire/README.md](fire/README.md) |
|
| fire | https://codeberg.org/minenux/minetest-mod-fire | https://codeberg.org/minenux/minetest-mod-fire/commit/4e5f7ad55314bd9b126fb133cfc5a32fa58b20d2 | [fire/README.md](fire/README.md) |
|
||||||
|
| fireflies | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/b5434409b6dda7a810f5ddc9a630970216204cbe | [fireflies/README.md](fireflies/README.md) |
|
||||||
| flowers | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
| flowers | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
||||||
| give_initial_stuff | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
| give_initial_stuff | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
||||||
| killme | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
| killme | https://codeberg.org/minenux/minetest-game-minetest | https://codeberg.org/minenux/minetest-game-minetest/commit/c7cb79422ba19c696966472942db6177c934838d | |
|
||||||
|
27
mods/fireflies/README.md
Normal file
27
mods/fireflies/README.md
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
Fireflies
|
||||||
|
===
|
||||||
|
|
||||||
|
Adds fireflies which can be caught in a net and placed in bottles for lighting
|
||||||
|
|
||||||
|
Intro
|
||||||
|
----
|
||||||
|
|
||||||
|
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 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)
|
||||||
|
|
||||||
|
Compatibility
|
||||||
|
----
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
License
|
||||||
|
----
|
||||||
|
|
||||||
|
Code for this mod is released under MIT (https://opensource.org/licenses/MIT).
|
||||||
|
|
||||||
|
Please see license.txt for texture licenses.
|
2
mods/fireflies/depends.txt
Normal file
2
mods/fireflies/depends.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
default
|
||||||
|
vessels
|
1
mods/fireflies/description.txt
Normal file
1
mods/fireflies/description.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
Adds fireflies which can be caught in a net and placed in bottles for lighting.
|
173
mods/fireflies/init.lua
Normal file
173
mods/fireflies/init.lua
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
|
||||||
|
-- firefly
|
||||||
|
minetest.register_node("fireflies:firefly", {
|
||||||
|
description = "Firefly",
|
||||||
|
drawtype = "plantlike",
|
||||||
|
tiles = {{
|
||||||
|
name = "fireflies_firefly_animated.png",
|
||||||
|
animation = {
|
||||||
|
type = "vertical_frames",
|
||||||
|
aspect_w = 16,
|
||||||
|
aspect_h = 16,
|
||||||
|
length = 1.5
|
||||||
|
},
|
||||||
|
}},
|
||||||
|
inventory_image = "fireflies_firefly.png",
|
||||||
|
wield_image = "fireflies_firefly.png",
|
||||||
|
waving = 1,
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
buildable_to = true,
|
||||||
|
walkable = false,
|
||||||
|
groups = {catchable = 1},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
|
||||||
|
},
|
||||||
|
light_source = 6,
|
||||||
|
floodable = true,
|
||||||
|
on_flood = function(pos, oldnode, newnode)
|
||||||
|
minetest.add_item(pos, "fireflies:firefly 1")
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- bug net
|
||||||
|
minetest.register_tool("fireflies:bug_net", {
|
||||||
|
description = "Bug Net",
|
||||||
|
inventory_image = "fireflies_bugnet.png",
|
||||||
|
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
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local node_name = minetest.get_node(pointed_thing.under).name
|
||||||
|
local inv = player:get_inventory()
|
||||||
|
if minetest.get_item_group(node_name, "catchable") == 1 then
|
||||||
|
minetest.set_node(pointed_thing.under, {name = "air"})
|
||||||
|
local stack = ItemStack(node_name.." 1")
|
||||||
|
local leftover = inv:add_item("main", stack)
|
||||||
|
if leftover:get_count() > 0 then
|
||||||
|
minetest.add_item(pointed_thing.under, node_name.." 1")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not minetest.setting_getbool("creative_mode") then
|
||||||
|
itemstack:add_wear(256)
|
||||||
|
return itemstack
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "fireflies:bug_net",
|
||||||
|
recipe = {
|
||||||
|
{"farming:string", "farming:string", ""},
|
||||||
|
{"farming:string", "farming:string", ""},
|
||||||
|
{"default:stick", "", ""}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- firefly in a bottle
|
||||||
|
minetest.register_node("fireflies:firefly_bottle", {
|
||||||
|
description = "Firefly in a Bottle",
|
||||||
|
inventory_image = "fireflies_bottle.png",
|
||||||
|
wield_image = "fireflies_bottle.png",
|
||||||
|
tiles = {{
|
||||||
|
name = "fireflies_bottle_animated.png",
|
||||||
|
animation = {
|
||||||
|
type = "vertical_frames",
|
||||||
|
aspect_w = 16,
|
||||||
|
aspect_h = 16,
|
||||||
|
length = 1.5
|
||||||
|
},
|
||||||
|
}},
|
||||||
|
drawtype = "plantlike",
|
||||||
|
paramtype = "light",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
light_source = 9,
|
||||||
|
walkable = false,
|
||||||
|
groups = {snappy = 3, attached_node = 1},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
|
||||||
|
},
|
||||||
|
sounds = default.node_sound_glass_defaults(),
|
||||||
|
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||||
|
local lower_pos = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||||
|
if minetest.is_protected(pos, player:get_player_name()) or
|
||||||
|
minetest.get_node(lower_pos).name ~= "air" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local upper_pos = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||||
|
local firefly_pos
|
||||||
|
|
||||||
|
if not minetest.is_protected(upper_pos, player:get_player_name()) and
|
||||||
|
minetest.get_node(upper_pos).name == "air" then
|
||||||
|
firefly_pos = upper_pos
|
||||||
|
elseif not minetest.is_protected(lower_pos, player:get_player_name()) then
|
||||||
|
firefly_pos = lower_pos
|
||||||
|
end
|
||||||
|
|
||||||
|
if firefly_pos then
|
||||||
|
minetest.set_node(pos, {name = "vessels:glass_bottle"})
|
||||||
|
minetest.set_node(firefly_pos, {name = "fireflies:firefly"})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft( {
|
||||||
|
output = "fireflies:firefly_bottle",
|
||||||
|
recipe = {
|
||||||
|
{"", "", ""},
|
||||||
|
{"", "fireflies:firefly", ""},
|
||||||
|
{"", "vessels:glass_bottle", ""}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- register fireflies as decorations
|
||||||
|
minetest.register_decoration({
|
||||||
|
deco_type = "simple",
|
||||||
|
place_on = {
|
||||||
|
"default:dirt_with_grass",
|
||||||
|
"default:dirt_with_coniferous_litter",
|
||||||
|
"default:dirt_with_rainforest_litter",
|
||||||
|
"default:dirt"
|
||||||
|
},
|
||||||
|
place_offset_y = 2,
|
||||||
|
sidelen = 80,
|
||||||
|
fill_ratio = 0.002,
|
||||||
|
biomes = {
|
||||||
|
"deciduous_forest",
|
||||||
|
"coniferous_forest",
|
||||||
|
"rainforest",
|
||||||
|
"rainforest_swamp"
|
||||||
|
},
|
||||||
|
y_min = -1,
|
||||||
|
y_max = 31000,
|
||||||
|
decoration = "fireflies:firefly",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_decoration({
|
||||||
|
deco_type = "simple",
|
||||||
|
place_on = {
|
||||||
|
"default:dirt_with_grass",
|
||||||
|
"default:dirt_with_coniferous_litter",
|
||||||
|
"default:dirt_with_rainforest_litter",
|
||||||
|
"default:dirt"
|
||||||
|
},
|
||||||
|
place_offset_y = 3,
|
||||||
|
sidelen = 80,
|
||||||
|
fill_ratio = 0.002,
|
||||||
|
biomes = {
|
||||||
|
"deciduous_forest",
|
||||||
|
"coniferous_forest",
|
||||||
|
"rainforest",
|
||||||
|
"rainforest_swamp"
|
||||||
|
},
|
||||||
|
y_min = -1,
|
||||||
|
y_max = 31000,
|
||||||
|
decoration = "fireflies:firefly",
|
||||||
|
})
|
45
mods/fireflies/license.txt
Normal file
45
mods/fireflies/license.txt
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
Code License: MIT (https://opensource.org/licenses/MIT)
|
||||||
|
By Shara RedCat
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2018 Shara RedCat
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
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)
|
2
mods/fireflies/mod.conf
Normal file
2
mods/fireflies/mod.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
name = fireflies
|
||||||
|
depends = default, vessels
|
BIN
mods/fireflies/screenshot.png
Normal file
BIN
mods/fireflies/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
BIN
mods/fireflies/textures/fireflies_bottle.png
Normal file
BIN
mods/fireflies/textures/fireflies_bottle.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 161 B |
BIN
mods/fireflies/textures/fireflies_bottle_animated.png
Normal file
BIN
mods/fireflies/textures/fireflies_bottle_animated.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 185 B |
BIN
mods/fireflies/textures/fireflies_bugnet.png
Normal file
BIN
mods/fireflies/textures/fireflies_bugnet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 186 B |
BIN
mods/fireflies/textures/fireflies_firefly.png
Normal file
BIN
mods/fireflies/textures/fireflies_firefly.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 114 B |
BIN
mods/fireflies/textures/fireflies_firefly_animated.png
Normal file
BIN
mods/fireflies/textures/fireflies_firefly_animated.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 123 B |
Loading…
x
Reference in New Issue
Block a user