This commit is contained in:
tchncs 2015-12-26 21:44:42 +01:00
commit f8675b068f
102 changed files with 1456 additions and 981 deletions

View File

@ -1,23 +1,24 @@
The main game for the Minetest game engine [minetest_game] Minetest Game [minetest_game]
========================================================== =============================
The main subgame for the Minetest engine
========================================
To use this game with Minetest, insert this repository as To use this subgame with the Minetest engine, insert this repository as
/games/minetest_game /games/minetest_game
in the Minetest Engine.
The Minetest Engine can be found in: The Minetest engine can be found in:
https://github.com/minetest/minetest/ https://github.com/minetest/minetest/
Compatibility Compatibility
-------------- --------------
The minetest_game github master HEAD is generally compatible with the github The Minetest Game github master HEAD is generally compatible with the github
master HEAD of minetest. master HEAD of the Minetest engine.
Additionally, when the minetest engine is tagged to be a certain version (eg. Additionally, when the Minetest engine is tagged to be a certain version (eg.
0.4.10), minetest_game is tagged with the version too. 0.4.10), Minetest Game is tagged with the version too.
When stable releases are made, minetest_game is packaged and made available in When stable releases are made, Minetest Game is packaged and made available in
http://minetest.net/download http://minetest.net/download
and in case the repository has grown too much, it may be reset. In that sense, and in case the repository has grown too much, it may be reset. In that sense,
this is not a "real" git repository. (Package maintainers please note!) this is not a "real" git repository. (Package maintainers please note!)
@ -49,4 +50,4 @@ Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/ http://creativecommons.org/licenses/by-sa/3.0/
License of menu/header.png License of menu/header.png
Copyright (C) 2013 BlockMen CC BY-3.0 Copyright (C) 2015 paramat CC BY-SA 3.0

View File

@ -1 +1 @@
name = Minetest name = Minetest Game

View File

@ -1,11 +1,11 @@
minetest_game API Minetest Game API
====================== =================
GitHub Repo: https://github.com/minetest/minetest_game GitHub Repo: https://github.com/minetest/minetest_game
Introduction Introduction
------------ ------------
The minetest_game gamemode offers multiple new possibilities in addition to Minetest's built-in API, allowing you to The Minetest Game subgame offers multiple new possibilities in addition to the Minetest engine's built-in API,
add new plants to farming mod, buckets for new liquids, new stairs and custom panes. allowing you to add new plants to farming mod, buckets for new liquids, new stairs and custom panes.
For information on the Minetest API, visit https://github.com/minetest/minetest/blob/master/doc/lua_api.txt For information on the Minetest API, visit https://github.com/minetest/minetest/blob/master/doc/lua_api.txt
Please note: Please note:
[XYZ] refers to a section the Minetest API [XYZ] refers to a section the Minetest API
@ -17,23 +17,24 @@ Bucket API
The bucket API allows registering new types of buckets for non-default liquids. The bucket API allows registering new types of buckets for non-default liquids.
bucket.register_liquid( bucket.register_liquid(
"default:lava_source", -- Source node name "default:lava_source", -- name of the source node
"default:lava_flowing", -- Flowing node name "default:lava_flowing", -- name of the flowing node
"bucket:bucket_lava", -- Name to be used for bucket "bucket:bucket_lava", -- name of the new bucket item (or nil if liquid is not takeable)
"bucket_lava.png", -- Bucket texture (for wielditem and inventory_image) "bucket_lava.png", -- texture of the new bucket item (ignored if itemname == nil)
"Lava Bucket" -- Bucket description "Lava Bucket", -- text description of the bucket item
{lava_bucket = 1} -- groups of the bucket item, OPTIONAL
) )
Beds API Beds API
-------- --------
beds.register_bed( beds.register_bed(
"beds:bed", -- Bed name "beds:bed", -- Bed name
def: See [#Bed definition] -- Bed definition def: See [#Bed definition] -- Bed definition
) )
beds.read_spawns() -- returns a table containing players respawn positions beds.read_spawns() -- returns a table containing players respawn positions
beds.kick_players() -- forces all players to leave bed beds.kick_players() -- forces all players to leave bed
beds.skip_night() -- sets world time to morning and saves respawn position of all players currently sleeping beds.skip_night() -- sets world time to morning and saves respawn position of all players currently sleeping
#Bed definition #Bed definition
--------------- ---------------
@ -50,11 +51,11 @@ Beds API
} }
}, },
nodebox = { nodebox = {
bottom = regular nodebox, see [Node boxes], -- bottm part of bed bottom = regular nodebox, see [Node boxes], -- bottm part of bed
top = regular nodebox, see [Node boxes], -- top part of bed top = regular nodebox, see [Node boxes], -- top part of bed
}, },
selectionbox = regular nodebox, see [Node boxes], -- for both nodeboxes selectionbox = regular nodebox, see [Node boxes], -- for both nodeboxes
recipe = { -- Craft recipe recipe = { -- Craft recipe
{"group:wool", "group:wool", "group:wool"}, {"group:wool", "group:wool", "group:wool"},
{"group:wood", "group:wood", "group:wood"} {"group:wood", "group:wood", "group:wood"}
} }
@ -104,9 +105,9 @@ doors.register_trapdoor(name, def)
sound_open = sound to play when opening the trapdoor, OPTIONAL, sound_open = sound to play when opening the trapdoor, OPTIONAL,
sound_close = sound to play when closing the trapdoor, OPTIONAL, sound_close = sound to play when closing the trapdoor, OPTIONAL,
-> You can add any other node definition properties for minetest.register_node, -> You can add any other node definition properties for minetest.register_node,
such as wield_image, inventory_image, sounds, groups, description, ... such as wield_image, inventory_image, sounds, groups, description, ...
Only node_box, selection_box, tiles, drop, drawtype, paramtype, paramtype2, on_rightclick Only node_box, selection_box, tiles, drop, drawtype, paramtype, paramtype2, on_rightclick
will be overwritten by the trapdoor registration function will be overwritten by the trapdoor registration function
} }
Farming API Farming API
@ -122,11 +123,11 @@ farming.register_plant(name, Plant definition)
#Hoe Definition #Hoe Definition
--------------- ---------------
{ {
description = "", -- Description for tooltip description = "", -- Description for tooltip
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
max_uses = 30, -- Uses until destroyed max_uses = 30, -- Uses until destroyed
material = "", -- Material for recipes material = "", -- Material for recipes
recipe = { -- Craft recipe, if material isn't used recipe = { -- Craft recipe, if material isn't used
{"air", "air", "air"}, {"air", "air", "air"},
{"", "group:stick"}, {"", "group:stick"},
{"", "group:stick"}, {"", "group:stick"},
@ -136,12 +137,12 @@ farming.register_plant(name, Plant definition)
#Plant definition #Plant definition
----------------- -----------------
{ {
description = "", -- Description of seed item description = "", -- Description of seed item
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
steps = 8, -- How many steps the plant has to grow, until it can be harvested steps = 8, -- How many steps the plant has to grow, until it can be harvested
^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber) ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber)
minlight = 13, -- Minimum light to grow minlight = 13, -- Minimum light to grow
maxlight = default.LIGHT_MAX -- Maximum light to grow maxlight = default.LIGHT_MAX -- Maximum light to grow
} }
Screwdriver API Screwdriver API
@ -155,14 +156,14 @@ on_rotate(pos, node, user, mode, new_param2)
^ mode: screwdriver.ROTATE_FACE or screwdriver.ROTATE_AXIS ^ mode: screwdriver.ROTATE_FACE or screwdriver.ROTATE_AXIS
^ new_param2: the new value of param2 that would have been set if on_rotate wasn't there ^ new_param2: the new value of param2 that would have been set if on_rotate wasn't there
^ return value: false to disallow rotation, nil to keep default behaviour, true to allow ^ return value: false to disallow rotation, nil to keep default behaviour, true to allow
it but to indicate that changed have already been made (so the screwdriver will wear out) it but to indicate that changed have already been made (so the screwdriver will wear out)
^ use on_rotate = screwdriver.disallow to always disallow rotation ^ use on_rotate = screwdriver.disallow to always disallow rotation
^ use on_rotate = screwdriver.rotate_simple to allow only face rotation ^ use on_rotate = screwdriver.rotate_simple to allow only face rotation
Stairs API Stairs API
---------- ----------
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
delivered with minetest_game, to keep them compatible with other mods. delivered with Minetest Game, to keep them compatible with other mods.
stairs.register_stair(subname, recipeitem, groups, images, description, sounds) stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
-> Registers a stair. -> Registers a stair.
@ -215,10 +216,10 @@ The following nodes use the group `connect_to_raillike` and will only connect to
raillike nodes within this group and the same group value. raillike nodes within this group and the same group value.
Use `minetest.raillike_group(<Name>)` to get the group value. Use `minetest.raillike_group(<Name>)` to get the group value.
| Node type | Raillike group name | Node type | Raillike group name
+-----------------------+---------------------------------- +-----------------------+--------------------
| default:rail | "rail" | default:rail | "rail"
| tnt:gunpowder | "gunpowder" | tnt:gunpowder | "gunpowder"
| tnt:gunpowder_burning | "gunpowder" | tnt:gunpowder_burning | "gunpowder"
Example: Example:
@ -281,13 +282,13 @@ default.player_get_animation(player)
Model Definition Model Definition
---------------- ----------------
{ {
animation_speed = 30, -- Default animation speed, in FPS. animation_speed = 30, -- Default animation speed, in FPS.
textures = {"character.png", }, -- Default array of textures. textures = {"character.png", }, -- Default array of textures.
visual_size = {x=1, y=1,}, -- Used to scale the model. visual_size = {x = 1, y = 1}, -- Used to scale the model.
animations = { animations = {
-- <anim_name> = { x=<start_frame>, y=<end_frame>, }, -- <anim_name> = {x = <start_frame>, y = <end_frame>},
foo = { x= 0, y=19, }, foo = {x = 0, y = 19},
bar = { x=20, y=39, }, bar = {x = 20, y = 39},
-- ... -- ...
}, },
} }
@ -375,10 +376,22 @@ dye.excolors
Trees Trees
----- -----
default.grow_tree(pos, is_apple_tree) default.grow_tree(pos, is_apple_tree)
^ Grows a tree or apple tree at pos ^ Grows a mgv6 tree or apple tree at pos
default.grow_jungle_tree(pos) default.grow_jungle_tree(pos)
^ Grows a jungletree at pos ^ Grows a mgv6 jungletree at pos
default.grow_pine_tree(pos) default.grow_pine_tree(pos)
^ Grows a pinetree at pos ^ Grows a mgv6 pinetree at pos
default.grow_new_apple_tree(pos)
^ Grows a new design apple tree at pos
default.grow_new_jungle_tree(pos)
^ Grows a new design jungle tree at pos
default.grow_new_pine_tree(pos)
^ Grows a new design pine tree at pos
default.grow_new_acacia_tree(pos)
^ Grows a new design acacia tree at pos

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -1,6 +1,4 @@
# This file contains settings of minetest_game that can be changed in # This file contains settings of Minetest Game that can be changed in minetest.conf
# minetest.conf
#
# By default, all the settings are commented and not functional. # By default, all the settings are commented and not functional.
# Uncomment settings by removing the preceding #. # Uncomment settings by removing the preceding #.
@ -11,7 +9,8 @@
# 0 to disable # 0 to disable
#share_bones_time = 1200 #share_bones_time = 1200
# Whether fire should be disabled (all fire nodes will instantly disappear) # Whether standard fire should be disabled ('basic flame' nodes will disappear)
# 'permanent flame' nodes will remain with either setting
#disable_fire = false #disable_fire = false
# Whether steel tools, torches and cobblestone should be given to new players # Whether steel tools, torches and cobblestone should be given to new players
@ -22,3 +21,15 @@
# The radius of a TNT explosion # The radius of a TNT explosion
#tnt_radius = 3 #tnt_radius = 3
# Enable the stairs mod ABM that replaces the old 'upside down'
# stair and slab nodes in old maps with the new param2 versions.
#enable_stairs_replace_abm = false
# Whether you allow respawning in beds
# Default value is true
#enable_bed_respawn = true
# Whether players can skip night by sleeping
# Default value is true
#enable_bed_night_skip = true

View File

@ -1,18 +0,0 @@
1.0.1 beta
----------
- Add backwards compatibility with PilzAdam's beds mod
- Fix placement
- Fix small bugs
- Prevent possible crash
1.1
---
- Add fancy bed model (based on jp's model)
- Add API to register beds
- Allow players always to detach from bed (by donat-b)
- If more than 50% of players want sleep they can skip the night
- Don't show sleep dialog in singleplayer
1.1.1
-----
- Prevent possbile crash by trying to reposition leaving players

View File

@ -1,5 +1,5 @@
Minetest mod "Beds" Minetest Game mod: beds
=================== =======================
by BlockMen (c) 2014-2015 by BlockMen (c) 2014-2015
Version: 1.1.1 Version: 1.1.1
@ -14,7 +14,8 @@ if more than 50% of the players are lying in bed and use this option.
Another feature is a controled respawning. If you have slept in bed (not just lying in it) your respawn point Another feature is a controled respawning. If you have slept in bed (not just lying in it) your respawn point
is set to the beds location and you will respawn there after death. is set to the beds location and you will respawn there after death.
You can disable the respawn at beds by setting "enable_bed_respawn = false" in minetest.conf You can disable the respawn at beds by setting "enable_bed_respawn = false" in minetest.conf
You can also disable the night skip feature by setting "enable_bed_night_skip = false" in minetest.conf or by using
the /set command ingame.
License of source code, textures: WTFPL License of source code, textures: WTFPL

View File

@ -18,7 +18,6 @@ function beds.register_bed(name, def)
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = def.selectionbox, fixed = def.selectionbox,
}, },
after_place_node = function(pos, placer, itemstack) after_place_node = function(pos, placer, itemstack)
local n = minetest.get_node_or_nil(pos) local n = minetest.get_node_or_nil(pos)
@ -89,16 +88,13 @@ function beds.register_bed(name, def)
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
is_ground_content = false, is_ground_content = false,
pointable = false,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2}, groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = def.nodebox.top, fixed = def.nodebox.top,
}, },
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0},
},
}) })
minetest.register_alias(name, name .. "_bottom") minetest.register_alias(name, name .. "_bottom")

View File

@ -1,3 +1,4 @@
local pi = math.pi
local player_in_bed = 0 local player_in_bed = 0
local is_sp = minetest.is_singleplayer() local is_sp = minetest.is_singleplayer()
local enable_respawn = minetest.setting_getbool("enable_bed_respawn") local enable_respawn = minetest.setting_getbool("enable_bed_respawn")
@ -11,16 +12,24 @@ end
local function get_look_yaw(pos) local function get_look_yaw(pos)
local n = minetest.get_node(pos) local n = minetest.get_node(pos)
if n.param2 == 1 then if n.param2 == 1 then
return 7.9, n.param2 return pi/2, n.param2
elseif n.param2 == 3 then elseif n.param2 == 3 then
return 4.75, n.param2 return -pi/2, n.param2
elseif n.param2 == 0 then elseif n.param2 == 0 then
return 3.15, n.param2 return pi, n.param2
else else
return 6.28, n.param2 return 0, n.param2
end end
end end
local function is_night_skip_enabled()
local enable_night_skip = minetest.setting_getbool("enable_bed_night_skip")
if enable_night_skip == nil then
enable_night_skip = true
end
return enable_night_skip
end
local function check_in_beds(players) local function check_in_beds(players)
local in_bed = beds.player local in_bed = beds.player
if not players then if not players then
@ -101,7 +110,7 @@ local function update_formspecs(finished)
else else
form_n = beds.formspec .. form_n = beds.formspec ..
"label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]" "label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]"
if is_majority then if is_majority and is_night_skip_enabled() then
form_n = form_n .. form_n = form_n ..
"button_exit[2,8;4,0.75;force;Force night skip]" "button_exit[2,8;4,0.75;force;Force night skip]"
end end
@ -154,11 +163,13 @@ function beds.on_rightclick(pos, player)
-- skip the night and let all players stand up -- skip the night and let all players stand up
if check_in_beds() then if check_in_beds() then
minetest.after(2, function() minetest.after(2, function()
beds.skip_night()
if not is_sp then if not is_sp then
update_formspecs(true) update_formspecs(is_night_skip_enabled())
end
if is_night_skip_enabled() then
beds.skip_night()
beds.kick_players()
end end
beds.kick_players()
end) end)
end end
end end
@ -189,9 +200,11 @@ minetest.register_on_leaveplayer(function(player)
beds.player[name] = nil beds.player[name] = nil
if check_in_beds() then if check_in_beds() then
minetest.after(2, function() minetest.after(2, function()
beds.skip_night() update_formspecs(is_night_skip_enabled())
update_formspecs(true) if is_night_skip_enabled() then
beds.kick_players() beds.skip_night()
beds.kick_players()
end
end) end)
end end
end) end)
@ -206,8 +219,10 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
end end
if fields.force then if fields.force then
beds.skip_night() update_formspecs(is_night_skip_enabled())
update_formspecs(true) if is_night_skip_enabled() then
beds.kick_players() beds.skip_night()
beds.kick_players()
end
end end
end) end)

View File

@ -1,6 +1,6 @@
Minetest 0.4 mod: boats Minetest Game mod: boats
======================= ========================
by PilzAdam, slightly modified for NeXt by PilzAdam
License of source code: License of source code:
----------------------- -----------------------

View File

@ -1,4 +1,3 @@
-- --
-- Helper functions -- Helper functions
-- --
@ -8,6 +7,7 @@ local function is_water(pos)
return minetest.get_item_group(nn, "water") ~= 0 return minetest.get_item_group(nn, "water") ~= 0
end end
local function get_sign(i) local function get_sign(i)
if i == 0 then if i == 0 then
return 0 return 0
@ -16,12 +16,14 @@ local function get_sign(i)
end end
end end
local function get_velocity(v, yaw, y) local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v local z = math.cos(yaw) * v
return {x = x, y = y, z = z} return {x = x, y = y, z = z}
end end
local function get_v(v) local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2) return math.sqrt(v.x ^ 2 + v.z ^ 2)
end end
@ -32,7 +34,7 @@ end
local boat = { local boat = {
physical = true, physical = true,
collisionbox = {-0.5, -0.4, -0.5, 0.5, 0.3, 0.5}, collisionbox = {-0.5, -0.35, -0.5, 0.5, 0.3, 0.5},
visual = "mesh", visual = "mesh",
mesh = "boat.obj", mesh = "boat.obj",
textures = {"default_wood.png"}, textures = {"default_wood.png"},
@ -43,6 +45,7 @@ local boat = {
removed = false removed = false
} }
function boat.on_rightclick(self, clicker) function boat.on_rightclick(self, clicker)
if not clicker or not clicker:is_player() then if not clicker or not clicker:is_player() then
return return
@ -53,9 +56,23 @@ function boat.on_rightclick(self, clicker)
clicker:set_detach() clicker:set_detach()
default.player_attached[name] = false default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 30) default.player_set_animation(clicker, "stand" , 30)
local pos = clicker:getpos()
pos = {x = pos.x, y = pos.y + 0.2, z = pos.z}
minetest.after(0.1, function()
clicker:setpos(pos)
end)
elseif not self.driver then elseif not self.driver then
local attach = clicker:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
clicker:set_detach()
end
self.driver = clicker self.driver = clicker
clicker:set_attach(self.object, "", {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0}) clicker:set_attach(self.object, "",
{x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
default.player_attached[name] = true default.player_attached[name] = true
minetest.after(0.2, function() minetest.after(0.2, function()
default.player_set_animation(clicker, "sit" , 30) default.player_set_animation(clicker, "sit" , 30)
@ -64,6 +81,7 @@ function boat.on_rightclick(self, clicker)
end end
end end
function boat.on_activate(self, staticdata, dtime_s) function boat.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1}) self.object:set_armor_groups({immortal = 1})
if staticdata then if staticdata then
@ -72,11 +90,13 @@ function boat.on_activate(self, staticdata, dtime_s)
self.last_v = self.v self.last_v = self.v
end end
function boat.get_staticdata(self) function boat.get_staticdata(self)
return tostring(self.v) return tostring(self.v)
end end
function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, direction)
function boat.on_punch(self, puncher)
if not puncher or not puncher:is_player() or self.removed then if not puncher or not puncher:is_player() or self.removed then
return return
end end
@ -92,11 +112,17 @@ function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, d
self.object:remove() self.object:remove()
end) end)
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
puncher:get_inventory():add_item("main", "boats:boat") local inv = puncher:get_inventory()
if inv:room_for_item("main", "boats:boat") then
inv:add_item("main", "boats:boat")
else
minetest.add_item(self.object:getpos(), "boats:boat")
end
end end
end end
end end
function boat.on_step(self, dtime) function boat.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v) self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then if self.driver then
@ -149,7 +175,8 @@ function boat.on_step(self, dtime)
else else
new_acce = {x = 0, y = -9.8, z = 0} new_acce = {x = 0, y = -9.8, z = 0}
end end
new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y) new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
else else
p.y = p.y + 1 p.y = p.y + 1
@ -172,7 +199,8 @@ function boat.on_step(self, dtime)
self.object:setpos(pos) self.object:setpos(pos)
new_velo = get_velocity(self.v, self.object:getyaw(), 0) new_velo = get_velocity(self.v, self.object:getyaw(), 0)
else else
new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y) new_velo = get_velocity(self.v, self.object:getyaw(),
self.object:getvelocity().y)
self.object:setpos(self.object:getpos()) self.object:setpos(self.object:getpos())
end end
end end
@ -181,8 +209,10 @@ function boat.on_step(self, dtime)
self.object:setacceleration(new_acce) self.object:setacceleration(new_acce)
end end
minetest.register_entity("boats:boat", boat) minetest.register_entity("boats:boat", boat)
minetest.register_craftitem("boats:boat", { minetest.register_craftitem("boats:boat", {
description = "Boat", description = "Boat",
inventory_image = "boat_inventory.png", inventory_image = "boat_inventory.png",
@ -206,6 +236,7 @@ minetest.register_craftitem("boats:boat", {
end, end,
}) })
minetest.register_craft({ minetest.register_craft({
output = "boats:boat", output = "boats:boat",
recipe = { recipe = {
@ -214,4 +245,3 @@ minetest.register_craft({
{"group:wood", "group:wood", "group:wood"}, {"group:wood", "group:wood", "group:wood"},
}, },
}) })

View File

@ -1,5 +1,5 @@
Minetest 0.4 mod: bones Minetest Game mod: bones
======================= ========================
License of source code: License of source code:
----------------------- -----------------------

View File

@ -76,6 +76,10 @@ minetest.register_node("bones:bones", {
return return
end end
if(minetest.get_meta(pos):get_string("infotext") == "") then
return
end
local inv = minetest.get_meta(pos):get_inventory() local inv = minetest.get_meta(pos):get_inventory()
local player_inv = player:get_inventory() local player_inv = player:get_inventory()
local has_space = true local has_space = true
@ -93,6 +97,11 @@ minetest.register_node("bones:bones", {
-- remove bones if player emptied them -- remove bones if player emptied them
if has_space then if has_space then
if player_inv:room_for_item("main", {name = "bones:bones"}) then
player_inv:add_item("main", {name = "bones:bones"})
else
minetest.add_item(pos,"bones:bones")
end
minetest.remove_node(pos) minetest.remove_node(pos)
end end
end, end,

View File

@ -1,4 +1,4 @@
Minetest 0.4 mod: bucket Minetest Game mod: bucket
========================= =========================
License of source code: License of source code:

BIN
mods/bucket/textures/bucket.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

After

Width:  |  Height:  |  Size: 221 B

View File

@ -1,5 +1,5 @@
Minetest 0.4 mod: creative Minetest Game mod: creative
========================== ===========================
Implements creative mode. Implements creative mode.

View File

@ -1,11 +1,16 @@
-- minetest/creative/init.lua -- minetest/creative/init.lua
creative_inventory = {} creative_inventory = {}
creative_inventory.creative_inventory_size = 0
-- Create detached creative inventory after loading all mods -- Create detached creative inventory after loading all mods
minetest.after(0, function() creative_inventory.init_creative_inventory = function(player)
local inv = minetest.create_detached_inventory("creative", { local player_name = player:get_player_name()
creative_inventory[player_name] = {}
creative_inventory[player_name].size = 0
creative_inventory[player_name].filter = nil
creative_inventory[player_name].start_i = 1
local inv = minetest.create_detached_inventory("creative_" .. player_name, {
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
if minetest.setting_getbool("creative_mode") then if minetest.setting_getbool("creative_mode") then
return count return count
@ -35,21 +40,29 @@ minetest.after(0, function()
end end
end, end,
}) })
creative_inventory.update(player_name, nil)
--print("creative inventory size: "..dump(creative_inventory.creative_inventory_size))
end
function creative_inventory.update(player_name, filter)
local creative_list = {} local creative_list = {}
for name,def in pairs(minetest.registered_items) do local inv = minetest.get_inventory({type = "detached", name = "creative_" .. player_name})
if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0)
and def.description and def.description ~= "" then for name, def in pairs(minetest.registered_items) do
table.insert(creative_list, name) if not (def.groups.not_in_creative_inventory == 1) and
def.description and def.description ~= "" then
if (filter and def.name:find(filter, 1, true)) or not filter then
creative_list[#creative_list+1] = name
end
end end
end end
table.sort(creative_list) table.sort(creative_list)
inv:set_size("main", #creative_list) inv:set_size("main", #creative_list)
for _,itemstring in ipairs(creative_list) do inv:set_list("main", creative_list)
inv:add_item("main", ItemStack(itemstring)) creative_inventory[player_name].size = #creative_list
end end
creative_inventory.creative_inventory_size = #creative_list
--print("creative inventory size: "..dump(creative_inventory.creative_inventory_size))
end)
-- Create the trash field -- Create the trash field
local trash = minetest.create_detached_inventory("creative_trash", { local trash = minetest.create_detached_inventory("creative_trash", {
@ -68,10 +81,12 @@ local trash = minetest.create_detached_inventory("creative_trash", {
}) })
trash:set_size("main", 1) trash:set_size("main", 1)
creative_inventory.set_creative_formspec = function(player, start_i, pagenum) creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
local player_name = player:get_player_name()
local filter = creative_inventory[player_name].filter or ""
pagenum = math.floor(pagenum) pagenum = math.floor(pagenum)
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1) local pagemax = math.floor((creative_inventory[player_name].size - 1) / (6*4) + 1)
player:set_inventory_formspec( player:set_inventory_formspec(
"size[13,7.5]".. "size[13,7.5]"..
--"image[6,0.6;1,2;player.png]".. --"image[6,0.6;1,2;player.png]"..
@ -83,51 +98,67 @@ creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
"list[current_player;craft;8,0;3,3;]".. "list[current_player;craft;8,0;3,3;]"..
"list[current_player;craftpreview;12,1;1,1;]".. "list[current_player;craftpreview;12,1;1,1;]"..
"image[11,1;1,1;gui_furnace_arrow_bg.png^[transformR270]".. "image[11,1;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]".. "list[detached:creative_" .. player_name .. ";main;0.05,1;4,6;" .. tostring(start_i) .. "]"..
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]".. "tablecolumns[color;text;color;text]"..
"button[0.3,6.5;1.6,1;creative_prev;<<]".. "tableoptions[background=#00000000;highlight=#00000000;border=false]"..
"button[2.7,6.5;1.6,1;creative_next;>>]".. "table[1.4,7.2;1.1,0.5;pagenum;#FFFF00," .. tostring(pagenum) .. ",#FFFFFF,/ " .. tostring(pagemax) .. "]"..
"button[0,7;1,1;creative_prev;<<]"..
"button[3.08,7;1,1;creative_next;>>]"..
"button[2.55,0.2;0.8,0.5;search;?]"..
"button[3.3,0.2;0.8,0.5;clear;X]"..
"tooltip[search;Search]"..
"tooltip[clear;Reset]"..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[current_player;craft]".. "listring[current_player;craft]"..
"listring[current_player;main]".. "listring[current_player;main]"..
"listring[detached:creative;main]".. "listring[detached:creative_" .. player_name .. ";main]"..
"label[5,1.5;Trash:]".. "label[5,1.5;Trash:]"..
"list[detached:creative_trash;main;5,2;1,1;]".. "list[detached:creative_trash;main;5,2;1,1;]"..
"field[0.3,0.3;2.6,1;filter;;" .. filter .. "]"..
default.get_hotbar_bg(5,3.5) default.get_hotbar_bg(5,3.5)
) )
end end
minetest.register_on_joinplayer(function(player) minetest.register_on_joinplayer(function(player)
-- If in creative mode, modify player's inventory forms -- If in creative mode, modify player's inventory forms
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
return return
end end
creative_inventory.init_creative_inventory(player)
creative_inventory.set_creative_formspec(player, 0, 1) creative_inventory.set_creative_formspec(player, 0, 1)
end) end)
minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.register_on_player_receive_fields(function(player, formname, fields)
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
return return
end end
-- Figure out current page from formspec -- Figure out current page from formspec
local current_page = 0 local current_page = 0
local player_name = player:get_player_name()
local formspec = player:get_inventory_formspec() local formspec = player:get_inventory_formspec()
local start_i = string.match(formspec, "list%[detached:creative;main;[%d.]+,[%d.]+;[%d.]+,[%d.]+;(%d+)%]") local start_i = formspec:match("list%[detached:creative_" .. player_name .. ";main;[%d.]+,[%d.]+;[%d.]+,[%d.]+;(%d+)%]")
start_i = tonumber(start_i) or 0 start_i = tonumber(start_i) or 0
if fields.creative_prev then if fields.creative_prev or start_i >= creative_inventory[player_name].size then
start_i = start_i - 4*6 start_i = start_i - 4*6
end elseif fields.creative_next or start_i < 0 then
if fields.creative_next then
start_i = start_i + 4*6 start_i = start_i + 4*6
end end
if start_i < 0 then if fields.search or fields.clear then
start_i = start_i + 4*6 if fields.clear then
end creative_inventory[player_name].filter = ""
if start_i >= creative_inventory.creative_inventory_size then creative_inventory.update(player_name, nil)
start_i = start_i - 4*6 else
creative_inventory[player_name].filter = fields.filter:lower()
creative_inventory.update(player_name, fields.filter:lower())
end
minetest.after(0, function()
creative_inventory.set_creative_formspec(player, 0, 1)
end)
end end
if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then if start_i < 0 or start_i >= creative_inventory[player_name].size then
start_i = 0 start_i = 0
end end
@ -165,7 +196,7 @@ if minetest.setting_getbool("creative_mode") then
end end
local inv = digger:get_inventory() local inv = digger:get_inventory()
if inv then if inv then
for _,item in ipairs(drops) do for _, item in ipairs(drops) do
item = ItemStack(item):get_name() item = ItemStack(item):get_name()
if not inv:contains_item("main", item) then if not inv:contains_item("main", item) then
inv:add_item("main", item) inv:add_item("main", item)
@ -173,5 +204,4 @@ if minetest.setting_getbool("creative_mode") then
end end
end end
end end
end end

View File

@ -1,4 +1,4 @@
Minetest 0.4 mod: default Minetest Game mod: default
========================== ==========================
License of source code: License of source code:
@ -24,7 +24,6 @@ Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
Cisoun's WTFPL texture pack: Cisoun's WTFPL texture pack:
default_jungletree.png default_jungletree.png
default_jungletree_top.png
default_lava.png default_lava.png
default_leaves.png default_leaves.png
default_sapling.png default_sapling.png
@ -59,8 +58,8 @@ VanessaE (WTFPL):
default_nc_side.png default_nc_side.png
default_desert_sand.png default_desert_sand.png
default_desert_stone.png default_desert_stone.png
default_desert_stone_brick.png
default_sand.png default_sand.png
default_jungletree_top.png
Calinou (CC BY-SA): Calinou (CC BY-SA):
default_brick.png default_brick.png
@ -77,7 +76,6 @@ Jordach (CC BY-SA 3.0):
PilzAdam (WTFPL): PilzAdam (WTFPL):
default_jungleleaves.png default_jungleleaves.png
default_junglesapling.png default_junglesapling.png
default_junglewood.png
default_obsidian_glass.png default_obsidian_glass.png
default_obsidian_shard.png default_obsidian_shard.png
default_mineral_gold.png default_mineral_gold.png
@ -119,12 +117,16 @@ paramat (CC BY-SA 3.0):
default_dry_grass.png default_dry_grass.png
default_dry_grass_side.png default_dry_grass_side.png
default_dry_grass_*.png default_dry_grass_*.png
default_junglewood.png, derived from a texture by BlockMen (CC BY-SA 3.0)
default_grass.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_grass_side.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_stone_brick.png, derived from a texture by Cisoun (WTFPL)
default_desert_stone_brick.png, derived from a texture by VanessaE (WTFPL)
brunob.santos (CC BY-SA 4.0): brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png default_desert_cobble.png
BlockMen (CC BY-SA 3.0): BlockMen (CC BY-SA 3.0):
default_stone_brick.png
default_wood.png default_wood.png
default_clay_brick.png default_clay_brick.png
default_iron_ingot.png default_iron_ingot.png
@ -146,6 +148,9 @@ BlockMen (CC BY-SA 3.0):
heart.png heart.png
gui_*.png gui_*.png
sofar (CC BY-SA 3.0):
default_book_written.png, based on default_book.png
Neuromancer (CC BY-SA 2.0): Neuromancer (CC BY-SA 2.0):
default_cobble.png, based on texture by Brane praefect default_cobble.png, based on texture by Brane praefect
default_mossycobble.png, based on texture by Brane praefect default_mossycobble.png, based on texture by Brane praefect
@ -153,10 +158,6 @@ Neuromancer (CC BY-SA 3.0):
default_dirt.png default_dirt.png
default_furnace_*.png default_furnace_*.png
Philipbenr (CC BY-SA 3.0):
default_grass.png
default_grass_side.png
Gambit (WTFPL): Gambit (WTFPL):
default_bronze_ingot.png default_bronze_ingot.png
default_copper_ingot.png default_copper_ingot.png

View File

@ -68,5 +68,9 @@ minetest.register_alias("steel_ingot", "default:steel_ingot")
minetest.register_alias("clay_brick", "default:clay_brick") minetest.register_alias("clay_brick", "default:clay_brick")
minetest.register_alias("snow", "default:snow") minetest.register_alias("snow", "default:snow")
-- Mese now comes in the form of blocks, ore, crystal and fragments -- 'mese_block' was used for a while for the block form of mese
minetest.register_alias("default:mese_block", "default:mese") minetest.register_alias("default:mese_block", "default:mese")
-- Aliases for corrected pine node names
minetest.register_alias("default:pinetree", "default:pine_tree")
minetest.register_alias("default:pinewood", "default:pine_wood")

View File

@ -15,9 +15,9 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = 'default:pinewood 4', output = 'default:pine_wood 4',
recipe = { recipe = {
{'default:pinetree'}, {'default:pine_tree'},
} }
}) })

View File

@ -30,7 +30,8 @@ local function book_on_use(itemstack, user, pointed_thing)
formspec = "size[8,8]"..default.gui_bg.. formspec = "size[8,8]"..default.gui_bg..
"label[0.5,0.5;by "..owner.."]".. "label[0.5,0.5;by "..owner.."]"..
"label[0.5,0;"..minetest.formspec_escape(title).."]".. "label[0.5,0;"..minetest.formspec_escape(title).."]"..
"textarea[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text)..";]" "tableoptions[background=#00000000;highlight=#00000000;border=false]"..
"table[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text):gsub("\n", ",")..";1]"
end end
minetest.show_formspec(user:get_player_name(), "default:book", formspec) minetest.show_formspec(user:get_player_name(), "default:book", formspec)
end end
@ -81,7 +82,7 @@ minetest.register_craftitem("default:book", {
minetest.register_craftitem("default:book_written", { minetest.register_craftitem("default:book_written", {
description = "Book With Text", description = "Book With Text",
inventory_image = "default_book.png", inventory_image = "default_book_written.png",
groups = {book=1, not_in_creative_inventory=1}, groups = {book=1, not_in_creative_inventory=1},
stack_max = 1, stack_max = 1,
on_use = book_on_use, on_use = book_on_use,

View File

@ -105,6 +105,7 @@ minetest.register_abm({
neighbors = {"group:water"}, neighbors = {"group:water"},
interval = 1, interval = 1,
chance = 2, chance = 2,
catch_up = false,
action = function(...) action = function(...)
default.cool_lava_flowing(...) default.cool_lava_flowing(...)
end, end,
@ -115,6 +116,7 @@ minetest.register_abm({
neighbors = {"group:water"}, neighbors = {"group:water"},
interval = 1, interval = 1,
chance = 2, chance = 2,
catch_up = false,
action = function(...) action = function(...)
default.cool_lava_source(...) default.cool_lava_source(...)
end, end,
@ -184,7 +186,7 @@ minetest.register_abm({
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:papyrus"}, nodenames = {"default:papyrus"},
neighbors = {"default:dirt", "default:dirt_with_grass"}, neighbors = {"default:dirt", "default:dirt_with_grass", "default:sand"},
interval = 50, interval = 50,
chance = 20, chance = 20,
action = function(...) action = function(...)
@ -306,13 +308,14 @@ minetest.register_abm({
-- --
-- Grass growing -- Grass growing on well-lit dirt
-- --
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:dirt"}, nodenames = {"default:dirt"},
interval = 2, interval = 2,
chance = 200, chance = 200,
catch_up = false,
action = function(pos, node) action = function(pos, node)
local above = {x = pos.x, y = pos.y + 1, z = pos.z} local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name local name = minetest.get_node(above).name
@ -329,10 +332,16 @@ minetest.register_abm({
end end
}) })
--
-- Grass and dry grass removed in darkness
--
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"}, nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
interval = 2, interval = 2,
chance = 20, chance = 20,
catch_up = false,
action = function(pos, node) action = function(pos, node)
local above = {x = pos.x, y = pos.y + 1, z = pos.z} local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name local name = minetest.get_node(above).name
@ -345,3 +354,18 @@ minetest.register_abm({
end end
}) })
--
-- Moss growth on cobble near water
--
minetest.register_abm({
nodenames = {"default:cobble"},
neighbors = {"group:water"},
interval = 17,
chance = 200,
catch_up = false,
action = function(pos, node)
minetest.set_node(pos, {name = "default:mossycobble"})
end
})

View File

@ -26,7 +26,7 @@ minetest.register_alias("mapgen_apple", "default:apple")
minetest.register_alias("mapgen_jungletree", "default:jungletree") minetest.register_alias("mapgen_jungletree", "default:jungletree")
minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves") minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves")
minetest.register_alias("mapgen_junglegrass", "default:junglegrass") minetest.register_alias("mapgen_junglegrass", "default:junglegrass")
minetest.register_alias("mapgen_pinetree", "default:pinetree") minetest.register_alias("mapgen_pine_tree", "default:pine_tree")
minetest.register_alias("mapgen_pine_needles", "default:pine_needles") minetest.register_alias("mapgen_pine_needles", "default:pine_needles")
-- Dungeons -- Dungeons
@ -50,84 +50,85 @@ function default.register_ores()
-- Clay -- Clay
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:clay", ore = "default:clay",
wherein = {"default:sand"}, wherein = {"default:sand"},
clust_scarcity = 24 * 24 * 24, clust_scarcity = 16 * 16 * 16,
clust_size = 7, clust_size = 5,
y_min = -15, y_min = -15,
y_max = 0, y_max = 0,
noise_threshhold = 0, noise_threshold = 0.0,
noise_params = { noise_params = {
offset = 0.35, offset = 0.5,
scale = 0.2, scale = 0.2,
spread = {x = 5, y = 5, z = 5}, spread = {x = 5, y = 5, z = 5},
seed = -316, seed = -316,
octaves = 1, octaves = 1,
persist = 0.5 persist = 0.0
}, },
}) })
-- Sand -- Sand
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:sand", ore = "default:sand",
wherein = {"default:stone"}, wherein = {"default:stone", "default:sandstone",
clust_scarcity = 24 * 24 * 24, "default:desert_stone"},
clust_size = 7, clust_scarcity = 16 * 16 * 16,
y_min = -63, clust_size = 5,
y_max = 4, y_min = -31,
noise_threshhold = 0, y_max = 4,
noise_params = { noise_threshold = 0.0,
offset = 0.35, noise_params = {
offset = 0.5,
scale = 0.2, scale = 0.2,
spread = {x = 5, y = 5, z = 5}, spread = {x = 5, y = 5, z = 5},
seed = 2316, seed = 2316,
octaves = 1, octaves = 1,
persist = 0.5 persist = 0.0
}, },
}) })
-- Dirt -- Dirt
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:dirt", ore = "default:dirt",
wherein = {"default:stone"}, wherein = {"default:stone", "default:sandstone"},
clust_scarcity = 24 * 24 * 24, clust_scarcity = 16 * 16 * 16,
clust_size = 7, clust_size = 5,
y_min = -63, y_min = -31,
y_max = 31000, y_max = 31000,
noise_threshhold = 0, noise_threshold = 0.0,
noise_params = { noise_params = {
offset = 0.35, offset = 0.5,
scale = 0.2, scale = 0.2,
spread = {x = 5, y = 5, z = 5}, spread = {x = 5, y = 5, z = 5},
seed = 17676, seed = 17676,
octaves = 1, octaves = 1,
persist = 0.5 persist = 0.0
}, },
}) })
-- Gravel -- Gravel
minetest.register_ore({ minetest.register_ore({
ore_type = "blob", ore_type = "blob",
ore = "default:gravel", ore = "default:gravel",
wherein = {"default:stone"}, wherein = {"default:stone"},
clust_scarcity = 24 * 24 * 24, clust_scarcity = 16 * 16 * 16,
clust_size = 7, clust_size = 5,
y_min = -31000, y_min = -31000,
y_max = 31000, y_max = 31000,
noise_threshhold = 0, noise_threshold = 0.0,
noise_params = { noise_params = {
offset = 0.35, offset = 0.5,
scale = 0.2, scale = 0.2,
spread = {x = 5, y = 5, z = 5}, spread = {x = 5, y = 5, z = 5},
seed = 766, seed = 766,
octaves = 1, octaves = 1,
persist = 0.5 persist = 0.0
}, },
}) })
@ -330,11 +331,12 @@ function default.register_biomes()
depth_filler = 3, depth_filler = 3,
node_stone = "default:ice", node_stone = "default:ice",
node_water_top = "default:ice", node_water_top = "default:ice",
depth_water_top = 8, depth_water_top = 10,
--node_water = "", --node_water = "",
y_min = -6, node_river_water = "default:ice",
y_min = -8,
y_max = 31000, y_max = 31000,
heat_point = -5, heat_point = 0,
humidity_point = 50, humidity_point = 50,
}) })
@ -344,14 +346,15 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = -7, y_max = -9,
heat_point = -5, heat_point = 0,
humidity_point = 50, humidity_point = 50,
}) })
@ -359,19 +362,20 @@ function default.register_biomes()
minetest.register_biome({ minetest.register_biome({
name = "tundra", name = "tundra",
node_dust = "default:snow", --node_dust = "",
node_top = "default:dirt_with_snow", node_top = "default:dirt_with_snow",
depth_top = 1, depth_top = 1,
node_filler = "default:dirt", node_filler = "default:dirt",
depth_filler = 0, depth_filler = 1,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = 2, y_min = 2,
y_max = 31000, y_max = 31000,
heat_point = 20, heat_point = 15,
humidity_point = 30, humidity_point = 35,
}) })
minetest.register_biome({ minetest.register_biome({
@ -380,32 +384,35 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = 1, y_max = 1,
heat_point = 20, heat_point = 15,
humidity_point = 30, humidity_point = 35,
}) })
minetest.register_biome({ minetest.register_biome({
name = "taiga", name = "taiga",
node_dust = "default:snow", node_dust = "default:snow",
node_top = "default:snowblock", node_top = "default:dirt_with_snow",
depth_top = 1, depth_top = 1,
node_filler = "default:dirt", node_filler = "default:dirt",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = 2, y_min = 2,
y_max = 31000, y_max = 31000,
heat_point = 20, heat_point = 15,
humidity_point = 70, humidity_point = 65,
}) })
minetest.register_biome({ minetest.register_biome({
@ -414,18 +421,19 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = 1, y_max = 1,
heat_point = 20, heat_point = 15,
humidity_point = 70, humidity_point = 65,
}) })
-- Cool -- Temperate
minetest.register_biome({ minetest.register_biome({
name = "stone_grassland", name = "stone_grassland",
@ -433,15 +441,34 @@ function default.register_biomes()
node_top = "default:dirt_with_grass", node_top = "default:dirt_with_grass",
depth_top = 1, depth_top = 1,
node_filler = "default:dirt", node_filler = "default:dirt",
depth_filler = 0, depth_filler = 1,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = 6, y_min = 6,
y_max = 31000, y_max = 31000,
heat_point = 45, heat_point = 40,
humidity_point = 30, humidity_point = 35,
})
minetest.register_biome({
name = "stone_grassland_dunes",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
y_min = 5,
y_max = 5,
heat_point = 40,
humidity_point = 35,
}) })
minetest.register_biome({ minetest.register_biome({
@ -450,32 +477,53 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = 5, y_max = 4,
heat_point = 45, heat_point = 40,
humidity_point = 30, humidity_point = 35,
}) })
minetest.register_biome({ minetest.register_biome({
name = "coniferous_forest", name = "coniferous_forest",
--node_dust = "", --node_dust = "",
node_top = "default:dirt_with_grass", node_top = "default:dirt_with_grass",
depth_top = 1, depth_top = 1,
node_filler = "default:dirt", node_filler = "default:dirt",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = 6, y_min = 6,
y_max = 31000, y_max = 31000,
heat_point = 45, heat_point = 40,
humidity_point = 70, humidity_point = 65,
})
minetest.register_biome({
name = "coniferous_forest_dunes",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 3,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
y_min = 5,
y_max = 5,
heat_point = 40,
humidity_point = 65,
}) })
minetest.register_biome({ minetest.register_biome({
@ -484,18 +532,18 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = 5, y_max = 4,
heat_point = 45, heat_point = 40,
humidity_point = 70, humidity_point = 65,
}) })
-- Warm
minetest.register_biome({ minetest.register_biome({
name = "sandstone_grassland", name = "sandstone_grassland",
@ -503,15 +551,34 @@ function default.register_biomes()
node_top = "default:dirt_with_grass", node_top = "default:dirt_with_grass",
depth_top = 1, depth_top = 1,
node_filler = "default:dirt", node_filler = "default:dirt",
depth_filler = 0, depth_filler = 1,
node_stone = "default:sandstone", node_stone = "default:sandstone",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = 6, y_min = 6,
y_max = 31000, y_max = 31000,
heat_point = 70, heat_point = 60,
humidity_point = 30, humidity_point = 35,
})
minetest.register_biome({
name = "sandstone_grassland_dunes",
--node_dust = "",
node_top = "default:sand",
depth_top = 1,
node_filler = "default:sand",
depth_filler = 2,
node_stone = "default:sandstone",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
y_min = 5,
y_max = 5,
heat_point = 60,
humidity_point = 35,
}) })
minetest.register_biome({ minetest.register_biome({
@ -520,32 +587,53 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
node_stone = "default:sandstone", node_stone = "default:sandstone",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = 5, y_max = 4,
heat_point = 70, heat_point = 60,
humidity_point = 30, humidity_point = 35,
}) })
minetest.register_biome({ minetest.register_biome({
name = "deciduous_forest", name = "deciduous_forest",
--node_dust = "", --node_dust = "",
node_top = "default:dirt_with_grass", node_top = "default:dirt_with_grass",
depth_top = 1, depth_top = 1,
node_filler = "default:dirt", node_filler = "default:dirt",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
y_min = 6, --node_river_water = "",
y_min = 1,
y_max = 31000, y_max = 31000,
heat_point = 70, heat_point = 60,
humidity_point = 70, humidity_point = 65,
})
minetest.register_biome({
name = "deciduous_forest_swamp",
--node_dust = "",
node_top = "default:dirt",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
y_min = -3,
y_max = 0,
heat_point = 60,
humidity_point = 65,
}) })
minetest.register_biome({ minetest.register_biome({
@ -554,15 +642,16 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = 5, y_max = -4,
heat_point = 70, heat_point = 60,
humidity_point = 70, humidity_point = 65,
}) })
-- Hot -- Hot
@ -578,10 +667,11 @@ function default.register_biomes()
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
y_min = 1, --node_river_water = "",
y_min = 5,
y_max = 31000, y_max = 31000,
heat_point = 95, heat_point = 85,
humidity_point = 10, humidity_point = 20,
}) })
minetest.register_biome({ minetest.register_biome({
@ -590,17 +680,19 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
node_stone = "default:desert_stone", node_stone = "default:desert_stone",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = 0, y_max = 4,
heat_point = 95, heat_point = 85,
humidity_point = 10, humidity_point = 20,
}) })
minetest.register_biome({ minetest.register_biome({
name = "savanna", name = "savanna",
--node_dust = "", --node_dust = "",
@ -612,9 +704,28 @@ function default.register_biomes()
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
y_min = 5, --node_river_water = "",
y_min = 1,
y_max = 31000, y_max = 31000,
heat_point = 95, heat_point = 85,
humidity_point = 50,
})
minetest.register_biome({
name = "savanna_swamp",
--node_dust = "",
node_top = "default:dirt",
depth_top = 1,
node_filler = "default:dirt",
depth_filler = 3,
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
--node_river_water = "",
y_min = -3,
y_max = 0,
heat_point = 85,
humidity_point = 50, humidity_point = 50,
}) })
@ -624,32 +735,35 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = 4, y_max = -4,
heat_point = 95, heat_point = 85,
humidity_point = 50, humidity_point = 50,
}) })
minetest.register_biome({ minetest.register_biome({
name = "rainforest", name = "rainforest",
--node_dust = "", --node_dust = "",
node_top = "default:dirt_with_grass", node_top = "default:dirt_with_grass",
depth_top = 1, depth_top = 1,
node_filler = "default:dirt", node_filler = "default:dirt",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = 1, y_min = 1,
y_max = 31000, y_max = 31000,
heat_point = 95, heat_point = 85,
humidity_point = 90, humidity_point = 80,
}) })
minetest.register_biome({ minetest.register_biome({
@ -658,15 +772,16 @@ function default.register_biomes()
node_top = "default:dirt", node_top = "default:dirt",
depth_top = 1, depth_top = 1,
node_filler = "default:dirt", node_filler = "default:dirt",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
y_min = 0, --node_river_water = "",
y_min = -3,
y_max = 0, y_max = 0,
heat_point = 95, heat_point = 85,
humidity_point = 90, humidity_point = 80,
}) })
minetest.register_biome({ minetest.register_biome({
@ -675,15 +790,16 @@ function default.register_biomes()
node_top = "default:sand", node_top = "default:sand",
depth_top = 1, depth_top = 1,
node_filler = "default:sand", node_filler = "default:sand",
depth_filler = 2, depth_filler = 3,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -112, y_min = -112,
y_max = -1, y_max = -4,
heat_point = 95, heat_point = 85,
humidity_point = 90, humidity_point = 80,
}) })
-- Underground -- Underground
@ -692,13 +808,14 @@ function default.register_biomes()
name = "underground", name = "underground",
--node_dust = "", --node_dust = "",
--node_top = "", --node_top = "",
depth_top = 0, --depth_top = ,
--node_filler = "", --node_filler = "",
depth_filler = -4, --depth_filler = ,
--node_stone = "", --node_stone = "",
--node_water_top = "", --node_water_top = "",
--depth_water_top = , --depth_water_top = ,
--node_water = "", --node_water = "",
--node_river_water = "",
y_min = -31000, y_min = -31000,
y_max = -113, y_max = -113,
heat_point = 50, heat_point = 50,
@ -721,7 +838,7 @@ function default.register_mgv6_decorations()
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_grass"},
sidelen = 8, sidelen = 16,
noise_params = { noise_params = {
offset = -0.3, offset = -0.3,
scale = 0.7, scale = 0.7,
@ -734,7 +851,7 @@ function default.register_mgv6_decorations()
y_max = 1, y_max = 1,
decoration = "default:papyrus", decoration = "default:papyrus",
height = 2, height = 2,
height_max = 4, height_max = 4,
spawn_by = "default:water_source", spawn_by = "default:water_source",
num_spawn_by = 1, num_spawn_by = 1,
}) })
@ -811,38 +928,36 @@ local function register_grass_decoration(offset, scale, length)
noise_params = { noise_params = {
offset = offset, offset = offset,
scale = scale, scale = scale,
spread = {x=200, y=200, z=200}, spread = {x = 200, y = 200, z = 200},
seed = 329, seed = 329,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = { biomes = {"stone_grassland", "sandstone_grassland",
"stone_grassland", "stone_grassland_ocean", "deciduous_forest", "coniferous_forest",
"sandstone_grassland", "sandstone_grassland_ocean", "stone_grassland_dunes", "sandstone_grassland_dunes",
"deciduous_forest", "deciduous_forest_ocean", "coniferous_forest_dunes"},
"coniferous_forest", "coniferous_forest_ocean", y_min = 1,
},
y_min = 5,
y_max = 31000, y_max = 31000,
decoration = "default:grass_"..length, decoration = "default:grass_"..length,
}) })
end end
local function register_dry_grass_decoration(length) local function register_dry_grass_decoration(offset, scale, length)
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:dirt_with_dry_grass"}, place_on = {"default:dirt_with_dry_grass"},
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = 0.04, offset = offset,
scale = 0.02, scale = scale,
spread = {x=200, y=200, z=200}, spread = {x = 200, y = 200, z = 200},
seed = 329, seed = 329,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"savanna"}, biomes = {"savanna"},
y_min = 5, y_min = 1,
y_max = 31000, y_max = 31000,
decoration = "default:dry_grass_"..length, decoration = "default:dry_grass_"..length,
}) })
@ -860,13 +975,13 @@ function default.register_decorations()
noise_params = { noise_params = {
offset = 0.04, offset = 0.04,
scale = 0.02, scale = 0.02,
spread = {x=250, y=250, z=250}, spread = {x = 250, y = 250, z = 250},
seed = 2, seed = 2,
octaves = 3, octaves = 3,
persist = 0.66 persist = 0.66
}, },
biomes = {"deciduous_forest"}, biomes = {"deciduous_forest"},
y_min = 6, y_min = 1,
y_max = 31000, y_max = 31000,
schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts", schematic = minetest.get_modpath("default").."/schematics/apple_tree.mts",
flags = "place_center_x, place_center_z", flags = "place_center_x, place_center_z",
@ -884,18 +999,19 @@ function default.register_decorations()
y_max = 31000, y_max = 31000,
schematic = minetest.get_modpath("default").."/schematics/jungle_tree.mts", schematic = minetest.get_modpath("default").."/schematics/jungle_tree.mts",
flags = "place_center_x, place_center_z", flags = "place_center_x, place_center_z",
rotation = "random",
}) })
-- Taiga and temperate forest pine tree -- Taiga and temperate coniferous forest pine tree
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"default:snowblock", "default:dirt_with_grass"}, place_on = {"default:dirt_with_snow", "default:dirt_with_grass"},
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = 0.04, offset = 0.04,
scale = 0.02, scale = 0.02,
spread = {x=250, y=250, z=250}, spread = {x = 250, y = 250, z = 250},
seed = 2, seed = 2,
octaves = 3, octaves = 3,
persist = 0.66 persist = 0.66
@ -912,17 +1028,17 @@ function default.register_decorations()
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"default:dirt_with_dry_grass"}, place_on = {"default:dirt_with_dry_grass"},
sidelen = 80, sidelen = 16,
noise_params = { noise_params = {
offset = 0.001, offset = 0,
scale = 0.0015, scale = 0.002,
spread = {x=250, y=250, z=250}, spread = {x = 250, y = 250, z = 250},
seed = 2, seed = 2,
octaves = 3, octaves = 3,
persist = 0.66 persist = 0.66
}, },
biomes = {"savanna"}, biomes = {"savanna"},
y_min = 6, y_min = 1,
y_max = 31000, y_max = 31000,
schematic = minetest.get_modpath("default").."/schematics/acacia_tree.mts", schematic = minetest.get_modpath("default").."/schematics/acacia_tree.mts",
flags = "place_center_x, place_center_z", flags = "place_center_x, place_center_z",
@ -934,17 +1050,17 @@ function default.register_decorations()
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"default:desert_sand"}, place_on = {"default:desert_sand"},
sidelen = 80, sidelen = 16,
noise_params = { noise_params = {
offset = -0.0005, offset = -0.0003,
scale = 0.0015, scale = 0.0009,
spread = {x=200, y=200, z=200}, spread = {x = 200, y = 200, z = 200},
seed = 230, seed = 230,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"desert"}, biomes = {"desert"},
y_min = 2, y_min = 5,
y_max = 31000, y_max = 31000,
schematic = minetest.get_modpath("default").."/schematics/large_cactus.mts", schematic = minetest.get_modpath("default").."/schematics/large_cactus.mts",
flags = "place_center_x", flags = "place_center_x",
@ -956,38 +1072,38 @@ function default.register_decorations()
minetest.register_decoration({ minetest.register_decoration({
deco_type = "simple", deco_type = "simple",
place_on = {"default:desert_sand"}, place_on = {"default:desert_sand"},
sidelen = 80, sidelen = 16,
noise_params = { noise_params = {
offset = -0.0005, offset = -0.0003,
scale = 0.0015, scale = 0.0009,
spread = {x=200, y=200, z=200}, spread = {x = 200, y = 200, z = 200},
seed = 230, seed = 230,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = {"desert"}, biomes = {"desert"},
y_min = 2, y_min = 5,
y_max = 31000, y_max = 31000,
decoration = "default:cactus", decoration = "default:cactus",
height = 2, height = 2,
height_max = 5, height_max = 5,
}) })
-- Papyrus -- Papyrus
minetest.register_decoration({ minetest.register_decoration({
deco_type = "schematic", deco_type = "schematic",
place_on = {"default:sand"}, place_on = {"default:dirt"},
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = -0.3, offset = -0.3,
scale = 0.7, scale = 0.7,
spread = {x=200, y=200, z=200}, spread = {x = 200, y = 200, z = 200},
seed = 354, seed = 354,
octaves = 3, octaves = 3,
persist = 0.7 persist = 0.7
}, },
biomes = {"savanna_ocean", "desert_ocean"}, biomes = {"savanna_swamp"},
y_min = 0, y_min = 0,
y_max = 0, y_max = 0,
schematic = minetest.get_modpath("default").."/schematics/papyrus.mts", schematic = minetest.get_modpath("default").."/schematics/papyrus.mts",
@ -1003,11 +1119,11 @@ function default.register_decorations()
-- Dry grasses -- Dry grasses
register_dry_grass_decoration(5) register_dry_grass_decoration(0.01, 0.05, 5)
register_dry_grass_decoration(4) register_dry_grass_decoration(0.03, 0.03, 4)
register_dry_grass_decoration(3) register_dry_grass_decoration(0.05, 0.01, 3)
register_dry_grass_decoration(2) register_dry_grass_decoration(0.07, -0.01, 2)
register_dry_grass_decoration(1) register_dry_grass_decoration(0.09, -0.03, 1)
-- Junglegrass -- Junglegrass
@ -1031,7 +1147,7 @@ function default.register_decorations()
noise_params = { noise_params = {
offset = 0, offset = 0,
scale = 0.02, scale = 0.02,
spread = {x=200, y=200, z=200}, spread = {x = 200, y = 200, z = 200},
seed = 329, seed = 329,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 B

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 263 B

After

Width:  |  Height:  |  Size: 777 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 811 B

After

Width:  |  Height:  |  Size: 834 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 280 B

After

Width:  |  Height:  |  Size: 280 B

View File

Before

Width:  |  Height:  |  Size: 574 B

After

Width:  |  Height:  |  Size: 574 B

View File

Before

Width:  |  Height:  |  Size: 223 B

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 B

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -1,10 +1,12 @@
-- --
-- Grow trees -- Grow trees from saplings
-- --
-- 'Can grow' function
local random = math.random local random = math.random
local function can_grow(pos) function default.can_grow(pos)
local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z})
if not node_under then if not node_under then
return false return false
@ -14,84 +16,65 @@ local function can_grow(pos)
if is_soil == 0 then if is_soil == 0 then
return false return false
end end
local light_level = minetest.get_node_light(pos)
if not light_level or light_level < 13 then
return false
end
return true return true
end end
-- Sapling ABMs
-- Sapling ABM
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:sapling"}, nodenames = {"default:sapling", "default:junglesapling",
"default:pine_sapling", "default:acacia_sapling"},
interval = 10, interval = 10,
chance = 50, chance = 50,
action = function(pos, node) action = function(pos, node)
if not can_grow(pos) then if not default.can_grow(pos) then
return return
end end
minetest.log("action", "A sapling grows into a tree at ".. local mapgen = minetest.get_mapgen_params().mgname
minetest.pos_to_string(pos)) if node.name == "default:sapling" then
if minetest.get_mapgen_params().mgname == "v6" then minetest.log("action", "A sapling grows into a tree at "..
default.grow_tree(pos, random(1, 4) == 1) minetest.pos_to_string(pos))
else if mapgen == "v6" then
default.grow_new_apple_tree(pos) default.grow_tree(pos, random(1, 4) == 1)
else
default.grow_new_apple_tree(pos)
end
elseif node.name == "default:junglesapling" then
minetest.log("action", "A jungle sapling grows into a tree at "..
minetest.pos_to_string(pos))
if mapgen == "v6" then
default.grow_jungle_tree(pos)
else
default.grow_new_jungle_tree(pos)
end
elseif node.name == "default:pine_sapling" then
minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
if mapgen == "v6" then
default.grow_pine_tree(pos)
else
default.grow_new_pine_tree(pos)
end
elseif node.name == "default:acacia_sapling" then
minetest.log("action", "An acacia sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_new_acacia_tree(pos)
end end
end end
}) })
minetest.register_abm({
nodenames = {"default:junglesapling"},
interval = 11,
chance = 50,
action = function(pos, node)
if not can_grow(pos) then
return
end
minetest.log("action", "A jungle sapling grows into a tree at ".. --
minetest.pos_to_string(pos)) -- Tree generation
if minetest.get_mapgen_params().mgname == "v6" then --
default.grow_jungle_tree(pos)
else
default.grow_new_jungle_tree(pos)
end
end
})
minetest.register_abm({ -- Apple tree and jungle tree trunk and leaves function
nodenames = {"default:pine_sapling"},
interval = 12,
chance = 50,
action = function(pos, node)
if not can_grow(pos) then
return
end
minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
if minetest.get_mapgen_params().mgname == "v6" then
default.grow_pine_tree(pos)
else
default.grow_new_pine_tree(pos)
end
end
})
minetest.register_abm({
nodenames = {"default:acacia_sapling"},
interval = 13,
chance = 50,
action = function(pos, node)
if not can_grow(pos) then
return
end
minetest.log("action", "An acacia sapling grows into a tree at "..
minetest.pos_to_string(pos))
default.grow_new_acacia_tree(pos)
end
})
-- Appletree, jungletree function
local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid, local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
height, size, iters, is_apple_tree) height, size, iters, is_apple_tree)
@ -150,7 +133,8 @@ local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid,
end end
end end
-- Appletree
-- Apple tree
function default.grow_tree(pos, is_apple_tree, bad) function default.grow_tree(pos, is_apple_tree, bad)
--[[ --[[
@ -182,7 +166,8 @@ function default.grow_tree(pos, is_apple_tree, bad)
vm:update_map() vm:update_map()
end end
-- Jungletree
-- Jungle tree
function default.grow_jungle_tree(pos, bad) function default.grow_jungle_tree(pos, bad)
--[[ --[[
@ -233,7 +218,8 @@ function default.grow_jungle_tree(pos, bad)
vm:update_map() vm:update_map()
end end
-- Pinetree from mg mapgen mod, design by sfan5, pointy top added by paramat
-- Pine tree from mg mapgen mod, design by sfan5, pointy top added by paramat
local function add_pine_needles(data, vi, c_air, c_ignore, c_snow, c_pine_needles) local function add_pine_needles(data, vi, c_air, c_ignore, c_snow, c_pine_needles)
local node_id = data[vi] local node_id = data[vi]
@ -255,7 +241,7 @@ function default.grow_pine_tree(pos)
local c_air = minetest.get_content_id("air") local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore") local c_ignore = minetest.get_content_id("ignore")
local c_pinetree = minetest.get_content_id("default:pinetree") local c_pine_tree = minetest.get_content_id("default:pine_tree")
local c_pine_needles = minetest.get_content_id("default:pine_needles") local c_pine_needles = minetest.get_content_id("default:pine_needles")
local c_snow = minetest.get_content_id("default:snow") local c_snow = minetest.get_content_id("default:snow")
local c_snowblock = minetest.get_content_id("default:snowblock") local c_snowblock = minetest.get_content_id("default:snowblock")
@ -359,12 +345,13 @@ function default.grow_pine_tree(pos)
end end
-- Trunk -- Trunk
data[a:index(x, y, z)] = c_pinetree -- Force-place lowest trunk node to replace sapling data[a:index(x, y, z)] = c_pine_tree -- Force-place lowest trunk node to replace sapling
for yy = y + 1, maxy do for yy = y + 1, maxy do
local vi = a:index(x, yy, z) local vi = a:index(x, yy, z)
local node_id = data[vi] local node_id = data[vi]
if node_id == c_air or node_id == c_ignore or node_id == c_pine_needles then if node_id == c_air or node_id == c_ignore or
data[vi] = c_pinetree node_id == c_pine_needles or node_id == c_snow then
data[vi] = c_pine_tree
end end
end end
@ -373,34 +360,38 @@ function default.grow_pine_tree(pos)
vm:update_map() vm:update_map()
end end
-- New tree
-- New apple tree
function default.grow_new_apple_tree(pos) function default.grow_new_apple_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/apple_tree.mts" local path = minetest.get_modpath("default") .. "/schematics/apple_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false) path, 0, nil, false)
end end
-- New jungle tree -- New jungle tree
function default.grow_new_jungle_tree(pos) function default.grow_new_jungle_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts" local path = minetest.get_modpath("default") .. "/schematics/jungle_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false) path, 0, nil, false)
end end
-- New pine tree -- New pine tree
function default.grow_new_pine_tree(pos) function default.grow_new_pine_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/pine_tree.mts" local path = minetest.get_modpath("default") .. "/schematics/pine_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2}, minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false) path, 0, nil, false)
end end
-- New acacia tree -- New acacia tree
function default.grow_new_acacia_tree(pos) function default.grow_new_acacia_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts" local path = minetest.get_modpath("default") .. "/schematics/acacia_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4}, minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4},
path, random, nil, false) path, random, nil, false)
end end

View File

@ -1,5 +1,5 @@
Minetest 0.4 mod: doors Minetest Game mod: doors
======================= ========================
version: 1.3 version: 1.3
License of source code: License of source code:

View File

@ -129,7 +129,7 @@ function doors.register_door(name, def)
local function on_rightclick(pos, dir, check_name, replace, replace_dir, params) local function on_rightclick(pos, dir, check_name, replace, replace_dir, params)
pos.y = pos.y+dir pos.y = pos.y+dir
if not minetest.get_node(pos).name == check_name then if minetest.get_node(pos).name ~= check_name then
return return
end end
local p2 = minetest.get_node(pos).param2 local p2 = minetest.get_node(pos).param2

View File

@ -1,4 +1,4 @@
Minetest 0.4 mod: dye Minetest Game mod: dye
====================== ======================
See init.lua for documentation. See init.lua for documentation.

View File

@ -1,28 +0,0 @@
farming.register_hoe(name, hoe definition)
-> Register a new hoe, see [hoe definition]
farming.register_plant(name, Plant definition)
-> Register a new growing plant, see [Plant definition]
Hoe Definition
{
description = "", -- Description for tooltip
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
max_uses = 30, -- Uses until destroyed
material = "", -- Material for recipes
recipe = { -- Craft recipe, if material isn't used
{"air", "air", "air"},
{"", "group:stick"},
{"", "group:stick"},
}
}
Plant definition
{
description = "", -- Description of seed item
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
steps = 8, -- How many steps the plant has to grow, until it can be harvested
^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber)
minlight = 13, -- Minimum light to grow
maxlight = default.LIGHT_MAX -- Maximum light to grow
}

View File

@ -1,5 +1,5 @@
Minetest 0.4 mod: farming Minetest Game mod: farming
========================= ==========================
License of source code: License of source code:
----------------------- -----------------------

View File

@ -38,6 +38,16 @@ farming.hoe_on_use = function(itemstack, user, pointed_thing, uses)
return return
end end
if minetest.is_protected(pt.under, user:get_player_name()) then
minetest.record_protection_violation(pt.under, user:get_player_name())
return
end
if minetest.is_protected(pt.above, user:get_player_name()) then
minetest.record_protection_violation(pt.above, user:get_player_name())
return
end
-- turn the node into soil, wear out item and play sound -- turn the node into soil, wear out item and play sound
minetest.set_node(pt.under, {name = regN[under.name].soil.dry}) minetest.set_node(pt.under, {name = regN[under.name].soil.dry})
minetest.sound_play("default_dig_crumbly", { minetest.sound_play("default_dig_crumbly", {
@ -123,6 +133,16 @@ farming.place_seed = function(itemstack, placer, pointed_thing, plantname)
local under = minetest.get_node(pt.under) local under = minetest.get_node(pt.under)
local above = minetest.get_node(pt.above) local above = minetest.get_node(pt.above)
if minetest.is_protected(pt.under, placer:get_player_name()) then
minetest.record_protection_violation(pt.under, placer:get_player_name())
return
end
if minetest.is_protected(pt.above, placer:get_player_name()) then
minetest.record_protection_violation(pt.above, placer:get_player_name())
return
end
-- return if any of the nodes is not registered -- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then if not minetest.registered_nodes[under.name] then
return return

View File

@ -1,5 +1,5 @@
Minetest 0.4 mod: fire Minetest Game mod: fire
====================== =======================
License of source code: License of source code:
----------------------- -----------------------

View File

@ -1,21 +1,35 @@
-- minetest/fire/init.lua -- minetest/fire/init.lua
-- Global namespace for functions
fire = {} fire = {}
-- Register flame nodes
minetest.register_node("fire:basic_flame", { minetest.register_node("fire:basic_flame", {
description = "Fire", description = "Basic Flame",
drawtype = "firelike", drawtype = "firelike",
tiles = {{ tiles = {
name="fire_basic_flame_animated.png", {
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1}, name = "fire_basic_flame_animated.png",
}}, animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1
},
},
},
inventory_image = "fire_basic_flame.png", inventory_image = "fire_basic_flame.png",
paramtype = "light",
light_source = 14, light_source = 14,
groups = {igniter=2,dig_immediate=3},
drop = '',
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
sunlight_propagates = true,
damage_per_second = 4, damage_per_second = 4,
groups = {igniter = 2, dig_immediate = 3},
drop = "",
on_construct = function(pos) on_construct = function(pos)
minetest.after(0, fire.on_flame_add_at, pos) minetest.after(0, fire.on_flame_add_at, pos)
@ -25,48 +39,86 @@ minetest.register_node("fire:basic_flame", {
minetest.after(0, fire.on_flame_remove_at, pos) minetest.after(0, fire.on_flame_remove_at, pos)
end, end,
-- unaffected by explosions on_blast = function()
on_blast = function() end, end, -- unaffected by explosions
}) })
fire.D = 6 minetest.register_node("fire:permanent_flame", {
-- key: position hash of low corner of area description = "Permanent Flame",
-- value: {handle=sound handle, name=sound name} drawtype = "firelike",
fire.sounds = {} tiles = {
{
name = "fire_basic_flame_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1
},
},
},
inventory_image = "fire_basic_flame.png",
paramtype = "light",
light_source = 14,
walkable = false,
buildable_to = true,
sunlight_propagates = true,
damage_per_second = 4,
groups = {igniter = 2, dig_immediate = 3},
drop = "",
on_blast = function()
end,
})
-- Get sound area of position
fire.D = 6 -- size of sound areas
function fire.get_area_p0p1(pos) function fire.get_area_p0p1(pos)
local p0 = { local p0 = {
x=math.floor(pos.x/fire.D)*fire.D, x = math.floor(pos.x / fire.D) * fire.D,
y=math.floor(pos.y/fire.D)*fire.D, y = math.floor(pos.y / fire.D) * fire.D,
z=math.floor(pos.z/fire.D)*fire.D, z = math.floor(pos.z / fire.D) * fire.D,
} }
local p1 = { local p1 = {
x=p0.x+fire.D-1, x = p0.x + fire.D - 1,
y=p0.y+fire.D-1, y = p0.y + fire.D - 1,
z=p0.z+fire.D-1 z = p0.z + fire.D - 1
} }
return p0, p1 return p0, p1
end end
-- Fire sounds table
-- key: position hash of low corner of area
-- value: {handle=sound handle, name=sound name}
fire.sounds = {}
-- Update fire sounds in sound area of position
function fire.update_sounds_around(pos) function fire.update_sounds_around(pos)
local p0, p1 = fire.get_area_p0p1(pos) local p0, p1 = fire.get_area_p0p1(pos)
local cp = {x=(p0.x+p1.x)/2, y=(p0.y+p1.y)/2, z=(p0.z+p1.z)/2} local cp = {x = (p0.x + p1.x) / 2, y = (p0.y + p1.y) / 2, z = (p0.z + p1.z) / 2}
local flames_p = minetest.find_nodes_in_area(p0, p1, {"fire:basic_flame"}) local flames_p = minetest.find_nodes_in_area(p0, p1, {"fire:basic_flame"})
--print("number of flames at "..minetest.pos_to_string(p0).."/" --print("number of flames at "..minetest.pos_to_string(p0).."/"
-- ..minetest.pos_to_string(p1)..": "..#flames_p) -- ..minetest.pos_to_string(p1)..": "..#flames_p)
local should_have_sound = (#flames_p > 0) local should_have_sound = (#flames_p > 0)
local wanted_sound = nil local wanted_sound = nil
if #flames_p >= 9 then if #flames_p >= 9 then
wanted_sound = {name="fire_large", gain=1.5} wanted_sound = {name = "fire_large", gain = 0.7}
elseif #flames_p > 0 then elseif #flames_p > 0 then
wanted_sound = {name="fire_small", gain=1.5} wanted_sound = {name = "fire_small", gain = 0.9}
end end
local p0_hash = minetest.hash_node_position(p0) local p0_hash = minetest.hash_node_position(p0)
local sound = fire.sounds[p0_hash] local sound = fire.sounds[p0_hash]
if not sound then if not sound then
if should_have_sound then if should_have_sound then
fire.sounds[p0_hash] = { fire.sounds[p0_hash] = {
handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}), handle = minetest.sound_play(wanted_sound,
{pos = cp, max_hear_distance = 16, loop = true}),
name = wanted_sound.name, name = wanted_sound.name,
} }
end end
@ -77,53 +129,127 @@ function fire.update_sounds_around(pos)
elseif sound.name ~= wanted_sound.name then elseif sound.name ~= wanted_sound.name then
minetest.sound_stop(sound.handle) minetest.sound_stop(sound.handle)
fire.sounds[p0_hash] = { fire.sounds[p0_hash] = {
handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}), handle = minetest.sound_play(wanted_sound,
{pos = cp, max_hear_distance = 16, loop = true}),
name = wanted_sound.name, name = wanted_sound.name,
} }
end end
end end
end end
-- Update fire sounds on flame node construct or destruct
function fire.on_flame_add_at(pos) function fire.on_flame_add_at(pos)
fire.update_sounds_around(pos) fire.update_sounds_around(pos)
end end
function fire.on_flame_remove_at(pos) function fire.on_flame_remove_at(pos)
fire.update_sounds_around(pos) fire.update_sounds_around(pos)
end end
-- Return positions for flames around a burning node
function fire.find_pos_for_flame_around(pos) function fire.find_pos_for_flame_around(pos)
return minetest.find_node_near(pos, 1, {"air"}) return minetest.find_node_near(pos, 1, {"air"})
end end
-- Detect nearby extinguishing nodes
function fire.flame_should_extinguish(pos) function fire.flame_should_extinguish(pos)
if minetest.setting_getbool("disable_fire") then return true end return minetest.find_node_near(pos, 1, {"group:puts_out_fire"})
--return minetest.find_node_near(pos, 1, {"group:puts_out_fire"})
local p0 = {x=pos.x-2, y=pos.y, z=pos.z-2}
local p1 = {x=pos.x+2, y=pos.y, z=pos.z+2}
local ps = minetest.find_nodes_in_area(p0, p1, {"group:puts_out_fire"})
return (#ps ~= 0)
end end
-- Ignite neighboring nodes
-- Extinguish all flames quickly with water, snow, ice
minetest.register_abm({ minetest.register_abm({
nodenames = {"group:flammable"}, nodenames = {"fire:basic_flame", "fire:permanent_flame"},
neighbors = {"group:igniter"}, neighbors = {"group:puts_out_fire"},
interval = 5, interval = 3,
chance = 2, chance = 2,
catch_up = false,
action = function(p0, node, _, _) action = function(p0, node, _, _)
-- If there is water or stuff like that around flame, don't ignite minetest.remove_node(p0)
if fire.flame_should_extinguish(p0) then minetest.sound_play("fire_extinguish_flame",
return {pos = p0, max_hear_distance = 16, gain = 0.25})
end
local p = fire.find_pos_for_flame_around(p0)
if p then
minetest.set_node(p, {name="fire:basic_flame"})
end
end, end,
}) })
-- Enable the following ABMs according to 'disable fire' setting
if minetest.setting_getbool("disable_fire") then
-- Remove basic flames only
minetest.register_abm({
nodenames = {"fire:basic_flame"},
interval = 7,
chance = 2,
catch_up = false,
action = function(p0, node, _, _)
minetest.remove_node(p0)
end,
})
else
-- Ignite neighboring nodes, add basic flames
minetest.register_abm({
nodenames = {"group:flammable"},
neighbors = {"group:igniter"},
interval = 7,
chance = 16,
catch_up = false,
action = function(p0, node, _, _)
-- If there is water or stuff like that around node, don't ignite
if fire.flame_should_extinguish(p0) then
return
end
local p = fire.find_pos_for_flame_around(p0)
if p then
minetest.set_node(p, {name = "fire:basic_flame"})
end
end,
})
-- Remove basic flames and flammable nodes
minetest.register_abm({
nodenames = {"fire:basic_flame"},
interval = 5,
chance = 16,
catch_up = false,
action = function(p0, node, _, _)
-- If there are no flammable nodes around flame, remove flame
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then
minetest.remove_node(p0)
return
end
if math.random(1, 4) == 1 then
-- remove flammable nodes around flame
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
if p then
minetest.remove_node(p)
nodeupdate(p)
end
end
end,
})
end
-- Rarely ignite things from far -- Rarely ignite things from far
--[[ Currently disabled to reduce the chance of uncontrollable spreading
fires that disrupt servers. Also for less lua processing load.
minetest.register_abm({ minetest.register_abm({
nodenames = {"group:igniter"}, nodenames = {"group:igniter"},
neighbors = {"air"}, neighbors = {"air"},
@ -143,47 +269,9 @@ minetest.register_abm({
end end
local p2 = fire.find_pos_for_flame_around(p) local p2 = fire.find_pos_for_flame_around(p)
if p2 then if p2 then
minetest.set_node(p2, {name="fire:basic_flame"}) minetest.set_node(p2, {name = "fire:basic_flame"})
end end
end end
end, end,
}) })
--]]
-- Remove flammable nodes and flame
minetest.register_abm({
nodenames = {"fire:basic_flame"},
interval = 3,
chance = 2,
action = function(p0, node, _, _)
-- If there is water or stuff like that around flame, remove flame
if fire.flame_should_extinguish(p0) then
minetest.remove_node(p0)
return
end
-- Make the following things rarer
if math.random(1,3) == 1 then
return
end
-- If there are no flammable nodes around flame, remove flame
if not minetest.find_node_near(p0, 1, {"group:flammable"}) then
minetest.remove_node(p0)
return
end
if math.random(1,4) == 1 then
-- remove a flammable node around flame
local p = minetest.find_node_near(p0, 1, {"group:flammable"})
if p then
-- If there is water or stuff like that around flame, don't remove
if fire.flame_should_extinguish(p0) then
return
end
minetest.remove_node(p)
nodeupdate(p)
end
else
-- remove flame
minetest.remove_node(p0)
end
end,
})

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +1,5 @@
Minetest 0.4 mod: flowers Minetest Game mod: flowers
========================= ==========================
License of source code: License of source code:
----------------------- -----------------------
@ -16,7 +16,8 @@ License of media (textures and sounds)
WTFPL WTFPL
Gambit (WTFPL): Gambit (WTFPL):
flowers_mushroom_*.png flowers_mushroom_*.png
flowers_waterlily.png
DanDuncombe (WTFPL): DanDuncombe (WTFPL):
flowers_spores_*.png flowers_spores_*.png

View File

@ -1,21 +1,29 @@
-- Minetest 0.4 mod: default -- Minetest 0.4 mod: default
-- See README.txt for licensing and other information. -- See README.txt for licensing and other information.
-- Namespace for functions -- Namespace for functions
flowers = {} flowers = {}
-- Map Generation -- Map Generation
dofile(minetest.get_modpath("flowers") .. "/mapgen.lua") dofile(minetest.get_modpath("flowers") .. "/mapgen.lua")
--
-- Flowers
--
-- Aliases for original flowers mod -- Aliases for original flowers mod
minetest.register_alias("flowers:flower_dandelion_white", "flowers:dandelion_white")
minetest.register_alias("flowers:flower_dandelion_yellow", "flowers:dandelion_yellow")
minetest.register_alias("flowers:flower_geranium", "flowers:geranium")
minetest.register_alias("flowers:flower_rose", "flowers:rose") minetest.register_alias("flowers:flower_rose", "flowers:rose")
minetest.register_alias("flowers:flower_tulip", "flowers:tulip") minetest.register_alias("flowers:flower_tulip", "flowers:tulip")
minetest.register_alias("flowers:flower_dandelion_yellow", "flowers:dandelion_yellow")
minetest.register_alias("flowers:flower_geranium", "flowers:geranium")
minetest.register_alias("flowers:flower_viola", "flowers:viola") minetest.register_alias("flowers:flower_viola", "flowers:viola")
minetest.register_alias("flowers:flower_dandelion_white", "flowers:dandelion_white")
-- Flower registration -- Flower registration
@ -31,12 +39,14 @@ local function add_simple_flower(name, desc, box, f_groups)
minetest.register_node("flowers:" .. name, { minetest.register_node("flowers:" .. name, {
description = desc, description = desc,
drawtype = "plantlike", drawtype = "plantlike",
waving = 1,
tiles = {"flowers_" .. name .. ".png"}, tiles = {"flowers_" .. name .. ".png"},
inventory_image = "flowers_" .. name .. ".png", inventory_image = "flowers_" .. name .. ".png",
wield_image = "flowers_" .. name .. ".png", wield_image = "flowers_" .. name .. ".png",
sunlight_propagates = true, sunlight_propagates = true,
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
buildable_to = true,
stack_max = 99, stack_max = 99,
groups = f_groups, groups = f_groups,
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -61,88 +71,6 @@ for _,item in pairs(flowers.datas) do
end end
-- Mushrooms
local mushrooms_datas = {
{"brown", 2},
{"red", -6}
}
for _, m in pairs(mushrooms_datas) do
local name, nut = m[1], m[2]
-- Register mushrooms
minetest.register_node("flowers:mushroom_" .. name, {
description = string.sub(string.upper(name), 0, 1) ..
string.sub(name, 2) .. " Mushroom",
tiles = {"flowers_mushroom_" .. name .. ".png"},
inventory_image = "flowers_mushroom_" .. name .. ".png",
wield_image = "flowers_mushroom_" .. name .. ".png",
drawtype = "plantlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node = 1},
drop = {
items = {
{items = {"flowers:spores_" .. name}, rarity = 2,},
{items = {"flowers:spores_" .. name}, rarity = 2,},
{items = {"flowers:spores_" .. name}, rarity = 2,},
{items = {"flowers:mushroom_" .. name},},
},
},
sounds = default.node_sound_leaves_defaults(),
on_use = minetest.item_eat(nut),
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
}
})
-- Register spores
minetest.register_node("flowers:spores_" .. name, {
description = string.sub(string.upper(name), 0, 1) ..
string.sub(name, 2) .. " Mushroom Spores",
drawtype = "signlike",
tiles = {"flowers_spores_" .. name .. ".png"},
inventory_image = "flowers_spores_" .. name .. ".png",
wield_image = "flowers_spores_" .. name .. ".png",
paramtype = "light",
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
selection_box = {
type = "wallmounted",
},
groups = {dig_immediate = 3, attached_node = 1},
})
-- Register growth ABMs
minetest.register_abm({
nodenames = {"flowers:spores_" .. name},
interval = 14,
chance = 25,
action = function(pos, node)
local node_under = minetest.get_node_or_nil({x = pos.x,
y = pos.y - 1, z = pos.z})
if not node_under then
return
end
if minetest.get_item_group(node_under.name, "soil") ~= 0 and
minetest.get_node_light(pos, nil) <= 13 then
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},
{name = "flowers:mushroom_" .. name})
end
end
})
end
-- Flower spread -- Flower spread
minetest.register_abm({ minetest.register_abm({
@ -190,3 +118,133 @@ minetest.register_abm({
end end
end, end,
}) })
--
-- Mushrooms
--
minetest.register_node("flowers:mushroom_red", {
description = "Red Mushroom",
tiles = {"flowers_mushroom_red.png"},
inventory_image = "flowers_mushroom_red.png",
wield_image = "flowers_mushroom_red.png",
drawtype = "plantlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
on_use = minetest.item_eat(-5),
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
}
})
minetest.register_node("flowers:mushroom_brown", {
description = "Brown Mushroom",
tiles = {"flowers_mushroom_brown.png"},
inventory_image = "flowers_mushroom_brown.png",
wield_image = "flowers_mushroom_brown.png",
drawtype = "plantlike",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flammable = 3, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
on_use = minetest.item_eat(1),
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3}
}
})
-- mushroom spread and death
minetest.register_abm({
nodenames = {"flowers:mushroom_brown", "flowers:mushroom_red"},
interval = 11,
chance = 50,
action = function(pos, node)
if minetest.get_node_light(pos, nil) == 15 then
minetest.remove_node(pos)
end
local random = {
x = pos.x + math.random(-2,2),
y = pos.y + math.random(-1,1),
z = pos.z + math.random(-2,2)
}
local random_node = minetest.get_node_or_nil(random)
if not random_node then
return
end
if random_node.name ~= "air" then
return
end
local node_under = minetest.get_node_or_nil({x = random.x,
y = random.y - 1, z = random.z})
if not node_under then
return
end
if minetest.get_item_group(node_under.name, "soil") ~= 0 and
minetest.get_node_light(pos, nil) <= 9 and
minetest.get_node_light(random, nil) <= 9 then
minetest.set_node(random, {name = node.name})
end
end
})
-- these old mushroom related nodes can be simplified now
minetest.register_alias("flowers:mushroom_spores_brown", "flowers:mushroom_brown")
minetest.register_alias("flowers:mushroom_spores_red", "flowers:mushroom_red")
minetest.register_alias("flowers:mushroom_fertile_brown", "flowers:mushroom_brown")
minetest.register_alias("flowers:mushroom_fertile_red", "flowers:mushroom_red")
--
-- Waterlily
--
minetest.register_node("flowers:waterlily", {
description = "Waterlily",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
tiles = {"flowers_waterlily.png"},
inventory_image = "flowers_waterlily.png",
wield_image = "flowers_waterlily.png",
liquids_pointable = true,
walkable = false,
buildable_to = true,
groups = {snappy = 3, flower = 1},
sounds = default.node_sound_leaves_defaults(),
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.46875, 0.5}
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
},
after_place_node = function(pos, placer, itemstack, pointed_thing)
local find_water = minetest.find_nodes_in_area({x = pos.x - 1, y = pos.y, z = pos.z - 1},
{x = pos.x + 1, y = pos.y, z = pos.z + 1}, "default:water_source")
local find_river_water = minetest.find_nodes_in_area({x = pos.x - 1, y = pos.y, z = pos.z - 1},
{x = pos.x + 1, y = pos.y, z = pos.z + 1}, "default:river_water_source")
if #find_water ~= 0 then
minetest.set_node(pos, {name = "default:water_source"})
pos.y = pos.y + 1
minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)})
elseif #find_river_water ~= 0 then
minetest.set_node(pos, {name = "default:river_water_source"})
pos.y = pos.y + 1
minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)})
else
minetest.remove_node(pos)
return true
end
end
})

View File

@ -1,4 +1,6 @@
--
-- Mgv6 -- Mgv6
--
local function register_mgv6_flower(name) local function register_mgv6_flower(name)
minetest.register_decoration({ minetest.register_decoration({
@ -8,7 +10,7 @@ local function register_mgv6_flower(name)
noise_params = { noise_params = {
offset = 0, offset = 0,
scale = 0.006, scale = 0.006,
spread = {x=100, y=100, z=100}, spread = {x = 100, y = 100, z = 100},
seed = 436, seed = 436,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
@ -26,8 +28,8 @@ local function register_mgv6_mushroom(name)
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = 0, offset = 0,
scale = 0.006, scale = 0.04,
spread = {x=100, y=100, z=100}, spread = {x = 100, y = 100, z = 100},
seed = 7133, seed = 7133,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
@ -35,6 +37,28 @@ local function register_mgv6_mushroom(name)
y_min = 1, y_min = 1,
y_max = 30, y_max = 30,
decoration = "flowers:"..name, decoration = "flowers:"..name,
spawn_by = "default:tree",
num_spawn_by = 1,
})
end
local function register_mgv6_waterlily()
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt"},
sidelen = 16,
noise_params = {
offset = -0.12,
scale = 0.3,
spread = {x = 100, y = 100, z = 100},
seed = 33,
octaves = 3,
persist = 0.7
},
y_min = 0,
y_max = 0,
schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts",
rotation = "random",
}) })
end end
@ -46,11 +70,16 @@ function flowers.register_mgv6_decorations()
register_mgv6_flower("viola") register_mgv6_flower("viola")
register_mgv6_flower("dandelion_white") register_mgv6_flower("dandelion_white")
register_mgv6_mushroom("mushroom_brown") register_mgv6_mushroom("mushroom_fertile_brown")
register_mgv6_mushroom("mushroom_red") register_mgv6_mushroom("mushroom_fertile_red")
register_mgv6_waterlily()
end end
-- All other biome API mapgens (not singlenode)
--
-- All other biome API mapgens
--
local function register_flower(seed, name) local function register_flower(seed, name)
minetest.register_decoration({ minetest.register_decoration({
@ -58,20 +87,16 @@ local function register_flower(seed, name)
place_on = {"default:dirt_with_grass"}, place_on = {"default:dirt_with_grass"},
sidelen = 16, sidelen = 16,
noise_params = { noise_params = {
offset = -0.02, offset = -0.015,
scale = 0.03, scale = 0.025,
spread = {x=200, y=200, z=200}, spread = {x = 200, y = 200, z = 200},
seed = seed, seed = seed,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.6
}, },
biomes = { biomes = {"stone_grassland", "sandstone_grassland",
"stone_grassland", "deciduous_forest", "coniferous_forest"},
"sandstone_grassland", y_min = 1,
"deciduous_forest",
"coniferous_forest",
},
y_min = 6,
y_max = 31000, y_max = 31000,
decoration = "flowers:"..name, decoration = "flowers:"..name,
}) })
@ -85,18 +110,39 @@ local function register_mushroom(name)
noise_params = { noise_params = {
offset = 0, offset = 0,
scale = 0.006, scale = 0.006,
spread = {x=200, y=200, z=200}, spread = {x = 200, y = 200, z = 200},
seed = 7133, seed = 2,
octaves = 3, octaves = 3,
persist = 0.6 persist = 0.66
}, },
biomes = {"deciduous_forest", "coniferous_forest"}, biomes = {"deciduous_forest", "coniferous_forest"},
y_min = 6, y_min = 1,
y_max = 31000, y_max = 31000,
decoration = "flowers:"..name, decoration = "flowers:"..name,
}) })
end end
local function register_waterlily()
minetest.register_decoration({
deco_type = "schematic",
place_on = {"default:dirt"},
sidelen = 16,
noise_params = {
offset = -0.12,
scale = 0.3,
spread = {x = 200, y = 200, z = 200},
seed = 33,
octaves = 3,
persist = 0.7
},
biomes = {"rainforest_swamp", "savanna_swamp", "deciduous_forest_swamp"},
y_min = 0,
y_max = 0,
schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts",
rotation = "random",
})
end
function flowers.register_decorations() function flowers.register_decorations()
register_flower(436, "rose") register_flower(436, "rose")
register_flower(19822, "tulip") register_flower(19822, "tulip")
@ -105,11 +151,16 @@ function flowers.register_decorations()
register_flower(1133, "viola") register_flower(1133, "viola")
register_flower(73133, "dandelion_white") register_flower(73133, "dandelion_white")
register_mushroom("mushroom_brown") register_mushroom("mushroom_fertile_brown")
register_mushroom("mushroom_red") register_mushroom("mushroom_fertile_red")
register_waterlily()
end end
--
-- Detect mapgen to select functions -- Detect mapgen to select functions
--
-- Mods using singlenode mapgen can call these functions to enable -- Mods using singlenode mapgen can call these functions to enable
-- the use of minetest.generate_ores or minetest.generate_decorations -- the use of minetest.generate_ores or minetest.generate_decorations

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -35,6 +35,10 @@ local function screwdriver_handler(itemstack, user, pointed_thing, mode)
local node = minetest.get_node(pos) local node = minetest.get_node(pos)
local ndef = minetest.registered_nodes[node.name] local ndef = minetest.registered_nodes[node.name]
-- verify node is facedir (expected to be rotatable)
if ndef.paramtype2 ~= "facedir" then
return
end
-- Compute param2 -- Compute param2
local rotationPart = node.param2 % 32 -- get first 4 bits local rotationPart = node.param2 % 32 -- get first 4 bits
local preservePart = node.param2 - rotationPart local preservePart = node.param2 - rotationPart

View File

@ -1,5 +1,5 @@
Minetest mod: screwdriver Minetest Game mod: screwdriver
========================= ==============================
License of source code: License of source code:
----------------------- -----------------------

View File

@ -1,4 +1,4 @@
Minetest 0.4 mod: stairs Minetest Game mod: stairs
========================= =========================
License of source code: License of source code:

View File

@ -1 +1,2 @@
default default
farming

View File

@ -1,9 +1,26 @@
-- Minetest 0.4 mod: stairs -- Minetest 0.4 mod: stairs
-- See README.txt for licensing and other information. -- See README.txt for licensing and other information.
-- Global namespace for functions
stairs = {} stairs = {}
-- Register aliases for new pine node names
minetest.register_alias("stairs:stair_pinewood", "stairs:stair_pine_wood")
minetest.register_alias("stairs:slab_pinewood", "stairs:slab_pine_wood")
-- Get setting for replace ABM
local replace = minetest.setting_getbool("enable_stairs_replace_abm")
-- Register stairs.
-- Node will be called stairs:stair_<subname> -- Node will be called stairs:stair_<subname>
function stairs.register_stair(subname, recipeitem, groups, images, description, sounds) function stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
minetest.register_node(":stairs:stair_" .. subname, { minetest.register_node(":stairs:stair_" .. subname, {
description = description, description = description,
@ -48,7 +65,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
param2 = minetest.dir_to_facedir(dir) param2 = minetest.dir_to_facedir(dir)
end end
if p0.y-1 == p1.y then if p0.y - 1 == p1.y then
param2 = param2 + 20 param2 = param2 + 20
if param2 == 21 then if param2 == 21 then
param2 = 23 param2 = 23
@ -62,10 +79,12 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
}) })
-- for replace ABM -- for replace ABM
minetest.register_node(":stairs:stair_" .. subname.."upside_down", { if replace then
replace_name = "stairs:stair_" .. subname, minetest.register_node(":stairs:stair_" .. subname .. "upside_down", {
groups = {slabs_replace=1}, replace_name = "stairs:stair_" .. subname,
}) groups = {slabs_replace = 1},
})
end
minetest.register_craft({ minetest.register_craft({
output = 'stairs:stair_' .. subname .. ' 6', output = 'stairs:stair_' .. subname .. ' 6',
@ -87,7 +106,10 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
}) })
end end
-- Register slabs.
-- Node will be called stairs:slab_<subname> -- Node will be called stairs:slab_<subname>
function stairs.register_slab(subname, recipeitem, groups, images, description, sounds) function stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
minetest.register_node(":stairs:slab_" .. subname, { minetest.register_node(":stairs:slab_" .. subname, {
description = description, description = description,
@ -120,7 +142,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
local n0_is_upside_down = (n0.name == "stairs:slab_" .. subname and local n0_is_upside_down = (n0.name == "stairs:slab_" .. subname and
n0.param2 >= 20) n0.param2 >= 20)
if n0.name == "stairs:slab_" .. subname and not n0_is_upside_down and p0.y+1 == p1.y then if n0.name == "stairs:slab_" .. subname and not n0_is_upside_down and
p0.y + 1 == p1.y then
slabpos = p0 slabpos = p0
slabnode = n0 slabnode = n0
elseif n1.name == "stairs:slab_" .. subname then elseif n1.name == "stairs:slab_" .. subname then
@ -136,7 +159,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
pointed_thing.above = slabpos pointed_thing.above = slabpos
local success local success
fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) fakestack, success = minetest.item_place(fakestack, placer,
pointed_thing)
-- If the item was taken from the fake stack, decrement original -- If the item was taken from the fake stack, decrement original
if success then if success then
itemstack:set_count(fakestack:get_count()) itemstack:set_count(fakestack:get_count())
@ -148,7 +172,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
end end
-- Upside down slabs -- Upside down slabs
if p0.y-1 == p1.y then if p0.y - 1 == p1.y then
-- Turn into full block if pointing at a existing slab -- Turn into full block if pointing at a existing slab
if n0_is_upside_down then if n0_is_upside_down then
-- Remove the slab at the position of the slab -- Remove the slab at the position of the slab
@ -159,7 +183,8 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
pointed_thing.above = p0 pointed_thing.above = p0
local success local success
fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) fakestack, success = minetest.item_place(fakestack, placer,
pointed_thing)
-- If the item was taken from the fake stack, decrement original -- If the item was taken from the fake stack, decrement original
if success then if success then
itemstack:set_count(fakestack:get_count()) itemstack:set_count(fakestack:get_count())
@ -175,7 +200,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
end end
-- If pointing at the side of a upside down slab -- If pointing at the side of a upside down slab
if n0_is_upside_down and p0.y+1 ~= p1.y then if n0_is_upside_down and p0.y + 1 ~= p1.y then
param2 = 20 param2 = 20
end end
@ -184,10 +209,12 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
}) })
-- for replace ABM -- for replace ABM
minetest.register_node(":stairs:slab_" .. subname.."upside_down", { if replace then
replace_name = "stairs:slab_"..subname, minetest.register_node(":stairs:slab_" .. subname .. "upside_down", {
groups = {slabs_replace=1}, replace_name = "stairs:slab_".. subname,
}) groups = {slabs_replace = 1},
})
end
minetest.register_craft({ minetest.register_craft({
output = 'stairs:slab_' .. subname .. ' 6', output = 'stairs:slab_' .. subname .. ' 6',
@ -197,29 +224,41 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
}) })
end end
-- Replace old "upside_down" nodes with new param2 versions
minetest.register_abm({
nodenames = {"group:slabs_replace"},
interval = 8,
chance = 1,
action = function(pos, node)
node.name = minetest.registered_nodes[node.name].replace_name
node.param2 = node.param2 + 20
if node.param2 == 21 then
node.param2 = 23
elseif node.param2 == 23 then
node.param2 = 21
end
minetest.set_node(pos, node)
end,
})
-- Optionally replace old "upside_down" nodes with new param2 versions.
-- Disabled by default.
if replace then
minetest.register_abm({
nodenames = {"group:slabs_replace"},
interval = 8,
chance = 1,
action = function(pos, node)
node.name = minetest.registered_nodes[node.name].replace_name
node.param2 = node.param2 + 20
if node.param2 == 21 then
node.param2 = 23
elseif node.param2 == 23 then
node.param2 = 21
end
minetest.set_node(pos, node)
end,
})
end
-- Stair/slab registration function.
-- Nodes will be called stairs:{stair,slab}_<subname> -- Nodes will be called stairs:{stair,slab}_<subname>
function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
function stairs.register_stair_and_slab(subname, recipeitem, groups, images,
desc_stair, desc_slab, sounds)
stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds) stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds)
stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds) stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds)
end end
-- Register default stairs and slabs
stairs.register_stair_and_slab("wood", "default:wood", stairs.register_stair_and_slab("wood", "default:wood",
{snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{"default_wood.png"}, {"default_wood.png"},
@ -234,11 +273,11 @@ stairs.register_stair_and_slab("junglewood", "default:junglewood",
"Junglewood Slab", "Junglewood Slab",
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
stairs.register_stair_and_slab("pinewood", "default:pinewood", stairs.register_stair_and_slab("pine_wood", "default:pine_wood",
{snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3},
{"default_pinewood.png"}, {"default_pine_wood.png"},
"Pinewood Stair", "Pine Wood Stair",
"Pinewood Slab", "Pine Wood Slab",
default.node_sound_wood_defaults()) default.node_sound_wood_defaults())
stairs.register_stair_and_slab("acacia_wood", "default:acacia_wood", stairs.register_stair_and_slab("acacia_wood", "default:acacia_wood",
@ -290,13 +329,6 @@ stairs.register_stair_and_slab("desert_stonebrick", "default:desert_stonebrick",
"Desert Stone Brick Slab", "Desert Stone Brick Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("brick", "default:brick",
{cracky = 3},
{"default_brick.png"},
"Brick Stair",
"Brick Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("sandstone", "default:sandstone", stairs.register_stair_and_slab("sandstone", "default:sandstone",
{crumbly = 2, cracky = 2}, {crumbly = 2, cracky = 2},
{"default_sandstone.png"}, {"default_sandstone.png"},
@ -324,3 +356,45 @@ stairs.register_stair_and_slab("obsidianbrick", "default:obsidianbrick",
"Obsidian Brick Stair", "Obsidian Brick Stair",
"Obsidian Brick Slab", "Obsidian Brick Slab",
default.node_sound_stone_defaults()) default.node_sound_stone_defaults())
stairs.register_stair_and_slab("brick", "default:brick",
{cracky = 3},
{"default_brick.png"},
"Brick Stair",
"Brick Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("straw", "farming:straw",
{snappy = 3, flammable = 4},
{"farming_straw.png"},
"Straw Stair",
"Straw Slab",
default.node_sound_leaves_defaults())
stairs.register_stair_and_slab("steelblock", "default:steelblock",
{cracky = 1, level = 2},
{"default_steel_block.png"},
"Steel Block Stair",
"Steel Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("copperblock", "default:copperblock",
{cracky = 1, level = 2},
{"default_copper_block.png"},
"Copper Block Stair",
"Copper Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("bronzeblock", "default:bronzeblock",
{cracky = 1, level = 2},
{"default_bronze_block.png"},
"Bronze Block Stair",
"Bronze Block Slab",
default.node_sound_stone_defaults())
stairs.register_stair_and_slab("goldblock", "default:goldblock",
{cracky = 1},
{"default_gold_block.png"},
"Gold Block Stair",
"Gold Block Slab",
default.node_sound_stone_defaults())

View File

@ -1,4 +1,5 @@
=== TNT mod for Minetest === Minetest Game mod: tnt
======================
by PilzAdam and ShadowNinja by PilzAdam and ShadowNinja
Introduction: Introduction:

View File

@ -1,4 +1,4 @@
Minetest 0.4 mod: vessels Minetest Game mod: vessels
========================== ==========================
Crafts Crafts

View File

@ -1,5 +1,5 @@
Minetest 0.4 mod: wool Minetest Game mod: wool
====================== =======================
Mostly backward-compatible with jordach's 16-color wool mod. Mostly backward-compatible with jordach's 16-color wool mod.

Some files were not shown because too many files have changed in this diff Show More