Skip to content

Commit 9b45e7b

Browse files
sofarparamat
authored andcommittedMar 26, 2017
PB&J Pup.
Replace possibly trademarked artwork with royalty free and OK for commercial use artwork. The Pup appears by default but does not alias the Nyan Cat nodes away. For that you will have to enable the setting. A settingtypes.txt is provided to make that really easy. This allows people to get an out-of-tree mod and not have their Nyan nodes disappear. The mod can also be disabled entirely this way for those who don't want it. There's some eatser eggs in here as well. Instead of making the nodes burnable, they are edible, and make you bark and howl. And perhaps something else too.
1 parent 91182d6 commit 9b45e7b

19 files changed

+172
-155
lines changed
 

Diff for: ‎mods/nyancat/README.txt

-16
This file was deleted.

Diff for: ‎mods/nyancat/init.lua

-89
This file was deleted.

Diff for: ‎mods/nyancat/license.txt

-50
This file was deleted.

Diff for: ‎mods/nyancat/textures/nyancat_back.png

-186 Bytes
Binary file not shown.

Diff for: ‎mods/nyancat/textures/nyancat_front.png

-204 Bytes
Binary file not shown.

Diff for: ‎mods/nyancat/textures/nyancat_rainbow.png

-137 Bytes
Binary file not shown.

Diff for: ‎mods/nyancat/textures/nyancat_side.png

-148 Bytes
Binary file not shown.
File renamed without changes.

Diff for: ‎mods/pbj_pup/init.lua

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
2+
--[[
3+
4+
Minetest's official Peanut Butter & Jelly Pup mod
5+
6+
]]--
7+
8+
local enable = minetest.setting_getbool("pbj_pup_enable")
9+
if enable == false then
10+
return
11+
end
12+
13+
local function howl(ttl, player)
14+
if not player then
15+
return
16+
end
17+
ttl = ttl - 15
18+
if ttl < 0 then
19+
return
20+
end
21+
22+
minetest.sound_play("pbj_pup_howl", {object = player, loop = false})
23+
minetest.do_item_eat(5, nil, ItemStack("pbj_pup:pbj_pup"), player, nil)
24+
25+
minetest.after(15, howl, ttl, player)
26+
end
27+
28+
--
29+
-- nodes
30+
--
31+
minetest.register_node("pbj_pup:pbj_pup", {
32+
description = "PB&J Pup",
33+
tiles = {
34+
"pbj_pup_sides.png",
35+
"pbj_pup_jelly.png",
36+
"pbj_pup_sides.png",
37+
"pbj_pup_sides.png",
38+
"pbj_pup_back.png",
39+
"pbj_pup_front.png"
40+
},
41+
paramtype = "light",
42+
light_source = default.LIGHT_MAX,
43+
paramtype2 = "facedir",
44+
groups = {cracky = 2},
45+
is_ground_content = false,
46+
legacy_facedir_simple = true,
47+
sounds = default.node_sound_defaults(),
48+
stack_max = 1,
Has conversations. Original line has conversations.
49+
on_use = function(itemstack, user, pointed_thing)
50+
howl(300, user)
51+
itemstack:take_item()
52+
return itemstack
53+
end,
54+
})
55+
56+
minetest.register_node("pbj_pup:pbj_pup_candies", {
57+
description = "PB&J Pup Candies",
58+
tiles = {{
59+
name = "pbj_pup_candies_animated.png",
60+
animation = {
61+
type = "vertical_frames",
62+
aspect_w = 16,
63+
aspect_h = 16,
64+
length = 1.6
65+
}
66+
}},
67+
paramtype = "light",
68+
light_source = default.LIGHT_MAX,
69+
paramtype2 = "facedir",
70+
groups = {cracky = 2},
71+
is_ground_content = false,
72+
stack_max = 5,
73+
sounds = default.node_sound_defaults(),
74+
on_use = function(itemstack, user, pointed_thing)
75+
minetest.do_item_eat(5, nil, itemstack, user, pointed_thing)
76+
minetest.sound_play("pbj_pup_barks", {object = user, loop = false})
77+
itemstack:take_item()
78+
return itemstack
79+
end,
80+
})
81+
82+
--
83+
-- mapgen
84+
--
85+
local gen = minetest.setting_getbool("pbj_pup_generate")
86+
if gen == nil or gen then
87+
local function place(pos, facedir, length)
88+
if facedir > 3 then
89+
facedir = 0
90+
end
91+
local tailvec = minetest.facedir_to_dir(facedir)
92+
local p = {x = pos.x, y = pos.y, z = pos.z}
93+
minetest.set_node(p, {name = "pbj_pup:pbj_pup", param2 = facedir})
94+
for i = 1, length do
95+
p.x = p.x + tailvec.x
96+
p.z = p.z + tailvec.z
97+
minetest.set_node(p, {name = "pbj_pup:pbj_pup_candies", param2 = facedir})
98+
end
99+
end
100+
101+
local function generate(minp, maxp, seed)
102+
local height_min = -31000
103+
local height_max = -32
104+
if maxp.y < height_min or minp.y > height_max then
105+
return
106+
end
107+
local y_min = math.max(minp.y, height_min)
108+
local y_max = math.min(maxp.y, height_max)
109+
local volume = (maxp.x - minp.x + 1) * (y_max - y_min + 1) * (maxp.z - minp.z + 1)
110+
local pr = PseudoRandom(seed + 9324342)
111+
local max_num = math.floor(volume / (16 * 16 * 16))
112+
for i = 1, max_num do
113+
if pr:next(0, 1000) == 0 then
114+
local x0 = pr:next(minp.x, maxp.x)
115+
local y0 = pr:next(minp.y, maxp.y)
116+
local z0 = pr:next(minp.z, maxp.z)
117+
local p0 = {x = x0, y = y0, z = z0}
118+
place(p0, pr:next(0, 3), pr:next(3, 15))
119+
end
120+
end
121+
end
122+
123+
minetest.register_on_generated(generate)
124+
end
125+
--
126+
-- compat
127+
--
128+
129+
if minetest.setting_getbool("pbj_pup_alias_nyancat") then
130+
minetest.register_alias("default:nyancat", "pbj_pup:pbj_pup")
131+
minetest.register_alias("default:nyancat_rainbow","pbj_pup:pbj_pup_candies")
132+
minetest.register_alias("nyancat", "pbj_pup:pbj_pup")
133+
minetest.register_alias("nyancat_rainbow", "pbj_pup:pbj_pup_candies")
134+
minetest.register_alias("nyancat:nyancat", "pbj_pup:pbj_pup")
135+
minetest.register_alias("nyancat:nyancat_rainbow", "pbj_pup:pbj_pup_candies")
136+
end

