Initial Commit

This commit is contained in:
Thomas--S 2017-03-31 20:48:08 +02:00
commit bbde77bab2
8 changed files with 162 additions and 0 deletions

21
README.txt Normal file
View File

@ -0,0 +1,21 @@
Minetest mod: moognu
==========================
See license.txt for license information.
Originally published as "nyancat" mod.
Authors of source code
----------------------
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
Various Minetest developers and contributors (LGPL 2.1)
Modified by Thomas-S (LGPL 2.1)
Authors of media files
----------------------
VanessaE (CC BY-SA 3.0):
moognu_rainbow.png
The contributors of http://archive.org/details/M00GNU and tenplus1 (CC BY-SA 3.0):
moognu_back.png
moognu_front.png
moognu_side.png

1
depends.txt Normal file
View File

@ -0,0 +1 @@
default

87
init.lua Normal file
View File

@ -0,0 +1,87 @@
minetest.register_node("moognu:moognu", {
description = "MooGNU",
tiles = {"moognu_side.png", "moognu_side.png", "moognu_side.png",
"moognu_side.png", "moognu_back.png", "moognu_front.png"},
paramtype = "light",
light_source = default.LIGHT_MAX,
paramtype2 = "facedir",
groups = {cracky = 2},
is_ground_content = false,
legacy_facedir_simple = true,
sounds = default.node_sound_defaults(),
})
minetest.register_node("moognu:moognu_rainbow", {
description = "MooGNU Rainbow",
tiles = {
"moognu_rainbow.png^[transformR90",
"moognu_rainbow.png^[transformR90",
"moognu_rainbow.png"
},
paramtype = "light",
light_source = default.LIGHT_MAX,
paramtype2 = "facedir",
groups = {cracky = 2},
is_ground_content = false,
sounds = default.node_sound_defaults(),
})
minetest.register_craft({
type = "fuel",
recipe = "moognu:moognu",
burntime = 1,
})
minetest.register_craft({
type = "fuel",
recipe = "moognu:moognu_rainbow",
burntime = 1,
})
moognu = {}
function moognu.place(pos, facedir, length)
if facedir > 3 then
facedir = 0
end
local tailvec = minetest.facedir_to_dir(facedir)
local p = {x = pos.x, y = pos.y, z = pos.z}
minetest.set_node(p, {name = "moognu:moognu", param2 = facedir})
for i = 1, length do
p.x = p.x + tailvec.x
p.z = p.z + tailvec.z
minetest.set_node(p, {name = "moognu:moognu_rainbow", param2 = facedir})
end
end
function moognu.generate(minp, maxp, seed)
local height_min = -31000
local height_max = -32
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1)
local pr = PseudoRandom(seed + 9324342)
local max_num_moognus = math.floor(volume / (16 * 16 * 16))
for i = 1, max_num_moognus do
if pr:next(0, 1000) == 0 then
local x0 = pr:next(minp.x, maxp.x)
local y0 = pr:next(minp.y, maxp.y)
local z0 = pr:next(minp.z, maxp.z)
local p0 = {x = x0, y = y0, z = z0}
moognu.place(p0, pr:next(0, 3), pr:next(3, 15))
end
end
end
minetest.register_on_generated(function(minp, maxp, seed)
moognu.generate(minp, maxp, seed)
end)
-- Legacy
minetest.register_alias("default:nyancat", "moognu:moognu")
minetest.register_alias("nyancat:nyancat", "moognu:moognu")
minetest.register_alias("default:nyancat_rainbow", "moognu:moognu_rainbow")
minetest.register_alias("nyancat:nyancat_rainbow", "moognu:moognu_rainbow")

53
license.txt Normal file
View File

@ -0,0 +1,53 @@
License of source code
----------------------
GNU Lesser General Public License, version 2.1
Copyright (C) 2011-2017 celeron55, Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2012-2017 Various Minetest developers and contributors
Copyright (C) 2017 Thomas-S
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU Lesser General Public License as published by the Free Software Foundation;
either version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details:
https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
Licenses of media (textures)
----------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Copyright (C) 2012-2017 VanessaE
Copyright (C) 2012-2017 The contributors of http://archive.org/details/M00GNU
Copyright (C) 2012-2017 tenplus1
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/

BIN
textures/moognu_back.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

BIN
textures/moognu_front.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

BIN
textures/moognu_rainbow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

BIN
textures/moognu_side.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B