initial commit
commit
7fc1ba0581
|
@ -0,0 +1,21 @@
|
|||
Minetest mod: candycane_cow
|
||||
===========================
|
||||
|
||||
A simple replacement for both Nyancat and PB&J Dog.
|
||||
Code taken from https://github.com/tenplus1/pbj_pup
|
||||
|
||||
See license.txt for license information.
|
||||
|
||||
Authors of source code
|
||||
----------------------
|
||||
Originally by celeron55, Perttu Ahola <celeron55@gmail.com> (LGPL 2.1)
|
||||
Various Minetest developers and contributors (LGPL 2.1)
|
||||
|
||||
Authors of media files
|
||||
----------------------
|
||||
Pilcrow (CC BY-SA 3.0):
|
||||
candycane_cow_face.png
|
||||
candycane_cow_sides.png
|
||||
candycane_cow_udder.png
|
||||
candycane_cow_butt.png
|
||||
candycane_cow_candy.png
|
|
@ -0,0 +1 @@
|
|||
default
|
|
@ -0,0 +1,129 @@
|
|||
--------------
|
||||
-- Settings --
|
||||
--------------
|
||||
|
||||
ENABLE_SPAWNER = true
|
||||
REPLACE_NYANCAT = true
|
||||
REPLACE_PBJ_DOG = true
|
||||
|
||||
|
||||
-----------
|
||||
-- Nodes --
|
||||
-----------
|
||||
|
||||
minetest.register_node("candycane_cow:cow", {
|
||||
description = "Candycane Cow",
|
||||
tiles = {
|
||||
"candycane_cow_sides.png",
|
||||
"candycane_cow_udder.png",
|
||||
"candycane_cow_sides.png",
|
||||
"candycane_cow_sides.png",
|
||||
"candycane_cow_butt.png",
|
||||
"candycane_cow_face.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("candycane_cow:candy", {
|
||||
description = "Candycane",
|
||||
tiles = {
|
||||
"candycane_cow_candy.png^[transformR90",
|
||||
"candycane_cow_candy.png^[transformR90",
|
||||
"candycane_cow_candy.png"
|
||||
},
|
||||
paramtype = "light",
|
||||
light_source = default.LIGHT_MAX,
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky = 2},
|
||||
is_ground_content = false,
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
|
||||
|
||||
------------
|
||||
-- Crafts --
|
||||
------------
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "candycane_cow:cow",
|
||||
burntime = 1,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "candycane_cow:candy",
|
||||
burntime = 1,
|
||||
})
|
||||
|
||||
|
||||
----------
|
||||
-- ABMs --
|
||||
----------
|
||||
|
||||
if ENABLE_SPAWNER then
|
||||
minetest.register_on_generated(function(minp, maxp, seed)
|
||||
local height_min = -31000
|
||||
local height_max = -32
|
||||
local chance = 1000
|
||||
|
||||
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 pr = PseudoRandom(seed + 9324342)
|
||||
|
||||
if pr:next(0, chance) == 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}
|
||||
|
||||
local pos, facedir, length = p0, pr:next(0, 3), pr:next(3, 15)
|
||||
|
||||
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 = "candycane_cow:cow", param2 = facedir})
|
||||
|
||||
for i = 1, length do
|
||||
p.x = p.x + tailvec.x
|
||||
p.z = p.z + tailvec.z
|
||||
minetest.set_node(p, {name = "candycane_cow:candy", param2 = facedir})
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
-------------
|
||||
-- Aliases --
|
||||
-------------
|
||||
|
||||
if REPLACE_NYANCAT then
|
||||
minetest.register_alias("default:nyancat", "candycane_cow:cow")
|
||||
minetest.register_alias("default:nyancat_rainbow", "candycane_cow:candy")
|
||||
|
||||
minetest.register_alias("nyancat", "candycane_cow:cow")
|
||||
minetest.register_alias("nyancat_rainbow", "candycane_cow:cow")
|
||||
|
||||
default.make_nyancat = place_cow
|
||||
end
|
||||
|
||||
if REPLACE_PBJ_DOG then
|
||||
minetest.register_alias("pbj_pup:pbj_pup", "candycane_cow:cow")
|
||||
minetest.register_alias("pbj_pup:pbj_pup_candies", "candycane_cow:candy")
|
||||
end
|
|
@ -0,0 +1,50 @@
|
|||
License of source code
|
||||
----------------------
|
||||
|
||||
GNU Lesser General Public License, version 2.1
|
||||
Copyright (C) 2011-2016 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||
Copyright (C) 2012-2016 Various Minetest developers and contributors
|
||||
|
||||
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-2016 VanessaE
|
||||
|
||||
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/
|
Binary file not shown.
After Width: | Height: | Size: 327 B |
Binary file not shown.
After Width: | Height: | Size: 228 B |
Binary file not shown.
After Width: | Height: | Size: 348 B |
Binary file not shown.
After Width: | Height: | Size: 265 B |
Binary file not shown.
After Width: | Height: | Size: 254 B |
Loading…
Reference in New Issue