Diff for: ‎mods/pbj_pup/license.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
## PB&J Pup
3+
4+
PB&J Pup is a parody on the "Nyan Cat" TM toasted poptart meme.
5+
6+
7+
## License and Copyright
8+
9+
(C) 2017 Vanessa Ezekowitz, Auke Kok, celeron55
10+
11+
* All Code: LGPL-2.1+
12+
* All Images: CC-BY-4.0
13+
14+
15+
## Sounds
16+
17+
* `pbj_pup_barks.ogg`:
18+
Artist: Tomlija <tshesound@gmail.com>
19+
License: CC-BY-3.0
20+
Url: http://freesound.org/people/Tomlija/sounds/97392/
21+
22+
* `pbj_pup_howl.ogg`:
23+
Copyright 2013 Iwan Gabovitch (qubodup)
24+
License: CC-BY-3.0
25+
Url: http://freesound.org/people/qubodup/sounds/193394/
26+

Diff for: ‎mods/pbj_pup/sounds/pbj_pup_barks.ogg

16.8 KB
Binary file not shown.

Diff for: ‎mods/pbj_pup/sounds/pbj_pup_howl.ogg

14.8 KB
Binary file not shown.

Diff for: ‎mods/pbj_pup/textures/pbj_pup_back.png

301 Bytes
Loading

Diff for: ‎mods/pbj_pup/textures/pbj_pup_candies.png

326 Bytes
Loading

Diff for: ‎mods/pbj_pup/textures/pbj_pup_candies_animated.png

1.55 KB
Loading

Diff for: ‎mods/pbj_pup/textures/pbj_pup_front.png

347 Bytes
Loading

Diff for: ‎mods/pbj_pup/textures/pbj_pup_jelly.png

248 Bytes
Loading

Diff for: ‎mods/pbj_pup/textures/pbj_pup_sides.png

250 Bytes
Loading

Diff for: ‎settingtypes.txt

+10
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,13 @@ share_bones_time (Bone share time) int 1200 0
4343

4444
# Replaces old stairs with new ones. Only required for older worlds.
4545
enable_stairs_replace_abm (Replace old stairs) bool false
46+
47+
# Enable the PB&J Pup mod entirely
48+
pbj_pup_enable (Enable PB&J pup mod) bool true
49+
50+
# Generate PB&J Pup blocks in the world
51+
pbj_pup_generate (Generate PBJ Pup blocks in world) bool true
52+
53+
# Let the PB&J Pup mod replace Nyan Cat nodes
54+
pbj_pup_alias_nyancat (Replace Nyan Cat blocks) bool false
55+

0 commit comments

Comments
 (0)
Please sign in to comment.