Merge 91d6069f4b
into 6687b5504d
20
junglegrass/README
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
Since recent versions of Minetest no longer contain jungle biomes, and
|
||||||
|
hence no jungle grass, I created this mod to re-add said grass back into
|
||||||
|
the game, with a twist: There are now four different sizes of grasses,
|
||||||
|
all of which yield a single junglegrass object when gathered (so all
|
||||||
|
four sizes may be used where jungle grass is called for). The largest
|
||||||
|
size uses the game's standard jungle grass node, while the others are
|
||||||
|
defined by this mod.
|
||||||
|
|
||||||
|
Junglegrass will spawn on dirt, grass, sand, desert sand and the tops of
|
||||||
|
papyrus and cactus (though rarely), and will do so anywhere in the map.
|
||||||
|
Grass on the ground will grow and eventually die (or turn into dry
|
||||||
|
shrubs, in the desert), given enough time.
|
||||||
|
|
||||||
|
Adjusting the overall spawn/growth rate is easily done by tweaking the
|
||||||
|
MAX_RATIO variable at the top of init.lua. A larger value results in
|
||||||
|
less frequent events.
|
||||||
|
|
||||||
|
Dependencies: none (just the game's default stuff)
|
||||||
|
|
||||||
|
License: cc-by-sa 3.0 for the textures, WTFPL for everything else.
|
24
junglegrass/changelog.txt
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
Changelog
|
||||||
|
---------
|
||||||
|
|
||||||
|
2012-08-03: Mild rewrite to adapt the mod to use perlin noise while spawning.
|
||||||
|
Also got rid of the random-numbers-inside-abm stuff, now using the abm's own
|
||||||
|
'chance' parameter instead. Tuned various settings to try to retain the same
|
||||||
|
overall density and growth rates as in the previous version. Moved this
|
||||||
|
changelog into a separate file.
|
||||||
|
|
||||||
|
2012-07-12: moved project to github.
|
||||||
|
|
||||||
|
2012-07-09 (a bit later): tuned the spawn/grow rates a bit more, made the
|
||||||
|
numbers more sane. Added a radius check to limit the density of the spawned
|
||||||
|
grasses (they won't grow near each other or near dry shrubs or cactus, though
|
||||||
|
they still grow on the top of said cacti).
|
||||||
|
|
||||||
|
2012-07-09: Added cactus, sand, and desert sand as spawning surfaces. Reduced
|
||||||
|
and tuned the spawn rates a bit to try to balance things out. Made that which
|
||||||
|
spawns on grass, dirt, or sand start out at any size, grow over time, and
|
||||||
|
eventually die off. Limited desert sand to only the first two sizes (the
|
||||||
|
smallest size will grow one step, eventually), which will eventually die and
|
||||||
|
turn into dry shrubs. Only the two smallest sizes can spawn on cactus or
|
||||||
|
papyrus (and they don't grow or die). Fixed slightly off-center smallest size.
|
||||||
|
Fixed selection boxes.
|
3
junglegrass/copyright.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Based on flowers mod by ironzorg.
|
||||||
|
Converted to create junglegrass by Vanessa Ezekowitz
|
||||||
|
Adapted jungle grass textures by VanessaE, based on the original one.
|
2
junglegrass/depends.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
default
|
||||||
|
|
231
junglegrass/init.lua
Normal file
|
@ -0,0 +1,231 @@
|
||||||
|
-- Junglegrass mod by VanessaE (using ironzorg's flowers mod as a basis)
|
||||||
|
-- 2012-08-03
|
||||||
|
--
|
||||||
|
-- Now featuring perlin noise for better growth control! :-)
|
||||||
|
--
|
||||||
|
-- License: WTFPL for the code, cc-by-sa for the textures
|
||||||
|
|
||||||
|
math.randomseed(os.time())
|
||||||
|
|
||||||
|
local DEBUG = 0
|
||||||
|
|
||||||
|
local SEED = 52453235636 -- chosen by mashing the keyboard ;-) map seed + this = perlin noise seed
|
||||||
|
local ABUNDANCE = 0.6 -- lower = more abundant
|
||||||
|
local GROWING_DELAY = 500 -- higher = run the ABM less often
|
||||||
|
local RADIUS = 7 -- higher = less dense within the biome area
|
||||||
|
|
||||||
|
local GRASSES = {
|
||||||
|
"junglegrass:shortest",
|
||||||
|
"junglegrass:short",
|
||||||
|
"junglegrass:medium",
|
||||||
|
"default:junglegrass",
|
||||||
|
"default:dry_shrub",
|
||||||
|
"default:cactus",
|
||||||
|
}
|
||||||
|
|
||||||
|
local dbg = function(s)
|
||||||
|
if DEBUG == 1 then
|
||||||
|
print('[JUNGLEGRASS] ' .. s)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local is_node_loaded = function(nodenames, node_pos)
|
||||||
|
n = minetest.env:get_node_or_nil(node_pos)
|
||||||
|
if (n == nil) or (n.name == 'ignore') then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
junglegrass_spawn_on_surfaces = function(growdelay, grownames, surfaces)
|
||||||
|
for _, surface in ipairs(surfaces) do
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = { surface.name },
|
||||||
|
interval = growdelay,
|
||||||
|
chance = surface.chance,
|
||||||
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
local p_top = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||||
|
local n_top = minetest.env:get_node(p_top)
|
||||||
|
local perlin = minetest.env:get_perlin(SEED, 3, 0.5, 150 ) -- using numbers suggested by Splizard
|
||||||
|
local noise = perlin:get2d({x=p_top.x, y=p_top.z})
|
||||||
|
if ( noise > ABUNDANCE )
|
||||||
|
and (n_top.name == "air")
|
||||||
|
and (is_node_loaded(grownames, p_top) == true)
|
||||||
|
and ((minetest.env:find_node_near(p_top, RADIUS, GRASSES) == nil ) or (surface.name == "default:cactus"))
|
||||||
|
then
|
||||||
|
local nnode = grownames[math.random(1, #grownames)]
|
||||||
|
dbg("Perlin noise value: "..noise)
|
||||||
|
dbg('Spawning '
|
||||||
|
.. nnode .. ' at ('
|
||||||
|
.. p_top.x .. ', '
|
||||||
|
.. p_top.y .. ', '
|
||||||
|
.. p_top.z .. ') on '
|
||||||
|
.. surface.name)
|
||||||
|
minetest.env:add_node(p_top, { name = nnode })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
grow_on_surfaces = function(growdelay, grownames, surfaces)
|
||||||
|
for _, surface in ipairs(surfaces) do
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = { surface.name },
|
||||||
|
interval = growdelay,
|
||||||
|
chance = surface.chance,
|
||||||
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
local p_top = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||||
|
local n_top = minetest.env:get_node(p_top)
|
||||||
|
local nnode = grownames[math.random(1, #grownames)]
|
||||||
|
|
||||||
|
if (is_node_loaded(grownames, p_top) == true) then
|
||||||
|
if (n_top.name == "junglegrass:shortest") then
|
||||||
|
dbg('Growing shortest into short at ('
|
||||||
|
.. p_top.x .. ', '
|
||||||
|
.. p_top.y .. ', '
|
||||||
|
.. p_top.z .. ') on '
|
||||||
|
.. surface.name)
|
||||||
|
minetest.env:add_node(p_top, { name = "junglegrass:short" })
|
||||||
|
end
|
||||||
|
|
||||||
|
if (surface.name == "default:desert_sand") then
|
||||||
|
if (n_top.name == "junglegrass:short") or (n_top.name == "junglegrass:medium") or (n_top.name == "default:junglegrass") then
|
||||||
|
dbg(nnode .. ' in desert turns to dry shrub at ('
|
||||||
|
.. p_top.x .. ', '
|
||||||
|
.. p_top.y .. ', '
|
||||||
|
.. p_top.z .. ') on '
|
||||||
|
.. surface.name)
|
||||||
|
minetest.env:add_node(p_top, { name = "default:dry_shrub" })
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if (n_top.name == "junglegrass:short") then
|
||||||
|
dbg('Growing short into medium at ('
|
||||||
|
.. p_top.x .. ', '
|
||||||
|
.. p_top.y .. ', '
|
||||||
|
.. p_top.z .. ') on '
|
||||||
|
.. surface.name)
|
||||||
|
minetest.env:add_node(p_top, { name = "junglegrass:medium" })
|
||||||
|
end
|
||||||
|
|
||||||
|
if (n_top.name == "junglegrass:medium") then
|
||||||
|
dbg('Growing medium into full size at ('
|
||||||
|
.. p_top.x .. ', '
|
||||||
|
.. p_top.y .. ', '
|
||||||
|
.. p_top.z .. ') on '
|
||||||
|
.. surface.name)
|
||||||
|
minetest.env:add_node(p_top, { name = "default:junglegrass" })
|
||||||
|
end
|
||||||
|
|
||||||
|
if (n_top.name == "default:junglegrass") then
|
||||||
|
dbg(nnode .. ' dies at ('
|
||||||
|
.. p_top.x .. ', '
|
||||||
|
.. p_top.y .. ', '
|
||||||
|
.. p_top.z .. ') on '
|
||||||
|
.. surface.name)
|
||||||
|
minetest.env:remove_node(p_top)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- On regular fertile ground, any size can spawn
|
||||||
|
|
||||||
|
junglegrass_spawn_on_surfaces(GROWING_DELAY, {
|
||||||
|
"junglegrass:shortest",
|
||||||
|
"junglegrass:short",
|
||||||
|
"junglegrass:medium",
|
||||||
|
"default:junglegrass",
|
||||||
|
}, {
|
||||||
|
{name = "default:dirt_with_grass", chance = 2},
|
||||||
|
{name = "default:dirt", chance = 2},
|
||||||
|
{name = "default:sand", chance = 5},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- On cactus, papyrus, and desert sand, only the two smallest sizes can spawn
|
||||||
|
|
||||||
|
junglegrass_spawn_on_surfaces(GROWING_DELAY, {
|
||||||
|
"junglegrass:shortest",
|
||||||
|
"junglegrass:short",
|
||||||
|
}, {
|
||||||
|
{name = "default:papyrus", chance = 1.5},
|
||||||
|
{name = "default:cactus", chance = 3},
|
||||||
|
{name = "default:desert_sand", chance = 10},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- make the grasses grow and die
|
||||||
|
|
||||||
|
grow_on_surfaces(GROWING_DELAY, {
|
||||||
|
"junglegrass:shortest",
|
||||||
|
"junglegrass:short",
|
||||||
|
"junglegrass:medium",
|
||||||
|
"default:junglegrass",
|
||||||
|
}, {
|
||||||
|
{name = "default:dirt_with_grass", chance = 5},
|
||||||
|
{name = "default:dirt", chance = 5},
|
||||||
|
{name = "default:sand", chance = 5},
|
||||||
|
{name = "default:desert_sand", chance = 20}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- The actual node definitions
|
||||||
|
|
||||||
|
minetest.register_node('junglegrass:medium', {
|
||||||
|
description = "Jungle Grass (medium height)",
|
||||||
|
drawtype = 'plantlike',
|
||||||
|
tile_images = { 'junglegrass_medium.png' },
|
||||||
|
inventory_image = 'junglegrass_medium.png',
|
||||||
|
wield_image = 'junglegrass_medium.png',
|
||||||
|
sunlight_propagates = true,
|
||||||
|
paramtype = 'light',
|
||||||
|
walkable = false,
|
||||||
|
groups = { snappy = 3,flammable=2 },
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
drop = 'default:junglegrass',
|
||||||
|
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.4, -0.5, -0.4, 0.4, 0.5, 0.4},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node('junglegrass:short', {
|
||||||
|
description = "Jungle Grass (short)",
|
||||||
|
drawtype = 'plantlike',
|
||||||
|
tile_images = { 'junglegrass_short.png' },
|
||||||
|
inventory_image = 'junglegrass_short.png',
|
||||||
|
wield_image = 'junglegrass_short.png',
|
||||||
|
sunlight_propagates = true,
|
||||||
|
paramtype = 'light',
|
||||||
|
walkable = false,
|
||||||
|
groups = { snappy = 3,flammable=2 },
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
drop = 'default:junglegrass',
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.4, -0.5, -0.4, 0.4, 0.3, 0.4},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node('junglegrass:shortest', {
|
||||||
|
description = "Jungle Grass (very short)",
|
||||||
|
drawtype = 'plantlike',
|
||||||
|
tile_images = { 'junglegrass_shortest.png' },
|
||||||
|
inventory_image = 'junglegrass_shortest.png',
|
||||||
|
wield_image = 'junglegrass_shortest.png',
|
||||||
|
sunlight_propagates = true,
|
||||||
|
paramtype = 'light',
|
||||||
|
walkable = false,
|
||||||
|
groups = { snappy = 3,flammable=2 },
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
drop = 'default:junglegrass',
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
print("[Junglegrass] Loaded!")
|
3
junglegrass/license.txt
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
All code is WTFPL.
|
||||||
|
All textures are cc-by-sa 3.0.
|
||||||
|
|
BIN
junglegrass/textures/junglegrass_medium.png
Normal file
After Width: | Height: | Size: 537 B |
BIN
junglegrass/textures/junglegrass_short.png
Normal file
After Width: | Height: | Size: 370 B |
BIN
junglegrass/textures/junglegrass_shortest.png
Normal file
After Width: | Height: | Size: 325 B |
|
@ -395,7 +395,7 @@ minetest.register_craft({
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'default:sandstone',
|
output = 'default:sandstone 4',
|
||||||
recipe = {
|
recipe = {
|
||||||
{'group:sand', 'group:sand'},
|
{'group:sand', 'group:sand'},
|
||||||
{'group:sand', 'group:sand'},
|
{'group:sand', 'group:sand'},
|
||||||
|
|
1
mods/junglegrass
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 796642f7f6fe403319b9ebe768752aa1e8831288
|
0
mods/vessels/README
Normal file
10
mods/vessels/changelog.txt
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
Changelog
|
||||||
|
---------
|
||||||
|
|
||||||
|
2012-07-26: Added a smelting step for recycling crafted items back into raw
|
||||||
|
materials. 2 Glass bottles/cups -> 1 "glass fragments" -> smelt into normal
|
||||||
|
glass block. 1 Steel bottle -> smelt to 1 steel ingot.
|
||||||
|
|
||||||
|
2012-07-26: Better bottle texture. Note that it is blended against the 50%
|
||||||
|
grey fields in the inventory display, so it will show artifacts if you try to
|
||||||
|
wield it. Don't do that. :-)
|
|
@ -1,10 +1,34 @@
|
||||||
-- Minetest 0.4 mod: vessels
|
-- Vessels Mod by Vanessa Ezekowitz ~~ 2012-07-26
|
||||||
-- See README.txt for licensing and other information.
|
--
|
||||||
|
-- License: LGPL
|
||||||
|
--
|
||||||
|
|
||||||
|
--========================================
|
||||||
|
-- Crafts
|
||||||
|
--
|
||||||
|
-- Glass bottle (yields 10)
|
||||||
|
--
|
||||||
|
-- G - G
|
||||||
|
-- G - G
|
||||||
|
-- - G -
|
||||||
|
--
|
||||||
|
-- Drinking Glass (yields 14)
|
||||||
|
--
|
||||||
|
-- G - G
|
||||||
|
-- G - G
|
||||||
|
-- G G G
|
||||||
|
--
|
||||||
|
-- Heavy Steel Bottle (yields 5)
|
||||||
|
--
|
||||||
|
-- S - S
|
||||||
|
-- S - S
|
||||||
|
-- - S -
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craftitem("vessels:glass_bottle", {
|
minetest.register_craftitem("vessels:glass_bottle", {
|
||||||
description = "Glass Bottle (empty)",
|
description = "Glass Bottle (empty)",
|
||||||
inventory_image = "vessels_glass_bottle.png",
|
inventory_image = "vessels_glass_bottle_inv.png",
|
||||||
groups = {vessel=1},
|
wield_image = "vessels_glass_bottle.png"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
|
@ -17,9 +41,9 @@ minetest.register_craft( {
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("vessels:drinking_glass", {
|
minetest.register_craftitem("vessels:drinking_glass", {
|
||||||
description = "Drinking Glass (empty)",
|
description = "Drinking Glass (empty)",
|
||||||
inventory_image = "vessels_drinking_glass.png",
|
inventory_image = "vessels_drinking_glass_inv.png",
|
||||||
groups = {vessel=1},
|
wield_image = "vessels_drinking_glass.png"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
|
@ -32,9 +56,9 @@ minetest.register_craft( {
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("vessels:steel_bottle", {
|
minetest.register_craftitem("vessels:steel_bottle", {
|
||||||
description = "Heavy Steel Bottle (empty)",
|
description = "Heavy Steel Bottle (empty)",
|
||||||
inventory_image = "vessels_steel_bottle.png",
|
inventory_image = "vessels_steel_bottle_inv.png",
|
||||||
groups = {vessel=1},
|
wield_image = "vessels_steel_bottle.png"
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
|
@ -50,8 +74,8 @@ minetest.register_craft( {
|
||||||
-- Make sure we can recycle them
|
-- Make sure we can recycle them
|
||||||
|
|
||||||
minetest.register_craftitem("vessels:glass_fragments", {
|
minetest.register_craftitem("vessels:glass_fragments", {
|
||||||
description = "Pile of Glass Fragments",
|
description = "Pile of Glass Fragments",
|
||||||
inventory_image = "vessels_glass_fragments.png",
|
inventory_image = "vessels_glass_fragments.png",
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft( {
|
minetest.register_craft( {
|
||||||
|
@ -84,3 +108,4 @@ minetest.register_craft( {
|
||||||
recipe = "vessels:steel_bottle",
|
recipe = "vessels:steel_bottle",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
print("[Vessels] Loaded!")
|
||||||
|
|
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 253 B |
BIN
mods/vessels/textures/vessels_drinking_glass_inv.png
Normal file
After Width: | Height: | Size: 338 B |
Before Width: | Height: | Size: 405 B After Width: | Height: | Size: 242 B |
BIN
mods/vessels/textures/vessels_glass_bottle_inv.png
Normal file
After Width: | Height: | Size: 405 B |
Before Width: | Height: | Size: 342 B After Width: | Height: | Size: 345 B |
BIN
mods/vessels/textures/vessels_steel_bottle_inv.png
Normal file
After Width: | Height: | Size: 342 B |