mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2025-06-28 14:16:06 +02:00
Update minetestforfun_game, fix maptools
This commit is contained in:
@ -1,23 +1,26 @@
|
||||
Minetest Game mod: flowers
|
||||
==========================
|
||||
See license.txt for license information.
|
||||
|
||||
License of source code:
|
||||
-----------------------
|
||||
Copyright (C) 2012-2013 Ironzorg, VanessaE
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by Ironzorg (MIT) and VanessaE (MIT)
|
||||
Various Minetest developers and contributors (MIT)
|
||||
|
||||
This program is free software. It comes without any warranty, to
|
||||
the extent permitted by applicable law. You can redistribute it
|
||||
and/or modify it under the terms of the Do What The Fuck You Want
|
||||
To Public License, Version 2, as published by Sam Hocevar. See
|
||||
http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||
Authors of media (textures)
|
||||
---------------------------
|
||||
RHRhino (CC BY-SA 3.0):
|
||||
flowers_dandelion_white.png
|
||||
flowers_dandelion_yellow.png
|
||||
flowers_geranium.png
|
||||
flowers_rose.png
|
||||
flowers_tulip.png
|
||||
flowers_viola.png
|
||||
|
||||
License of media (textures and sounds)
|
||||
--------------------------------------
|
||||
WTFPL
|
||||
Gambit (CC BY-SA 3.0):
|
||||
flowers_mushroom_brown.png
|
||||
flowers_mushroom_red.png
|
||||
flowers_waterlily.png
|
||||
|
||||
Gambit (WTFPL):
|
||||
flowers_mushroom_*.png
|
||||
flowers_waterlily.png
|
||||
|
||||
DanDuncombe (WTFPL):
|
||||
flowers_spores_*.png
|
||||
yyt16384 (CC BY-SA 3.0):
|
||||
flowers_waterlily_bottom.png, derived from Gambit's texture
|
||||
|
@ -58,12 +58,42 @@ local function add_simple_flower(name, desc, box, f_groups)
|
||||
end
|
||||
|
||||
flowers.datas = {
|
||||
{"rose", "Rose", {-0.15, -0.5, -0.15, 0.15, 0.3, 0.15}, {color_red = 1}},
|
||||
{"tulip", "Orange Tulip", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_orange = 1}},
|
||||
{"dandelion_yellow", "Yellow Dandelion", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_yellow = 1}},
|
||||
{"geranium", "Blue Geranium", {-0.15, -0.5, -0.15, 0.15, 0.2, 0.15}, {color_blue = 1}},
|
||||
{"viola", "Viola", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_violet = 1}},
|
||||
{"dandelion_white", "White dandelion", {-0.5, -0.5, -0.5, 0.5, -0.2, 0.5}, {color_white = 1}}
|
||||
{
|
||||
"rose",
|
||||
"Rose",
|
||||
{-2 / 16, -0.5, -2 / 16, 2 / 16, 5 / 16, 2 / 16},
|
||||
{color_red = 1, flammable = 1}
|
||||
},
|
||||
{
|
||||
"tulip",
|
||||
"Orange Tulip",
|
||||
{-2 / 16, -0.5, -2 / 16, 2 / 16, 3 / 16, 2 / 16},
|
||||
{color_orange = 1, flammable = 1}
|
||||
},
|
||||
{
|
||||
"dandelion_yellow",
|
||||
"Yellow Dandelion",
|
||||
{-2 / 16, -0.5, -2 / 16, 2 / 16, 4 / 16, 2 / 16},
|
||||
{color_yellow = 1, flammable = 1}
|
||||
},
|
||||
{
|
||||
"geranium",
|
||||
"Blue Geranium",
|
||||
{-2 / 16, -0.5, -2 / 16, 2 / 16, 2 / 16, 2 / 16},
|
||||
{color_blue = 1, flammable = 1}
|
||||
},
|
||||
{
|
||||
"viola",
|
||||
"Viola",
|
||||
{-5 / 16, -0.5, -5 / 16, 5 / 16, -1 / 16, 5 / 16},
|
||||
{color_violet = 1, flammable = 1}
|
||||
},
|
||||
{
|
||||
"dandelion_white",
|
||||
"White dandelion",
|
||||
{-5 / 16, -0.5, -5 / 16, 5 / 16, -2 / 16, 5 / 16},
|
||||
{color_white = 1, flammable = 1}
|
||||
},
|
||||
}
|
||||
|
||||
for _,item in pairs(flowers.datas) do
|
||||
@ -95,50 +125,54 @@ minetest.register_node("flowers:lily_pad", {
|
||||
})
|
||||
|
||||
-- Flower spread
|
||||
-- Public function to enable override by mods
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:flora"},
|
||||
neighbors = {"default:dirt_with_grass", "default:desert_sand"},
|
||||
interval = 13,
|
||||
chance = 96,
|
||||
action = function(pos, node)
|
||||
pos.y = pos.y - 1
|
||||
local under = minetest.get_node(pos)
|
||||
pos.y = pos.y + 1
|
||||
if under.name == "default:desert_sand" then
|
||||
minetest.set_node(pos, {name = "default:dry_shrub"})
|
||||
elseif under.name ~= "default:dirt_with_grass" then
|
||||
return
|
||||
end
|
||||
function flowers.flower_spread(pos, node)
|
||||
pos.y = pos.y - 1
|
||||
local under = minetest.get_node(pos)
|
||||
pos.y = pos.y + 1
|
||||
if under.name == "default:desert_sand" then
|
||||
minetest.set_node(pos, {name = "default:dry_shrub"})
|
||||
return
|
||||
elseif under.name ~= "default:dirt_with_grass" and
|
||||
under.name ~= "default:dirt_with_dry_grass" then
|
||||
return
|
||||
end
|
||||
|
||||
local light = minetest.get_node_light(pos)
|
||||
local light = minetest.get_node_light(pos)
|
||||
if not light or light < 13 then
|
||||
return
|
||||
end
|
||||
|
||||
local pos0 = vector.subtract(pos, 4)
|
||||
local pos1 = vector.add(pos, 4)
|
||||
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora") > 3 then
|
||||
return
|
||||
end
|
||||
|
||||
local seedling = minetest.find_nodes_in_area_under_air(pos0, pos1,
|
||||
{"default:dirt_with_grass", "default:dirt_with_dry_grass"})
|
||||
if #seedling > 0 then
|
||||
seedling = seedling[math.random(#seedling)]
|
||||
seedling.y = seedling.y + 1
|
||||
light = minetest.get_node_light(seedling)
|
||||
if not light or light < 13 then
|
||||
return
|
||||
end
|
||||
minetest.set_node(seedling, {name = node.name})
|
||||
end
|
||||
end
|
||||
|
||||
local pos0 = {x = pos.x - 4, y = pos.y - 4, z = pos.z - 4}
|
||||
local pos1 = {x = pos.x + 4, y = pos.y + 4, z = pos.z + 4}
|
||||
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then
|
||||
return
|
||||
end
|
||||
|
||||
local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora")
|
||||
if #flowers > 3 then
|
||||
return
|
||||
end
|
||||
|
||||
local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass")
|
||||
if #seedling > 0 then
|
||||
seedling = seedling[math.random(#seedling)]
|
||||
seedling.y = seedling.y + 1
|
||||
light = minetest.get_node_light(seedling)
|
||||
if not light or light < 13 then
|
||||
return
|
||||
end
|
||||
if minetest.get_node(seedling).name == "air" then
|
||||
minetest.set_node(seedling, {name = node.name})
|
||||
end
|
||||
end
|
||||
minetest.register_abm({
|
||||
label = "Flower spread",
|
||||
nodenames = {"group:flora"},
|
||||
neighbors = {"default:dirt_with_grass", "default:dirt_with_dry_grass",
|
||||
"default:desert_sand"},
|
||||
interval = 13,
|
||||
chance = 96,
|
||||
action = function(...)
|
||||
flowers.flower_spread(...)
|
||||
end,
|
||||
})
|
||||
|
||||
@ -157,12 +191,12 @@ minetest.register_node("flowers:mushroom_red", {
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy = 3, flammable = 3, attached_node = 1},
|
||||
groups = {snappy = 3, attached_node = 1, flammable = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_use = minetest.item_eat(-5),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
|
||||
fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, -1 / 16, 4 / 16},
|
||||
}
|
||||
})
|
||||
|
||||
@ -176,34 +210,35 @@ minetest.register_node("flowers:mushroom_brown", {
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
groups = {snappy = 3, flammable = 3, attached_node = 1},
|
||||
groups = {snappy = 3, attached_node = 1, flammable = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_use = minetest.item_eat(1),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
|
||||
fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, -2 / 16, 3 / 16},
|
||||
}
|
||||
})
|
||||
|
||||
-- mushroom spread and death
|
||||
|
||||
-- Mushroom spread and death
|
||||
|
||||
minetest.register_abm({
|
||||
label = "Mushroom spread",
|
||||
nodenames = {"flowers:mushroom_brown", "flowers:mushroom_red"},
|
||||
interval = 11,
|
||||
chance = 50,
|
||||
action = function(pos, node)
|
||||
if minetest.get_node_light(pos, nil) == 15 then
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
local random = {
|
||||
x = pos.x + math.random(-2,2),
|
||||
y = pos.y + math.random(-1,1),
|
||||
z = pos.z + math.random(-2,2)
|
||||
}
|
||||
local random_node = minetest.get_node_or_nil(random)
|
||||
if not random_node then
|
||||
return
|
||||
end
|
||||
if random_node.name ~= "air" then
|
||||
local random = {
|
||||
x = pos.x + math.random(-2, 2),
|
||||
y = pos.y + math.random(-1, 1),
|
||||
z = pos.z + math.random(-2, 2)
|
||||
}
|
||||
local random_node = minetest.get_node_or_nil(random)
|
||||
if not random_node or random_node.name ~= "air" then
|
||||
return
|
||||
end
|
||||
local node_under = minetest.get_node_or_nil({x = random.x,
|
||||
@ -211,20 +246,25 @@ minetest.register_abm({
|
||||
if not node_under then
|
||||
return
|
||||
end
|
||||
if minetest.get_item_group(node_under.name, "soil") ~= 0 and
|
||||
minetest.get_node_light(pos, nil) <= 9 and
|
||||
minetest.get_node_light(random, nil) <= 9 and
|
||||
not minetest.is_protected(random, "") then
|
||||
|
||||
if (minetest.get_item_group(node_under.name, "soil") ~= 0 or
|
||||
minetest.get_item_group(node_under.name, "tree") ~= 0) and
|
||||
minetest.get_node_light(pos, 0.5) <= 3 and
|
||||
minetest.get_node_light(random, 0.5) <= 3 then
|
||||
minetest.set_node(random, {name = node.name})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- these old mushroom related nodes can be simplified now
|
||||
|
||||
-- These old mushroom related nodes can be simplified now
|
||||
|
||||
minetest.register_alias("flowers:mushroom_spores_brown", "flowers:mushroom_brown")
|
||||
minetest.register_alias("flowers:mushroom_spores_red", "flowers:mushroom_red")
|
||||
minetest.register_alias("flowers:mushroom_fertile_brown", "flowers:mushroom_brown")
|
||||
minetest.register_alias("flowers:mushroom_fertile_red", "flowers:mushroom_red")
|
||||
minetest.register_alias("mushroom:brown_natural", "flowers:mushroom_brown")
|
||||
minetest.register_alias("mushroom:red_natural", "flowers:mushroom_red")
|
||||
|
||||
|
||||
--
|
||||
@ -236,22 +276,24 @@ minetest.register_node("flowers:waterlily", {
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {"flowers_waterlily.png"},
|
||||
tiles = {"flowers_waterlily.png", "flowers_waterlily_bottom.png"},
|
||||
inventory_image = "flowers_waterlily.png",
|
||||
wield_image = "flowers_waterlily.png",
|
||||
liquids_pointable = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
groups = {snappy = 3, flower = 1},
|
||||
floodable = true,
|
||||
groups = {snappy = 3, flower = 1, flammable = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
node_placement_prediction = "",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.46875, 0.5}
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -15 / 32, 0.5}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
|
||||
fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, -15 / 32, 7 / 16}
|
||||
},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
@ -260,16 +302,20 @@ minetest.register_node("flowers:waterlily", {
|
||||
local def = minetest.registered_nodes[node]
|
||||
local player_name = placer:get_player_name()
|
||||
|
||||
if def and def.liquidtype == "source" and minetest.get_item_group(node, "water") > 0 then
|
||||
if def and def.liquidtype == "source" and
|
||||
minetest.get_item_group(node, "water") > 0 then
|
||||
if not minetest.is_protected(pos, player_name) then
|
||||
minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)})
|
||||
minetest.set_node(pos, {name = "flowers:waterlily",
|
||||
param2 = math.random(0, 3)})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
else
|
||||
minetest.chat_send_player(player_name, "This area is protected")
|
||||
minetest.chat_send_player(player_name, "Node is protected")
|
||||
minetest.record_protection_violation(pos, player_name)
|
||||
end
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
62
minetestforfun_game/mods/flowers/license.txt
Normal file
62
minetestforfun_game/mods/flowers/license.txt
Normal file
@ -0,0 +1,62 @@
|
||||
License of source code
|
||||
----------------------
|
||||
|
||||
The MIT License (MIT)
|
||||
Copyright (C) 2012-2016 Ironzorg, VanessaE
|
||||
Copyright (C) 2012-2016 Various Minetest developers and contributors
|
||||
|
||||
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.
|
||||
|
||||
For more details:
|
||||
https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
Licenses of media (textures)
|
||||
----------------------------
|
||||
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
Copyright (C) 2014-2016 RHRhino
|
||||
Copyright (C) 2015-2016 Gambit
|
||||
Copyright (C) 2016 yyt16384
|
||||
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format.
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
|
||||
Attribution — You must give appropriate credit, provide a link to the license, and
|
||||
indicate if changes were made. You may do so in any reasonable manner, but not in any way
|
||||
that suggests the licensor endorses you or your use.
|
||||
|
||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute
|
||||
your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that
|
||||
legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
|
||||
You do not have to comply with the license for elements of the material in the public
|
||||
domain or where your use is permitted by an applicable exception or limitation.
|
||||
No warranties are given. The license may not give you all of the permissions necessary
|
||||
for your intended use. For example, other rights such as publicity, privacy, or moral
|
||||
rights may limit how you use the material.
|
||||
|
||||
For more details:
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
@ -217,9 +217,9 @@ minetest.register_decoration({
|
||||
-- Mods using singlenode mapgen can call these functions to enable
|
||||
-- the use of minetest.generate_ores or minetest.generate_decorations
|
||||
|
||||
local mg_params = minetest.get_mapgen_params()
|
||||
if mg_params.mgname == "v6" then
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
if mg_name == "v6" then
|
||||
flowers.register_mgv6_decorations()
|
||||
elseif mg_params.mgname ~= "singlenode" then
|
||||
elseif mg_name ~= "singlenode" then
|
||||
flowers.register_decorations()
|
||||
end
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 327 B |
Reference in New Issue
Block a user