Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nyancats are independent in the default mod. Nothing else uses them or their code. Separating it into a separate mod makes it easier for subgames to remove them. It also makes it easier for a mod to depend on nyancats, as lots of subgames don't have them. Default/mapgen.lua: Register biomes, ores and decorations in singlenode mapgen. These were never disabled anyway because singlenode was removed from the world creation menu.
- Loading branch information
1 parent
0bd13d1
commit 3661cb6
Showing
13 changed files
with
129 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Minetest Game mod: nyancat | ||
========================== | ||
|
||
License of source code: | ||
----------------------- | ||
Copyright (C) 2011-2012 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
|
||
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. | ||
|
||
http://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
License of media (textures and sounds) | ||
-------------------------------------- | ||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) | ||
http://creativecommons.org/licenses/by-sa/3.0/ | ||
|
||
Authors of media files | ||
----------------------- | ||
Everything not listed in here: | ||
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com> | ||
|
||
VanessaE (WTFPL): | ||
default_nc_back.png | ||
default_nc_front.png | ||
default_nc_rb.png | ||
default_nc_side.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
minetest.register_node("nyancat:nyancat", { | ||
description = "Nyan Cat", | ||
tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png", | ||
"default_nc_side.png", "default_nc_back.png", "default_nc_front.png"}, | ||
paramtype2 = "facedir", | ||
groups = {cracky = 2}, | ||
is_ground_content = false, | ||
legacy_facedir_simple = true, | ||
sounds = default.node_sound_defaults(), | ||
}) | ||
|
||
minetest.register_node("nyancat:nyancat_rainbow", { | ||
description = "Nyan Cat Rainbow", | ||
tiles = { | ||
"default_nc_rb.png^[transformR90", "default_nc_rb.png^[transformR90", | ||
"default_nc_rb.png", "default_nc_rb.png" | ||
}, | ||
paramtype2 = "facedir", | ||
groups = {cracky = 2}, | ||
is_ground_content = false, | ||
sounds = default.node_sound_defaults(), | ||
}) | ||
|
||
minetest.register_craft({ | ||
type = "fuel", | ||
recipe = "nyancat:nyancat", | ||
burntime = 1, | ||
}) | ||
|
||
minetest.register_craft({ | ||
type = "fuel", | ||
recipe = "nyancat:nyancat_rainbow", | ||
burntime = 1, | ||
}) | ||
|
||
nyancat = {} | ||
|
||
function nyancat.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 = "nyancat:nyancat", param2 = facedir}) | ||
for i = 1, length do | ||
p.x = p.x + tailvec.x | ||
p.z = p.z + tailvec.z | ||
minetest.set_node(p, {name = "nyancat:nyancat_rainbow", param2 = facedir}) | ||
end | ||
end | ||
|
||
function nyancat.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_nyancats = math.floor(volume / (16 * 16 * 16)) | ||
for i = 1, max_num_nyancats 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} | ||
nyancat.place(p0, pr:next(0, 3), pr:next(3, 15)) | ||
end | ||
end | ||
end | ||
|
||
minetest.register_on_generated(function(minp, maxp, seed) | ||
nyancat.generate(minp, maxp, seed) | ||
end) | ||
|
||
-- Legacy | ||
minetest.register_alias("default:nyancat", "nyancat:nyancat") | ||
minetest.register_alias("default:nyancat_rainbow", "nyancat:nyancat_rainbow") | ||
minetest.register_alias("nyancat", "nyancat:nyancat") | ||
minetest.register_alias("nyancat_rainbow", "nyancat:nyancat_rainbow") | ||
default.make_nyancat = nyancat.place | ||
default.generate_nyancats = nyancat.generate |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes