Merge server to github
0
minetestforfun_game/README.txt
Executable file → Normal file
0
minetestforfun_game/game.conf
Executable file → Normal file
101
minetestforfun_game/game_api.txt
Executable file → Normal file
@ -46,8 +46,6 @@ The doors mod allows modders to register custom doors.
|
|||||||
node_box_top = regular nodebox, see [Node boxes], OPTIONAL,
|
node_box_top = regular nodebox, see [Node boxes], OPTIONAL,
|
||||||
selection_box_bottom = regular nodebox, see [Node boxes], OPTIONAL,
|
selection_box_bottom = regular nodebox, see [Node boxes], OPTIONAL,
|
||||||
selection_box_top = regular nodebox, see [Node boxes], OPTIONAL,
|
selection_box_top = regular nodebox, see [Node boxes], OPTIONAL,
|
||||||
sound_open_door = sound play for open door, OPTIONAL,
|
|
||||||
sound_close_door = sound play for close door, OPTIONAL,
|
|
||||||
only_placer_can_open = true/false,
|
only_placer_can_open = true/false,
|
||||||
^ If true, only placer can open the door (locked for others)
|
^ If true, only placer can open the door (locked for others)
|
||||||
}
|
}
|
||||||
@ -120,7 +118,7 @@ Xpanes API
|
|||||||
Creates panes that automatically connect to each other
|
Creates panes that automatically connect to each other
|
||||||
|
|
||||||
xpanes.register_pane(subname, def)
|
xpanes.register_pane(subname, def)
|
||||||
-> subname: used for nodename. Result: "xpanes:subname" and "xpanes:subname_{2..15}"
|
-> subname: used for nodename. Result: "xpanes:subname_{1..16}"
|
||||||
-> def: See [#Pane definition]
|
-> def: See [#Pane definition]
|
||||||
|
|
||||||
#Pane definition
|
#Pane definition
|
||||||
@ -134,6 +132,10 @@ xpanes.register_pane(subname, def)
|
|||||||
^ See [#Default sounds]
|
^ See [#Default sounds]
|
||||||
recipe = {{"","","","","","","","",""}},
|
recipe = {{"","","","","","","","",""}},
|
||||||
^ Recipe field only
|
^ Recipe field only
|
||||||
|
on_construct = function(pos)
|
||||||
|
update_pane(pos, "pane")
|
||||||
|
end,
|
||||||
|
^ Required to handle rotation correctly
|
||||||
}
|
}
|
||||||
|
|
||||||
Default sounds
|
Default sounds
|
||||||
@ -195,96 +197,3 @@ Model Definition
|
|||||||
-- ...
|
-- ...
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
Leafdecay
|
|
||||||
---------
|
|
||||||
To enable leaf decay for a node, add it to the "leafdecay" group.
|
|
||||||
|
|
||||||
The rating of the group determines how far from a node in the group "tree"
|
|
||||||
the node can be without decaying.
|
|
||||||
|
|
||||||
If param2 of the node is ~= 0, the node will always be preserved. Thus, if
|
|
||||||
the player places a node of that kind, you will want to set param2=1 or so.
|
|
||||||
|
|
||||||
The function default.after_place_leaves can be set as after_place_node of a node
|
|
||||||
to set param2 to 1 if the player places the node (should not be used for nodes
|
|
||||||
that use param2 otherwise (e.g. facedir)).
|
|
||||||
|
|
||||||
If the node is in the leafdecay_drop group then it will always be dropped as an
|
|
||||||
item.
|
|
||||||
|
|
||||||
Dyes
|
|
||||||
----
|
|
||||||
To make recipes that will work with any dye ever made by anybody, define
|
|
||||||
them based on groups. You can select any group of groups, based on your need for
|
|
||||||
amount of colors.
|
|
||||||
|
|
||||||
#Color groups
|
|
||||||
-------------
|
|
||||||
Base color groups:
|
|
||||||
- basecolor_white
|
|
||||||
- basecolor_grey
|
|
||||||
- basecolor_black
|
|
||||||
- basecolor_red
|
|
||||||
- basecolor_yellow
|
|
||||||
- basecolor_green
|
|
||||||
- basecolor_cyan
|
|
||||||
- basecolor_blue
|
|
||||||
- basecolor_magenta
|
|
||||||
|
|
||||||
Extended color groups (* = equal to a base color):
|
|
||||||
* excolor_white
|
|
||||||
- excolor_lightgrey
|
|
||||||
* excolor_grey
|
|
||||||
- excolor_darkgrey
|
|
||||||
* excolor_black
|
|
||||||
* excolor_red
|
|
||||||
- excolor_orange
|
|
||||||
* excolor_yellow
|
|
||||||
- excolor_lime
|
|
||||||
* excolor_green
|
|
||||||
- excolor_aqua
|
|
||||||
* excolor_cyan
|
|
||||||
- excolor_sky_blue
|
|
||||||
* excolor_blue
|
|
||||||
- excolor_violet
|
|
||||||
* excolor_magenta
|
|
||||||
- excolor_red_violet
|
|
||||||
|
|
||||||
The whole unifieddyes palette as groups:
|
|
||||||
- unicolor_<excolor>
|
|
||||||
For the following, no white/grey/black is allowed:
|
|
||||||
- unicolor_medium_<excolor>
|
|
||||||
- unicolor_dark_<excolor>
|
|
||||||
- unicolor_light_<excolor>
|
|
||||||
- unicolor_<excolor>_s50
|
|
||||||
- unicolor_medium_<excolor>_s50
|
|
||||||
- unicolor_dark_<excolor>_s50
|
|
||||||
|
|
||||||
Example of one shapeless recipe using a color group:
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "shapeless",
|
|
||||||
output = '<mod>:item_yellow',
|
|
||||||
recipe = {'<mod>:item_no_color', 'group:basecolor_yellow'},
|
|
||||||
})
|
|
||||||
|
|
||||||
#Color lists
|
|
||||||
------------
|
|
||||||
dye.basecolors
|
|
||||||
^ Array containing the names of available base colors
|
|
||||||
|
|
||||||
dye.excolors
|
|
||||||
^ Array containing the names of the available extended colors
|
|
||||||
|
|
||||||
Leafdecay
|
|
||||||
---------
|
|
||||||
To enable leaf decay for a node, add it to the "leafdecay" group.
|
|
||||||
|
|
||||||
The rating of the group determines how far from a node in the group "tree"
|
|
||||||
the node can be without decaying.
|
|
||||||
|
|
||||||
If param2 of the node is ~= 0, the node will always be preserved. Thus, if
|
|
||||||
the player places a node of that kind, you will want to set param2=1 or so.
|
|
||||||
|
|
||||||
If the node is in the leafdecay_drop group then it will always be dropped as an
|
|
||||||
item.
|
|
||||||
|
0
minetestforfun_game/menu/header.png
Executable file → Normal file
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 152 KiB |
0
minetestforfun_game/menu/icon.png
Executable file → Normal file
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
1
minetestforfun_game/minetest.conf
Executable file → Normal file
@ -1,4 +1,3 @@
|
|||||||
mg_flags = dungeons
|
|
||||||
mgv6_spflags = biomeblend, jungles
|
mgv6_spflags = biomeblend, jungles
|
||||||
|
|
||||||
movement_liquid_sink = 25
|
movement_liquid_sink = 25
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
-- Minetest 0.4 mod: bucket
|
-- Minetest 0.4 mod: bucket
|
||||||
-- See README.txt for licensing and other information.
|
-- See README.txt for licensing and other information.
|
||||||
|
|
||||||
|
local LIQUID_MAX = 8 --The number of water levels when liquid_finite is enabled
|
||||||
|
|
||||||
minetest.register_alias("bucket", "bucket:bucket_empty")
|
minetest.register_alias("bucket", "bucket:bucket_empty")
|
||||||
minetest.register_alias("bucket_water", "bucket:bucket_water")
|
minetest.register_alias("bucket_water", "bucket:bucket_water")
|
||||||
minetest.register_alias("bucket_acid", "bucket:bucket_acid")
|
minetest.register_alias("bucket_acid", "bucket:bucket_acid")
|
||||||
@ -71,20 +73,40 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
|
|||||||
itemstack) or itemstack
|
itemstack) or itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
local place_liquid = function(pos, node, source, flowing)
|
local place_liquid = function(pos, node, source, flowing, fullness)
|
||||||
if check_protection(pos,
|
if check_protection(pos,
|
||||||
user and user:get_player_name() or "",
|
user and user:get_player_name() or "",
|
||||||
"place "..source) then
|
"place "..source) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
minetest.add_node(pos,{name=source})
|
if math.floor(fullness/128) == 1 or
|
||||||
|
not minetest.setting_getbool("liquid_finite") then
|
||||||
|
minetest.add_node(pos, {name=source,
|
||||||
|
param2=fullness})
|
||||||
|
return
|
||||||
|
elseif node.name == flowing then
|
||||||
|
fullness = fullness + node.param2
|
||||||
|
elseif node.name == source then
|
||||||
|
fullness = LIQUID_MAX
|
||||||
|
end
|
||||||
|
|
||||||
|
if fullness >= LIQUID_MAX then
|
||||||
|
minetest.add_node(pos, {name=source,
|
||||||
|
param2=LIQUID_MAX})
|
||||||
|
else
|
||||||
|
minetest.add_node(pos, {name=flowing,
|
||||||
|
param2=fullness})
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Check if pointing to a buildable node
|
-- Check if pointing to a buildable node
|
||||||
|
local fullness = tonumber(itemstack:get_metadata())
|
||||||
|
if not fullness then fullness = LIQUID_MAX end
|
||||||
|
|
||||||
if ndef and ndef.buildable_to then
|
if ndef and ndef.buildable_to then
|
||||||
-- buildable; replace the node
|
-- buildable; replace the node
|
||||||
place_liquid(pointed_thing.under, node,
|
place_liquid(pointed_thing.under, node,
|
||||||
flowing)
|
source, flowing, fullness)
|
||||||
else
|
else
|
||||||
-- not buildable to; place the liquid above
|
-- not buildable to; place the liquid above
|
||||||
-- check if the node above can be replaced
|
-- check if the node above can be replaced
|
||||||
@ -92,7 +114,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
|
|||||||
if node and minetest.registered_nodes[node.name].buildable_to then
|
if node and minetest.registered_nodes[node.name].buildable_to then
|
||||||
place_liquid(pointed_thing.above,
|
place_liquid(pointed_thing.above,
|
||||||
node, source,
|
node, source,
|
||||||
flowing)
|
flowing, fullness)
|
||||||
else
|
else
|
||||||
-- do not remove the bucket with the liquid
|
-- do not remove the bucket with the liquid
|
||||||
return
|
return
|
||||||
@ -119,7 +141,9 @@ minetest.register_craftitem(":bucket:bucket_empty", {
|
|||||||
node = minetest.get_node(pointed_thing.under)
|
node = minetest.get_node(pointed_thing.under)
|
||||||
liquiddef = bucket.liquids[node.name]
|
liquiddef = bucket.liquids[node.name]
|
||||||
if liquiddef ~= nil and liquiddef.itemname ~= nil and
|
if liquiddef ~= nil and liquiddef.itemname ~= nil and
|
||||||
node.name == liquiddef.source then
|
(node.name == liquiddef.source or
|
||||||
|
(node.name == liquiddef.flowing and
|
||||||
|
minetest.setting_getbool("liquid_finite"))) then
|
||||||
if check_protection(pointed_thing.under,
|
if check_protection(pointed_thing.under,
|
||||||
user:get_player_name(),
|
user:get_player_name(),
|
||||||
"take ".. node.name) then
|
"take ".. node.name) then
|
||||||
@ -138,9 +162,13 @@ minetest.register_craftitem(":bucket:bucket_empty", {
|
|||||||
minetest.add_node(pointed_thing.under, {name="air"})
|
minetest.add_node(pointed_thing.under, {name="air"})
|
||||||
count = count - 1
|
count = count - 1
|
||||||
itemstack:set_count(count)
|
itemstack:set_count(count)
|
||||||
|
if node.name == liquiddef.source then
|
||||||
|
node.param2 = LIQUID_MAX
|
||||||
|
end
|
||||||
|
bucket_liquid = ItemStack({name = liquiddef.itemname,
|
||||||
|
metadata = tostring(node.param2)})
|
||||||
inv:add_item("main", bucket_liquid)
|
inv:add_item("main", bucket_liquid)
|
||||||
return ItemStack(liquiddef.itemname)
|
return itemstack
|
||||||
--return itemstack
|
|
||||||
else
|
else
|
||||||
minetest.chat_send_player(user:get_player_name(), "Your inventory is full.")
|
minetest.chat_send_player(user:get_player_name(), "Your inventory is full.")
|
||||||
end
|
end
|
||||||
|
@ -23,6 +23,13 @@ Everything not listed in here:
|
|||||||
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
|
||||||
|
|
||||||
Cisoun's WTFPL texture pack:
|
Cisoun's WTFPL texture pack:
|
||||||
|
default_chest_front.png
|
||||||
|
default_chest_lock.png
|
||||||
|
default_chest_side.png
|
||||||
|
default_chest_top.png
|
||||||
|
default_dirt.png
|
||||||
|
default_grass.png
|
||||||
|
default_grass_side.png
|
||||||
default_jungletree.png
|
default_jungletree.png
|
||||||
default_jungletree_top.png
|
default_jungletree_top.png
|
||||||
default_lava.png
|
default_lava.png
|
||||||
@ -34,9 +41,6 @@ Cisoun's WTFPL texture pack:
|
|||||||
default_tree_top.png
|
default_tree_top.png
|
||||||
default_water.png
|
default_water.png
|
||||||
|
|
||||||
Cisoun's conifers mod (WTFPL):
|
|
||||||
default_pine_needles.png
|
|
||||||
|
|
||||||
Originating from G4JC's Almost MC Texture Pack:
|
Originating from G4JC's Almost MC Texture Pack:
|
||||||
default_torch.png
|
default_torch.png
|
||||||
default_torch_on_ceiling.png
|
default_torch_on_ceiling.png
|
||||||
@ -64,12 +68,12 @@ VanessaE (WTFPL):
|
|||||||
default_sand.png
|
default_sand.png
|
||||||
default_sandstone_brick.png
|
default_sandstone_brick.png
|
||||||
|
|
||||||
Calinou (CC BY-SA):
|
Calinou (CC BY-SA 3.0):
|
||||||
|
crack_anylength.png
|
||||||
default_brick.png
|
default_brick.png
|
||||||
default_papyrus.png
|
default_papyrus.png
|
||||||
default_copper_lump.png
|
default_copper_lump.png
|
||||||
default_mineral_copper.png
|
default_mineral_copper.png
|
||||||
default_glass_detail.png
|
|
||||||
|
|
||||||
MirceaKitsune (WTFPL):
|
MirceaKitsune (WTFPL):
|
||||||
character.x
|
character.x
|
||||||
@ -83,6 +87,7 @@ PilzAdam (WTFPL):
|
|||||||
default_junglewood.png
|
default_junglewood.png
|
||||||
default_obsidian_glass.png
|
default_obsidian_glass.png
|
||||||
default_obsidian_shard.png
|
default_obsidian_shard.png
|
||||||
|
default_mossycobble.png
|
||||||
default_gold_lump.png
|
default_gold_lump.png
|
||||||
default_mineral_gold.png
|
default_mineral_gold.png
|
||||||
default_snowball.png
|
default_snowball.png
|
||||||
@ -97,7 +102,6 @@ Splizard (CC BY-SA 3.0):
|
|||||||
default_snow.png
|
default_snow.png
|
||||||
default_snow_side.png
|
default_snow_side.png
|
||||||
default_ice.png
|
default_ice.png
|
||||||
default_pine_sapling.png
|
|
||||||
|
|
||||||
Zeg9 (CC BY-SA 3.0):
|
Zeg9 (CC BY-SA 3.0):
|
||||||
default_coal_block.png
|
default_coal_block.png
|
||||||
@ -108,9 +112,6 @@ Zeg9 (CC BY-SA 3.0):
|
|||||||
|
|
||||||
paramat (CC BY-SA 3.0):
|
paramat (CC BY-SA 3.0):
|
||||||
wieldhand.png, based on character.png by Jordach (CC BY-SA 3.0)
|
wieldhand.png, based on character.png by Jordach (CC BY-SA 3.0)
|
||||||
default_pinetree.png
|
|
||||||
default_pinetree_top.png
|
|
||||||
default_pinewood.png
|
|
||||||
|
|
||||||
brunob.santos (CC BY-SA 4.0):
|
brunob.santos (CC BY-SA 4.0):
|
||||||
default_desert_cobble.png
|
default_desert_cobble.png
|
||||||
@ -118,6 +119,7 @@ brunob.santos (CC BY-SA 4.0):
|
|||||||
BlockMen (CC BY-SA 3.0):
|
BlockMen (CC BY-SA 3.0):
|
||||||
default_stone_brick.png
|
default_stone_brick.png
|
||||||
default_wood.png
|
default_wood.png
|
||||||
|
default_cobble.png
|
||||||
default_clay_brick.png
|
default_clay_brick.png
|
||||||
default_tool_steelsword.png
|
default_tool_steelsword.png
|
||||||
default_bronze_ingot.png
|
default_bronze_ingot.png
|
||||||
@ -131,25 +133,10 @@ BlockMen (CC BY-SA 3.0):
|
|||||||
default_book.png
|
default_book.png
|
||||||
default_paper.png
|
default_paper.png
|
||||||
default_stick.png
|
default_stick.png
|
||||||
default_chest_front.png
|
|
||||||
default_chest_lock.png
|
|
||||||
default_chest_side.png
|
|
||||||
default_chest_top.png
|
|
||||||
bubble.png
|
bubble.png
|
||||||
heart.png
|
heart.png
|
||||||
gui_*.png
|
gui_*.png
|
||||||
|
|
||||||
Neuromancer (CC BY-SA 2.0):
|
|
||||||
default_cobble.png, based on texture by Brane praefect
|
|
||||||
default_mossycobble.png, based on texture by Brane praefect
|
|
||||||
Neuromancer (CC BY-SA 3.0):
|
|
||||||
default_dirt.png
|
|
||||||
default_furnace_*.png
|
|
||||||
|
|
||||||
Philipbenr (CC BY-SA 3.0):
|
|
||||||
default_grass.png
|
|
||||||
default_grass_side.png
|
|
||||||
|
|
||||||
Glass breaking sounds (CC BY 3.0):
|
Glass breaking sounds (CC BY 3.0):
|
||||||
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
|
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
|
||||||
2: http://www.freesound.org/people/Tomlija/sounds/97669/
|
2: http://www.freesound.org/people/Tomlija/sounds/97669/
|
||||||
|
@ -17,14 +17,12 @@ minetest.register_craftitem("default:paper", {
|
|||||||
minetest.register_craftitem("default:book", {
|
minetest.register_craftitem("default:book", {
|
||||||
description = "Book",
|
description = "Book",
|
||||||
inventory_image = "default_book.png",
|
inventory_image = "default_book.png",
|
||||||
groups = {book=1},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("default:coal_lump", {
|
minetest.register_craftitem("default:coal_lump", {
|
||||||
description = "Coal Lump",
|
description = "Coal Lump",
|
||||||
wield_scale = {x = 1, y = 1, z = 2},
|
wield_scale = {x = 1, y = 1, z = 2},
|
||||||
inventory_image = "default_coal_lump.png",
|
inventory_image = "default_coal_lump.png",
|
||||||
groups = {coal = 1}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craftitem("default:iron_lump", {
|
minetest.register_craftitem("default:iron_lump", {
|
||||||
|
@ -7,20 +7,40 @@
|
|||||||
function default.node_sound_defaults(table)
|
function default.node_sound_defaults(table)
|
||||||
table = table or {}
|
table = table or {}
|
||||||
table.footstep = table.footstep or
|
table.footstep = table.footstep or
|
||||||
{name="", gain=1.0}
|
{name = "default_hard_footstep", gain = 0.6}
|
||||||
|
table.dig = table.dig or
|
||||||
|
{name = "default_hard_footstep", gain = 0.7}
|
||||||
table.dug = table.dug or
|
table.dug = table.dug or
|
||||||
{name="default_dug_node", gain=0.25}
|
{name = "default_hard_footstep", gain = 0.8}
|
||||||
table.place = table.place or
|
table.place = table.place or
|
||||||
{name="default_place_node_hard", gain=1.0}
|
{name = "default_hard_footstep", gain = 0.8}
|
||||||
return table
|
return table
|
||||||
end
|
end
|
||||||
|
|
||||||
function default.node_sound_stone_defaults(table)
|
function default.node_sound_stone_defaults(table)
|
||||||
table = table or {}
|
table = table or {}
|
||||||
table.footstep = table.footstep or
|
table.footstep = table.footstep or
|
||||||
{name="default_hard_footstep", gain=0.5}
|
{name = "default_hard_footstep", gain = 0.6}
|
||||||
|
table.dig = table.dig or
|
||||||
|
{name = "default_hard_footstep", gain = 0.7}
|
||||||
table.dug = table.dug or
|
table.dug = table.dug or
|
||||||
{name="default_hard_footstep", gain=1.0}
|
{name = "default_hard_footstep", gain = 0.8}
|
||||||
|
table.place = table.place or
|
||||||
|
{name = "default_hard_footstep", gain = 0.8}
|
||||||
|
default.node_sound_defaults(table)
|
||||||
|
return table
|
||||||
|
end
|
||||||
|
|
||||||
|
function default.node_sound_metal_defaults(table)
|
||||||
|
table = table or {}
|
||||||
|
table.footstep = table.footstep or
|
||||||
|
{name = "default_metal_footstep", gain = 0.575}
|
||||||
|
table.dig = table.dig or
|
||||||
|
{name = "default_metal_footstep", gain = 0.65}
|
||||||
|
table.dug = table.dug or
|
||||||
|
{name = "default_metal_footstep", gain = 0.8}
|
||||||
|
table.place = table.place or
|
||||||
|
{name = "default_metal_footstep", gain = 0.8}
|
||||||
default.node_sound_defaults(table)
|
default.node_sound_defaults(table)
|
||||||
return table
|
return table
|
||||||
end
|
end
|
||||||
@ -28,11 +48,27 @@ end
|
|||||||
function default.node_sound_dirt_defaults(table)
|
function default.node_sound_dirt_defaults(table)
|
||||||
table = table or {}
|
table = table or {}
|
||||||
table.footstep = table.footstep or
|
table.footstep = table.footstep or
|
||||||
{name="default_dirt_footstep", gain=1.0}
|
{name = "default_dirt_footstep", gain = 0.8}
|
||||||
|
table.dig = table.dig or
|
||||||
|
{name = "default_dirt_footstep", gain = 0.9}
|
||||||
table.dug = table.dug or
|
table.dug = table.dug or
|
||||||
{name="default_dirt_footstep", gain=1.5}
|
{name = "default_dirt_footstep", gain = 1.0}
|
||||||
table.place = table.place or
|
table.place = table.place or
|
||||||
{name="default_place_node", gain=1.0}
|
{name = "default_dirt_footstep", gain = 1.0}
|
||||||
|
default.node_sound_defaults(table)
|
||||||
|
return table
|
||||||
|
end
|
||||||
|
|
||||||
|
function default.node_sound_gravel_defaults(table)
|
||||||
|
table = table or {}
|
||||||
|
table.footstep = table.footstep or
|
||||||
|
{name = "default_dirt_footstep", gain = 0.8}
|
||||||
|
table.dig = table.dig or
|
||||||
|
{name = "default_dirt_footstep", gain = 0.9}
|
||||||
|
table.dug = table.dug or
|
||||||
|
{name = "default_dirt_footstep", gain = 1.0}
|
||||||
|
table.place = table.place or
|
||||||
|
{name = "default_dirt_footstep", gain = 1.0}
|
||||||
default.node_sound_defaults(table)
|
default.node_sound_defaults(table)
|
||||||
return table
|
return table
|
||||||
end
|
end
|
||||||
@ -40,11 +76,13 @@ end
|
|||||||
function default.node_sound_sand_defaults(table)
|
function default.node_sound_sand_defaults(table)
|
||||||
table = table or {}
|
table = table or {}
|
||||||
table.footstep = table.footstep or
|
table.footstep = table.footstep or
|
||||||
{name="default_sand_footstep", gain=0.2}
|
{name = "default_sand_footstep", gain = 0.6}
|
||||||
|
table.dig = table.dig or
|
||||||
|
{name = "default_sand_footstep", gain = 0.7}
|
||||||
table.dug = table.dug or
|
table.dug = table.dug or
|
||||||
{name="default_sand_footstep", gain=0.4}
|
{name = "default_sand_footstep", gain = 0.8}
|
||||||
table.place = table.place or
|
table.place = table.place or
|
||||||
{name="default_place_node", gain=1.0}
|
{name = "default_sand_footstep", gain = 0.8}
|
||||||
default.node_sound_defaults(table)
|
default.node_sound_defaults(table)
|
||||||
return table
|
return table
|
||||||
end
|
end
|
||||||
@ -52,9 +90,13 @@ end
|
|||||||
function default.node_sound_wood_defaults(table)
|
function default.node_sound_wood_defaults(table)
|
||||||
table = table or {}
|
table = table or {}
|
||||||
table.footstep = table.footstep or
|
table.footstep = table.footstep or
|
||||||
{name="default_wood_footstep", gain=0.5}
|
{name = "default_wood_footstep", gain = 0.625}
|
||||||
|
table.dig = table.dig or
|
||||||
|
{name = "default_wood_footstep", gain = 0.7}
|
||||||
table.dug = table.dug or
|
table.dug = table.dug or
|
||||||
{name="default_wood_footstep", gain=1.0}
|
{name = "default_wood_footstep", gain = 0.8}
|
||||||
|
table.place = table.place or
|
||||||
|
{name = "default_wood_footstep", gain = 0.8}
|
||||||
default.node_sound_defaults(table)
|
default.node_sound_defaults(table)
|
||||||
return table
|
return table
|
||||||
end
|
end
|
||||||
@ -62,13 +104,13 @@ end
|
|||||||
function default.node_sound_leaves_defaults(table)
|
function default.node_sound_leaves_defaults(table)
|
||||||
table = table or {}
|
table = table or {}
|
||||||
table.footstep = table.footstep or
|
table.footstep = table.footstep or
|
||||||
{name="default_grass_footstep", gain=0.35}
|
{name = "default_grass_footstep", gain = 0.6}
|
||||||
table.dug = table.dug or
|
|
||||||
{name="default_grass_footstep", gain=0.7}
|
|
||||||
table.dig = table.dig or
|
table.dig = table.dig or
|
||||||
{name="default_dig_crumbly", gain=0.4}
|
{name = "default_grass_footstep", gain = 0.7}
|
||||||
|
table.dug = table.dug or
|
||||||
|
{name = "default_snow_footstep", gain = 0.8}
|
||||||
table.place = table.place or
|
table.place = table.place or
|
||||||
{name="default_place_node", gain=1.0}
|
{name = "default_snow_footstep", gain = 0.8}
|
||||||
default.node_sound_defaults(table)
|
default.node_sound_defaults(table)
|
||||||
return table
|
return table
|
||||||
end
|
end
|
||||||
@ -76,27 +118,28 @@ end
|
|||||||
function default.node_sound_glass_defaults(table)
|
function default.node_sound_glass_defaults(table)
|
||||||
table = table or {}
|
table = table or {}
|
||||||
table.footstep = table.footstep or
|
table.footstep = table.footstep or
|
||||||
{name="default_glass_footstep", gain=0.5}
|
{name = "default_hard_footstep", gain = 0.55}
|
||||||
|
table.dig = table.dig or
|
||||||
|
{name = "default_hard_footstep", gain = 0.65}
|
||||||
table.dug = table.dug or
|
table.dug = table.dug or
|
||||||
{name="default_break_glass", gain=1.0}
|
{name = "default_break_glass", gain = 0.8}
|
||||||
|
table.place = table.place or
|
||||||
|
{name = "default_hard_footstep", gain = 0.75}
|
||||||
default.node_sound_defaults(table)
|
default.node_sound_defaults(table)
|
||||||
return table
|
return table
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
-- Legacy:
|
||||||
-- Legacy
|
|
||||||
--
|
|
||||||
|
|
||||||
function default.spawn_falling_node(p, nodename)
|
function default.spawn_falling_node(p, nodename)
|
||||||
spawn_falling_node(p, nodename)
|
spawn_falling_node(p, nodename)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Horrible crap to support old code
|
-- Horrible crap to support old code,
|
||||||
-- Don't use this and never do what this does, it's completely wrong!
|
-- don't use this and never do what this does, it's completely wrong!
|
||||||
-- (More specifically, the client and the C++ code doesn't get the group)
|
-- (more specifically, the client and the C++ code doesn't get the group).
|
||||||
function default.register_falling_node(nodename, texture)
|
function default.register_falling_node(nodename, texture)
|
||||||
minetest.log("error", debug.traceback())
|
minetest.log("error", debug.traceback())
|
||||||
minetest.log('error', "WARNING: default.register_falling_node is deprecated")
|
minetest.log("error", "WARNING: default.register_falling_node is deprecated.")
|
||||||
if minetest.registered_nodes[nodename] then
|
if minetest.registered_nodes[nodename] then
|
||||||
minetest.registered_nodes[nodename].groups.falling_node = 1
|
minetest.registered_nodes[nodename].groups.falling_node = 1
|
||||||
end
|
end
|
||||||
@ -108,37 +151,89 @@ end
|
|||||||
|
|
||||||
-- Global environment step function
|
-- Global environment step function
|
||||||
function on_step(dtime)
|
function on_step(dtime)
|
||||||
-- print("on_step")
|
-- print("on_step, " .. p .. ", " .. node)
|
||||||
end
|
end
|
||||||
minetest.register_globalstep(on_step)
|
minetest.register_globalstep(on_step)
|
||||||
|
|
||||||
function on_placenode(p, node)
|
function on_placenode(p, node)
|
||||||
--print("on_placenode")
|
-- print("on_placenode, " .. p .. ", " .. node)
|
||||||
end
|
end
|
||||||
minetest.register_on_placenode(on_placenode)
|
minetest.register_on_placenode(on_placenode)
|
||||||
|
|
||||||
function on_dignode(p, node)
|
function on_dignode(p, node)
|
||||||
--print("on_dignode")
|
-- print("on_dignode, " .. p .. ", " .. node)
|
||||||
end
|
end
|
||||||
minetest.register_on_dignode(on_dignode)
|
minetest.register_on_dignode(on_dignode)
|
||||||
|
|
||||||
function on_punchnode(p, node)
|
function on_punchnode(p, node)
|
||||||
|
-- print("on_punchnode, " .. p .. ", " .. node)
|
||||||
end
|
end
|
||||||
minetest.register_on_punchnode(on_punchnode)
|
minetest.register_on_punchnode(on_punchnode)
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Lava cooling
|
-- Lava cooling
|
||||||
--
|
--
|
||||||
|
|
||||||
|
local function cool_wf_vm(pos, node1, node2)
|
||||||
|
local t1 = os.clock()
|
||||||
|
local minp = vector.subtract(pos, 10)
|
||||||
|
local maxp = vector.add(pos, 10)
|
||||||
|
local manip = minetest.get_voxel_manip()
|
||||||
|
local emerged_pos1, emerged_pos2 = manip:read_from_map(minp, maxp)
|
||||||
|
local area = VoxelArea:new({MinEdge=emerged_pos1, MaxEdge=emerged_pos2})
|
||||||
|
local nodes = manip:get_data()
|
||||||
|
|
||||||
|
local stone = minetest.get_content_id(node2)
|
||||||
|
local lava = minetest.get_content_id(node1)
|
||||||
|
|
||||||
|
for i in area:iterp(minp, maxp) do
|
||||||
|
local p = area:position(i)
|
||||||
|
if nodes[i] == lava and minetest.find_node_near(p, 1, {"group:water"}) then
|
||||||
|
nodes[i] = stone
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
manip:set_data(nodes)
|
||||||
|
manip:write_to_map()
|
||||||
|
-- minetest.log("action", "Lava cooling happened at (" .. pos.x .. "," .. pos.y .. "," .. pos.z .. ").")
|
||||||
|
local t1 = os.clock()
|
||||||
|
manip:update_map()
|
||||||
|
-- minetest.log("action", string.format("Lava cooling updated the map after ca. %.2fs.", os.clock() - t1))
|
||||||
|
end
|
||||||
|
|
||||||
|
local del1 = 0
|
||||||
|
local count = 0
|
||||||
|
|
||||||
default.cool_lava_source = function(pos)
|
default.cool_lava_source = function(pos)
|
||||||
minetest.set_node(pos, {name="default:obsidian"})
|
local del2 = tonumber(os.clock())
|
||||||
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25})
|
if del2-del1 < 0.1
|
||||||
|
and count > 1 then
|
||||||
|
cool_wf_vm(pos, "default:lava_source", "default:obsidian_cooled")
|
||||||
|
count = 0
|
||||||
|
else
|
||||||
|
minetest.set_node(pos, {name = "default:obsidian_cooled"})
|
||||||
|
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.2})
|
||||||
|
if del2-del1 < 0.1 then
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
del1 = del2
|
||||||
end
|
end
|
||||||
|
|
||||||
default.cool_lava_flowing = function(pos)
|
default.cool_lava_flowing = function(pos)
|
||||||
minetest.set_node(pos, {name="default:stone"})
|
local del2 = tonumber(os.clock())
|
||||||
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25})
|
if del2-del1 < 0.1
|
||||||
|
and count > 1 then
|
||||||
|
cool_wf_vm(pos, "default:lava_flowing", "default:cobble_cooled")
|
||||||
|
count = 0
|
||||||
|
else
|
||||||
|
minetest.set_node(pos, {name = "default:cobble_cooled"})
|
||||||
|
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.2})
|
||||||
|
if del2-del1 < 0.1 then
|
||||||
|
count = count + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
del1 = del2
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
@ -169,7 +264,7 @@ minetest.register_abm({
|
|||||||
nodenames = {"default:cactus"},
|
nodenames = {"default:cactus"},
|
||||||
neighbors = {"group:sand"},
|
neighbors = {"group:sand"},
|
||||||
interval = 30,
|
interval = 30,
|
||||||
chance = 25,
|
chance = 50,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
pos.y = pos.y - 1
|
pos.y = pos.y - 1
|
||||||
local name = minetest.get_node(pos).name
|
local name = minetest.get_node(pos).name
|
||||||
@ -191,13 +286,17 @@ 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:dirt_with_snow", "default:sand", "default:desert_sand"},
|
||||||
interval = 30,
|
interval = 30,
|
||||||
chance = 25,
|
chance = 30,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
pos.y = pos.y - 1
|
pos.y = pos.y - 1
|
||||||
local name = minetest.get_node(pos).name
|
local name = minetest.get_node(pos).name
|
||||||
if name == "default:dirt" or name == "default:dirt_with_grass" then
|
if name == "default:dirt"
|
||||||
|
or name == "default:dirt_with_grass"
|
||||||
|
or name == "default:dirt_with_snow"
|
||||||
|
or name == "default:sand"
|
||||||
|
or name == "default:desert_sand" then
|
||||||
if minetest.find_node_near(pos, 3, {"group:water"}) == nil then
|
if minetest.find_node_near(pos, 3, {"group:water"}) == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -216,10 +315,6 @@ minetest.register_abm({
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
--
|
|
||||||
-- dig upwards
|
|
||||||
--
|
|
||||||
|
|
||||||
function default.dig_up(pos, node, digger)
|
function default.dig_up(pos, node, digger)
|
||||||
if digger == nil then return end
|
if digger == nil then return end
|
||||||
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
|
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||||
@ -233,6 +328,19 @@ end
|
|||||||
-- Leafdecay
|
-- Leafdecay
|
||||||
--
|
--
|
||||||
|
|
||||||
|
-- To enable leaf decay for a node, add it to the "leafdecay" group.
|
||||||
|
--
|
||||||
|
-- The rating of the group determines how far from a node in the group "tree"
|
||||||
|
-- the node can be without decaying.
|
||||||
|
--
|
||||||
|
-- If param2 of the node is ~= 0, the node will always be preserved. Thus, if
|
||||||
|
-- the player places a node of that kind, you will want to set param2= 1 or so.
|
||||||
|
--
|
||||||
|
-- If the node is in the leafdecay_drop group then the it will always be dropped
|
||||||
|
-- as an item
|
||||||
|
|
||||||
|
if minetest.setting_getbool("leaf_decay") ~= false then -- “If not defined or set to true then”
|
||||||
|
|
||||||
default.leafdecay_trunk_cache = {}
|
default.leafdecay_trunk_cache = {}
|
||||||
default.leafdecay_enable_cache = true
|
default.leafdecay_enable_cache = true
|
||||||
-- Spread the load of finding trunks
|
-- Spread the load of finding trunks
|
||||||
@ -244,17 +352,10 @@ minetest.register_globalstep(function(dtime)
|
|||||||
math.floor(dtime * finds_per_second)
|
math.floor(dtime * finds_per_second)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
|
|
||||||
local node = minetest.get_node(pos)
|
|
||||||
node.param2 = 1
|
|
||||||
minetest.set_node(pos, node)
|
|
||||||
end
|
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"group:leafdecay"},
|
nodenames = {"group:leafdecay"},
|
||||||
neighbors = {"air", "group:liquid"},
|
neighbors = {"air", "group:liquid"},
|
||||||
-- A low interval and a high inverse chance spreads the load
|
interval = 1, -- A low interval and a high inverse chance spreads the load.
|
||||||
interval = 1,
|
|
||||||
chance = 2,
|
chance = 2,
|
||||||
|
|
||||||
action = function(p0, node, _, _)
|
action = function(p0, node, _, _)
|
||||||
@ -277,13 +378,13 @@ minetest.register_abm({
|
|||||||
if trunkp then
|
if trunkp then
|
||||||
local n = minetest.get_node(trunkp)
|
local n = minetest.get_node(trunkp)
|
||||||
local reg = minetest.registered_nodes[n.name]
|
local reg = minetest.registered_nodes[n.name]
|
||||||
-- Assume ignore is a trunk, to make the thing work at the border of the active area
|
-- Assume ignore is a trunk, to make the thing work at the border of the active area:
|
||||||
if n.name == "ignore" or (reg and reg.groups.tree and reg.groups.tree ~= 0) then
|
if n.name == "ignore" or (reg and reg.groups.tree and reg.groups.tree ~= 0) then
|
||||||
--print("cached trunk still exists")
|
-- print("Cached trunk still exists.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
--print("cached trunk is invalid")
|
-- print("Cached trunk is invalid.")
|
||||||
-- Cache is invalid
|
-- Cache is invalid:
|
||||||
table.remove(default.leafdecay_trunk_cache, p0_hash)
|
table.remove(default.leafdecay_trunk_cache, p0_hash)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -292,34 +393,30 @@ minetest.register_abm({
|
|||||||
end
|
end
|
||||||
default.leafdecay_trunk_find_allow_accumulator =
|
default.leafdecay_trunk_find_allow_accumulator =
|
||||||
default.leafdecay_trunk_find_allow_accumulator - 1
|
default.leafdecay_trunk_find_allow_accumulator - 1
|
||||||
-- Assume ignore is a trunk, to make the thing work at the border of the active area
|
-- Assume ignore is a trunk, to make the thing work at the border of the active area:
|
||||||
local p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"})
|
local p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"})
|
||||||
if p1 then
|
if p1 then
|
||||||
do_preserve = true
|
do_preserve = true
|
||||||
if default.leafdecay_enable_cache then
|
if default.leafdecay_enable_cache then
|
||||||
--print("caching trunk")
|
-- print("Caching trunk.")
|
||||||
-- Cache the trunk
|
-- Cache the trunk:
|
||||||
default.leafdecay_trunk_cache[p0_hash] = p1
|
default.leafdecay_trunk_cache[p0_hash] = p1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not do_preserve then
|
if not do_preserve then
|
||||||
-- Drop stuff other than the node itself
|
-- Drop stuff other than the node itself:
|
||||||
local itemstacks = minetest.get_node_drops(n0.name)
|
itemstacks = minetest.get_node_drops(n0.name)
|
||||||
for _, itemname in ipairs(itemstacks) do
|
for _, itemname in ipairs(itemstacks) do
|
||||||
if minetest.get_item_group(n0.name, "leafdecay_drop") ~= 0 or
|
if minetest.get_item_group(n0.name, "leafdecay_drop") ~= 0
|
||||||
itemname ~= n0.name then
|
or itemname ~= n0.name then
|
||||||
local p_drop = {
|
minetest.add_item(p0, itemname)
|
||||||
x = p0.x - 0.5 + math.random(),
|
|
||||||
y = p0.y - 0.5 + math.random(),
|
|
||||||
z = p0.z - 0.5 + math.random(),
|
|
||||||
}
|
|
||||||
minetest.add_item(p_drop, itemname)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Remove node
|
|
||||||
minetest.remove_node(p0)
|
minetest.remove_node(p0)
|
||||||
|
-- minetest.log("action", n0.name .. " decayed at " .. minetest.pos_to_string(p0) .. ".")
|
||||||
nodeupdate(p0)
|
nodeupdate(p0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
end -- Ends: if minetest.setting_getbool("leaf_decay") ~= false
|
||||||
|
@ -1,20 +1,18 @@
|
|||||||
-- 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.
|
||||||
|
|
||||||
-- The API documentation in here was moved into doc/lua_api.txt
|
default = {} -- Definitions made by this mod are usable by all mods.
|
||||||
|
|
||||||
|
-- The API documentation in here was moved into doc/lua_api.txt.
|
||||||
|
|
||||||
WATER_ALPHA = 160
|
WATER_ALPHA = 160
|
||||||
WATER_VISC = 1
|
WATER_VISC = 1
|
||||||
LAVA_VISC = 3 -- Slower movement in lava.
|
LAVA_VISC = 3 -- Slower movement in lava.
|
||||||
LIGHT_MAX = 14 -- 15 is reserved for sunlight.
|
LIGHT_MAX = 14 -- 15 is reserved for sunlight.
|
||||||
|
|
||||||
-- Definitions made by this mod that other mods can use too
|
-- GUI related stuff:
|
||||||
default = {}
|
|
||||||
|
|
||||||
-- GUI related stuff
|
gui_slots = "listcolors[#606060AA;#808080;#101010;#202020;#FFF]"
|
||||||
default.gui_bg = "bgcolor[#080808BB;true]"
|
|
||||||
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
|
|
||||||
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
|
|
||||||
|
|
||||||
function default.get_hotbar_bg(x,y)
|
function default.get_hotbar_bg(x,y)
|
||||||
local out = ""
|
local out = ""
|
||||||
@ -24,21 +22,18 @@ function default.get_hotbar_bg(x,y)
|
|||||||
return out
|
return out
|
||||||
end
|
end
|
||||||
|
|
||||||
default.gui_suvival_form = "size[8,8.5]"..
|
gui_suvival_form = "size[8,8.5]"..
|
||||||
default.gui_bg..
|
gui_slots ..
|
||||||
default.gui_bg_img..
|
"list[current_player;main; 0, 4.25; 8, 4; ]" ..
|
||||||
default.gui_slots..
|
|
||||||
"list[current_player;main;0,4.25;8,1;]"..
|
|
||||||
"list[current_player;main;0,5.5;8,3;8]"..
|
|
||||||
"list[current_player;craft; 1.75, 0.5; 3, 3; ]" ..
|
"list[current_player;craft; 1.75, 0.5; 3, 3; ]" ..
|
||||||
"list[current_player;craftpreview; 5.75, 1.5; 1, 1; ]" ..
|
"list[current_player;craftpreview; 5.75, 1.5; 1, 1; ]" ..
|
||||||
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
|
default.get_hotbar_bg(0, 4.25) ..
|
||||||
default.get_hotbar_bg(0,4.25)
|
default.get_hotbar_bg(0, 5.25)
|
||||||
|
|
||||||
-- Load files
|
-- Load files:
|
||||||
dofile(minetest.get_modpath("default").."/functions.lua")
|
dofile(minetest.get_modpath("default").."/functions.lua")
|
||||||
|
dofile(minetest.get_modpath("default").."/commands.lua")
|
||||||
dofile(minetest.get_modpath("default").."/nodes.lua")
|
dofile(minetest.get_modpath("default").."/nodes.lua")
|
||||||
dofile(minetest.get_modpath("default").."/furnace.lua")
|
|
||||||
dofile(minetest.get_modpath("default").."/tools.lua")
|
dofile(minetest.get_modpath("default").."/tools.lua")
|
||||||
dofile(minetest.get_modpath("default").."/craftitems.lua")
|
dofile(minetest.get_modpath("default").."/craftitems.lua")
|
||||||
dofile(minetest.get_modpath("default").."/crafting.lua")
|
dofile(minetest.get_modpath("default").."/crafting.lua")
|
||||||
|
@ -344,6 +344,81 @@ minetest.register_ore({
|
|||||||
height_min = -30000,
|
height_min = -30000,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if minetest.setting_get("mg_name") == "indev" then
|
||||||
|
-- Floatlands and high mountains springs:
|
||||||
|
minetest.register_ore({
|
||||||
|
ore_type = "scatter",
|
||||||
|
ore = "default:water_source",
|
||||||
|
ore_param2 = 128,
|
||||||
|
wherein = "default:stone",
|
||||||
|
clust_scarcity = 40 *40 *40,
|
||||||
|
clust_num_ores = 8,
|
||||||
|
clust_size = 3,
|
||||||
|
height_min = 100,
|
||||||
|
height_max = 30000,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_ore({
|
||||||
|
ore_type = "scatter",
|
||||||
|
ore = "default:lava_source",
|
||||||
|
ore_param2 = 128,
|
||||||
|
wherein = "default:stone",
|
||||||
|
clust_scarcity = 50 * 50 * 50,
|
||||||
|
clust_num_ores = 5,
|
||||||
|
clust_size = 2,
|
||||||
|
height_min = 10000,
|
||||||
|
height_max = 30000,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_ore({
|
||||||
|
ore_type = "scatter",
|
||||||
|
ore = "default:sand",
|
||||||
|
wherein = "default:stone",
|
||||||
|
clust_scarcity = 20 * 20 * 20,
|
||||||
|
clust_num_ores = 5 * 5 * 3,
|
||||||
|
clust_size = 5,
|
||||||
|
height_min = 500,
|
||||||
|
height_max = 30000,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Underground springs:
|
||||||
|
|
||||||
|
minetest.register_ore({
|
||||||
|
ore_type = "scatter",
|
||||||
|
ore = "default:water_source",
|
||||||
|
ore_param2 = 128,
|
||||||
|
wherein = "default:stone",
|
||||||
|
clust_scarcity = 20 * 20 * 20,
|
||||||
|
clust_num_ores = 10,
|
||||||
|
clust_size = 4,
|
||||||
|
height_min = -10000,
|
||||||
|
height_max = -10,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_ore({
|
||||||
|
ore_type = "scatter",
|
||||||
|
ore = "default:lava_source",
|
||||||
|
ore_param2 = 128,
|
||||||
|
wherein = "default:stone",
|
||||||
|
clust_scarcity = 32 * 32 * 32,
|
||||||
|
clust_num_ores = 5,
|
||||||
|
clust_size = 2,
|
||||||
|
height_min = -30000,
|
||||||
|
height_max = -100,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_ore({
|
||||||
|
ore_type = "scatter",
|
||||||
|
ore = "default:dirt",
|
||||||
|
wherein = "default:stone",
|
||||||
|
clust_scarcity = 16 * 16 * 16,
|
||||||
|
clust_num_ores = 64,
|
||||||
|
clust_size = 5,
|
||||||
|
height_max = 64,
|
||||||
|
height_min = -4096,
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_ore({
|
minetest.register_ore({
|
||||||
ore_type = "scatter",
|
ore_type = "scatter",
|
||||||
ore = "default:gravel",
|
ore = "default:gravel",
|
||||||
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 1.8 KiB |
@ -345,7 +345,7 @@ minetest.register_node("default:gravel", {
|
|||||||
{items = {"default:gravel"}},
|
{items = {"default:gravel"}},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
--sounds = default.node_sound_gravel_defaults(),
|
sounds = default.node_sound_gravel_defaults(),
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
if not pointed_thing.type == "node" then
|
if not pointed_thing.type == "node" then
|
||||||
return itemstack
|
return itemstack
|
||||||
@ -455,7 +455,7 @@ minetest.register_node("default:junglewood", {
|
|||||||
|
|
||||||
minetest.register_node("default:jungleleaves", {
|
minetest.register_node("default:jungleleaves", {
|
||||||
description = "Jungle Leaves",
|
description = "Jungle Leaves",
|
||||||
drawtype = "allfaces_optional",
|
drawtype = "glasslike",
|
||||||
tiles = {"default_jungleleaves.png"},
|
tiles = {"default_jungleleaves.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
waving = 1,
|
waving = 1,
|
||||||
@ -477,6 +477,7 @@ minetest.register_node("default:jungleleaves", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
post_effect_color = {a = 180, r = 30, g = 50, b = 20},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_node("default:junglesapling", {
|
minetest.register_node("default:junglesapling", {
|
||||||
@ -812,7 +813,7 @@ minetest.register_node("default:water_flowing", {
|
|||||||
liquid_alternative_source = "default:water_source",
|
liquid_alternative_source = "default:water_source",
|
||||||
liquid_viscosity = WATER_VISC,
|
liquid_viscosity = WATER_VISC,
|
||||||
freezemelt = "default:snow",
|
freezemelt = "default:snow",
|
||||||
post_effect_color = {a = 120, r = 20, g = 60, b = 80},
|
post_effect_color = {a = 90, r = 20, g = 70, b = 80},
|
||||||
groups = {water= 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1, freezes = 1, melt_around = 1},
|
groups = {water= 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1, freezes = 1, melt_around = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -844,7 +845,7 @@ minetest.register_node("default:water_source", {
|
|||||||
liquid_alternative_source = "default:water_source",
|
liquid_alternative_source = "default:water_source",
|
||||||
liquid_viscosity = WATER_VISC,
|
liquid_viscosity = WATER_VISC,
|
||||||
freezemelt = "default:ice",
|
freezemelt = "default:ice",
|
||||||
post_effect_color = {a = 120, r = 20, g = 60, b = 80},
|
post_effect_color = {a = 90, r = 20, g = 70, b = 80},
|
||||||
groups = {water= 3, liquid = 3, puts_out_fire = 1, freezes = 1},
|
groups = {water= 3, liquid = 3, puts_out_fire = 1, freezes = 1},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -2294,7 +2295,6 @@ minetest.register_node("default:ice", {
|
|||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
use_texture_alpha = true,
|
use_texture_alpha = true,
|
||||||
freezemelt = "default:water_source",
|
freezemelt = "default:water_source",
|
||||||
post_effect_color = {a = 120, r = 120, g = 160, b = 180},
|
|
||||||
groups = {cracky = 3, melts = 1},
|
groups = {cracky = 3, melts = 1},
|
||||||
sounds = default.node_sound_glass_defaults(),
|
sounds = default.node_sound_glass_defaults(),
|
||||||
})
|
})
|
||||||
|
@ -1,6 +1,55 @@
|
|||||||
-- Minetest 0.4 mod: player
|
-- Minetest 0.4 mod: player
|
||||||
-- See README.txt for licensing and other information.
|
-- See README.txt for licensing and other information.
|
||||||
|
|
||||||
|
--[[
|
||||||
|
|
||||||
|
API
|
||||||
|
---
|
||||||
|
|
||||||
|
default.player_register_model(name, def)
|
||||||
|
^ Register a new model to be used by players.
|
||||||
|
^ <name> is the model filename such as "character.x", "foo.b3d", etc.
|
||||||
|
^ See Model Definition below for format of <def>.
|
||||||
|
|
||||||
|
default.registered_player_models[name]
|
||||||
|
^ See Model Definition below for format.
|
||||||
|
|
||||||
|
default.player_set_model(player, model_name)
|
||||||
|
^ <player> is a PlayerRef.
|
||||||
|
^ <model_name> is a model registered with player_register_model.
|
||||||
|
|
||||||
|
default.player_set_animation(player, anim_name [, speed])
|
||||||
|
^ <player> is a PlayerRef.
|
||||||
|
^ <anim_name> is the name of the animation.
|
||||||
|
^ <speed> is in frames per second. If nil, default from the model is used
|
||||||
|
|
||||||
|
default.player_set_textures(player, textures)
|
||||||
|
^ <player> is a PlayerRef.
|
||||||
|
^ <textures> is an array of textures
|
||||||
|
^ If <textures> is nil, the default textures from the model def are used
|
||||||
|
|
||||||
|
default.player_get_animation(player)
|
||||||
|
^ <player> is a PlayerRef.
|
||||||
|
^ Returns a table containing fields "model", "textures" and "animation".
|
||||||
|
^ Any of the fields of the returned table may be nil.
|
||||||
|
|
||||||
|
Model Definition
|
||||||
|
----------------
|
||||||
|
|
||||||
|
model_def = {
|
||||||
|
animation_speed = 30, -- Default animation speed, in FPS.
|
||||||
|
textures = {"character.png", }, -- Default array of textures.
|
||||||
|
visual_size = {x = 1, y = 1,}, -- Used to scale the model.
|
||||||
|
animations = {
|
||||||
|
-- <anim_name> = { x =<start_frame>, y =<end_frame>, },
|
||||||
|
foo = { x = 0, y = 19, },
|
||||||
|
bar = { x = 20, y =39, },
|
||||||
|
-- ...
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
]]
|
||||||
|
|
||||||
-- Player animation blending
|
-- Player animation blending
|
||||||
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
|
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
|
||||||
local animation_blend = 0
|
local animation_blend = 0
|
||||||
@ -19,14 +68,12 @@ default.player_register_model("character.x", {
|
|||||||
animation_speed = 35,
|
animation_speed = 35,
|
||||||
textures = {"character.png", },
|
textures = {"character.png", },
|
||||||
animations = {
|
animations = {
|
||||||
-- Standard animations.
|
stand = {x = 0, y = 40},
|
||||||
stand = { x= 0, y= 79, },
|
lay = {x = 162, y = 166},
|
||||||
lay = { x=162, y=166, },
|
walk = {x = 168, y = 187},
|
||||||
walk = { x=168, y=187, },
|
mine = {x = 189, y = 198},
|
||||||
mine = { x=189, y=198, },
|
walk_mine = {x = 200, y = 219},
|
||||||
walk_mine = { x=200, y=219, },
|
sit = {x = 81, y = 160},
|
||||||
-- Extra animations (not currently used by the game).
|
|
||||||
sit = { x= 81, y=160, },
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -46,7 +93,7 @@ function default.player_get_animation(player)
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Called when a player's appearance needs to be updated
|
-- Called when a player"s appearance needs to be updated
|
||||||
function default.player_set_model(player, model_name)
|
function default.player_set_model(player, model_name)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local model = models[model_name]
|
local model = models[model_name]
|
||||||
@ -94,7 +141,7 @@ end
|
|||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
default.player_attached[player:get_player_name()] = false
|
default.player_attached[player:get_player_name()] = false
|
||||||
default.player_set_model(player, "character.x")
|
default.player_set_model(player, "character.x")
|
||||||
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 35)
|
player:set_local_animation({x = 0, y = 40}, {x = 168, y = 187}, {x = 189, y = 198}, {x = 200, y = 219}, 35)
|
||||||
|
|
||||||
-- set GUI
|
-- set GUI
|
||||||
if minetest.setting_getbool("creative_mode") then
|
if minetest.setting_getbool("creative_mode") then
|
||||||
@ -106,6 +153,7 @@ minetest.register_on_joinplayer(function(player)
|
|||||||
player:hud_set_hotbar_image("gui_hotbar.png")
|
player:hud_set_hotbar_image("gui_hotbar.png")
|
||||||
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
|
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
|
||||||
end)
|
end)
|
||||||
|
end)
|
||||||
|
|
||||||
minetest.register_on_leaveplayer(function(player)
|
minetest.register_on_leaveplayer(function(player)
|
||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
@ -116,7 +164,6 @@ end)
|
|||||||
|
|
||||||
-- Localize for better performance.
|
-- Localize for better performance.
|
||||||
local player_set_animation = default.player_set_animation
|
local player_set_animation = default.player_set_animation
|
||||||
local player_attached = default.player_attached
|
|
||||||
|
|
||||||
-- Check each player and apply animations
|
-- Check each player and apply animations
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
@ -124,7 +171,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
local name = player:get_player_name()
|
local name = player:get_player_name()
|
||||||
local model_name = player_model[name]
|
local model_name = player_model[name]
|
||||||
local model = model_name and models[model_name]
|
local model = model_name and models[model_name]
|
||||||
if model and not player_attached[name] then
|
if model and not default.player_attached[name] then
|
||||||
local controls = player:get_player_control()
|
local controls = player:get_player_control()
|
||||||
local walking = false
|
local walking = false
|
||||||
local animation_speed_mod = model.animation_speed or 35
|
local animation_speed_mod = model.animation_speed or 35
|
||||||
@ -136,13 +183,13 @@ minetest.register_globalstep(function(dtime)
|
|||||||
|
|
||||||
-- Determine if the player is sneaking, and reduce animation speed if so
|
-- Determine if the player is sneaking, and reduce animation speed if so
|
||||||
if controls.sneak then
|
if controls.sneak then
|
||||||
animation_speed_mod = animation_speed_mod / 2
|
animation_speed_mod = animation_speed_mod * 0.5
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Apply animations based on what the player is doing
|
-- Apply animations based on what the player is doing
|
||||||
if player:get_hp() == 0 then
|
if player:get_hp() == 0 then
|
||||||
player_set_animation(player, "lay", animation_speed_mod)
|
player_set_animation(player, "lay", animation_speed_mod)
|
||||||
player:set_eye_offset({x = 0, y = -10, z = 0}, {x = 0
|
player:set_eye_offset({x = 0, y = -10, z = 0}, {x = 0, y = -10, z = 0})
|
||||||
elseif walking then
|
elseif walking then
|
||||||
if player_sneak[name] ~= controls.sneak then
|
if player_sneak[name] ~= controls.sneak then
|
||||||
player_anim[name] = nil
|
player_anim[name] = nil
|
||||||
@ -154,7 +201,7 @@ minetest.register_globalstep(function(dtime)
|
|||||||
player_set_animation(player, "walk", animation_speed_mod)
|
player_set_animation(player, "walk", animation_speed_mod)
|
||||||
end
|
end
|
||||||
elseif controls.LMB or controls.RMB then
|
elseif controls.LMB or controls.RMB then
|
||||||
player_set_animation(player, "mine", animation_spee
|
player_set_animation(player, "mine", animation_speed_mod)
|
||||||
else
|
else
|
||||||
player_set_animation(player, "stand", animation_speed_mod * 0.4)
|
player_set_animation(player, "stand", animation_speed_mod * 0.4)
|
||||||
end
|
end
|
||||||
|
Before Width: | Height: | Size: 692 B After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 473 B |
@ -180,4 +180,3 @@ function default.grow_jungletree(pos, bad)
|
|||||||
vm:write_to_map()
|
vm:write_to_map()
|
||||||
vm:update_map()
|
vm:update_map()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -13,11 +13,21 @@ doors = {}
|
|||||||
-- node_box_top
|
-- node_box_top
|
||||||
-- selection_box_bottom
|
-- selection_box_bottom
|
||||||
-- selection_box_top
|
-- selection_box_top
|
||||||
-- only_placer_can_open: if true only the player who placed the door can
|
-- only_placer_can_open: if true only the player who placed the door can open it
|
||||||
-- open it
|
|
||||||
|
|
||||||
|
local function is_right(pos)
|
||||||
|
local r1 = minetest.get_node({x = pos.x-1, y = pos.y, z = pos.z})
|
||||||
|
local r2 = minetest.get_node({x = pos.x, y = pos.y, z = pos.z-1})
|
||||||
|
if string.find(r1.name, "door_") or string.find(r2.name, "door_") then
|
||||||
|
if string.find(r1.name, "_1") or string.find(r2.name, "_1") then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function doors.register_door(name, def)
|
function doors:register_door(name, def)
|
||||||
def.groups.not_in_creative_inventory = 1
|
def.groups.not_in_creative_inventory = 1
|
||||||
|
|
||||||
local box = {{-0.5, -0.5, -0.5, 0.5, 0.5, -0.5+1.5/16}}
|
local box = {{-0.5, -0.5, -0.5, 0.5, 0.5, -0.5+1.5/16}}
|
||||||
@ -35,14 +45,6 @@ function doors.register_door(name, def)
|
|||||||
def.selection_box_top = box
|
def.selection_box_top = box
|
||||||
end
|
end
|
||||||
|
|
||||||
if not def.sound_close_door then
|
|
||||||
def.sound_close_door = "door_close"
|
|
||||||
end
|
|
||||||
if not def.sound_open_door then
|
|
||||||
def.sound_open_door = "door_open"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craftitem(name, {
|
minetest.register_craftitem(name, {
|
||||||
description = def.description,
|
description = def.description,
|
||||||
inventory_image = def.inventory_image,
|
inventory_image = def.inventory_image,
|
||||||
@ -87,14 +89,12 @@ function doors.register_door(name, def)
|
|||||||
elseif p2 == 3 then
|
elseif p2 == 3 then
|
||||||
pt3.z = pt3.z-1
|
pt3.z = pt3.z-1
|
||||||
end
|
end
|
||||||
if minetest.get_item_group(minetest.get_node(pt3).name, "door") == 0 then
|
if not string.find(minetest.get_node(pt3).name, name.."_b_") then
|
||||||
minetest.set_node(pt, {name =name.."_b_1", param2 = p2})
|
minetest.set_node(pt, {name =name.."_b_1", param2 = p2})
|
||||||
minetest.set_node(pt2, {name =name.."_t_1", param2 = p2})
|
minetest.set_node(pt2, {name =name.."_t_1", param2 = p2})
|
||||||
else
|
else
|
||||||
minetest.set_node(pt, {name =name.."_b_2", param2 = p2})
|
minetest.set_node(pt, {name =name.."_b_2", param2 = p2})
|
||||||
minetest.set_node(pt2, {name =name.."_t_2", param2 = p2})
|
minetest.set_node(pt2, {name =name.."_t_2", param2 = p2})
|
||||||
minetest.get_meta(pt):set_int("right", 1)
|
|
||||||
minetest.get_meta(pt2):set_int("right", 1)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if def.only_placer_can_open then
|
if def.only_placer_can_open then
|
||||||
@ -137,17 +137,17 @@ function doors.register_door(name, def)
|
|||||||
pos.y = pos.y-dir
|
pos.y = pos.y-dir
|
||||||
minetest.swap_node(pos, {name =replace, param2 = p2})
|
minetest.swap_node(pos, {name =replace, param2 = p2})
|
||||||
|
|
||||||
local snd_1 = def.sound_close_door
|
local snd_1 = "_close"
|
||||||
local snd_2 = def.sound_open_door
|
local snd_2 = "_open"
|
||||||
if params[1] == 3 then
|
if params[1] == 3 then
|
||||||
snd_1 = def.sound_open_door
|
snd_1 = "_open"
|
||||||
snd_2 = def.sound_close_door
|
snd_2 = "_close"
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.get_meta(pos):get_int("right") ~= 0 then
|
if is_right(pos) then
|
||||||
minetest.sound_play(snd_1, {pos = pos, gain = 0.3, max_hear_distance = 10})
|
minetest.sound_play("door"..snd_1, {pos = pos, gain = 0.175, max_hear_distance = 16})
|
||||||
else
|
else
|
||||||
minetest.sound_play(snd_2, {pos = pos, gain = 0.3, max_hear_distance = 10})
|
minetest.sound_play("door"..snd_2, {pos = pos, gain = 0.175, max_hear_distance = 16})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -164,6 +164,7 @@ function doors.register_door(name, def)
|
|||||||
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"},
|
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
sunlight_propagates = true,
|
||||||
drop = name,
|
drop = name,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
@ -196,6 +197,7 @@ function doors.register_door(name, def)
|
|||||||
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"},
|
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
sunlight_propagates = true,
|
||||||
drop = "",
|
drop = "",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
@ -228,6 +230,7 @@ function doors.register_door(name, def)
|
|||||||
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]},
|
tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
sunlight_propagates = true,
|
||||||
drop = name,
|
drop = name,
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
@ -260,6 +263,7 @@ function doors.register_door(name, def)
|
|||||||
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]},
|
tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
sunlight_propagates = true,
|
||||||
drop = "",
|
drop = "",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
node_box = {
|
node_box = {
|
||||||
@ -290,7 +294,7 @@ function doors.register_door(name, def)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
doors.register_door("doors:door_wood", {
|
doors:register_door("doors:door_wood", {
|
||||||
description = "Wooden Door",
|
description = "Wooden Door",
|
||||||
inventory_image = "door_wood.png",
|
inventory_image = "door_wood.png",
|
||||||
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door= 1},
|
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door= 1},
|
||||||
@ -301,7 +305,7 @@ doors.register_door("doors:door_wood", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "doors:door_wood",
|
output = "doors:door_wood 3",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"group:wood", "group:wood"},
|
{"group:wood", "group:wood"},
|
||||||
{"group:wood", "group:wood"},
|
{"group:wood", "group:wood"},
|
||||||
@ -309,7 +313,7 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
doors.register_door("doors:door_steel", {
|
doors:register_door("doors:door_steel", {
|
||||||
description = "Steel Door",
|
description = "Steel Door",
|
||||||
inventory_image = "door_steel.png",
|
inventory_image = "door_steel.png",
|
||||||
groups = {snappy = 1,bendy = 2, cracky = 1,melty = 2,level= 2, door= 1},
|
groups = {snappy = 1,bendy = 2, cracky = 1,melty = 2,level= 2, door= 1},
|
||||||
@ -321,7 +325,7 @@ doors.register_door("doors:door_steel", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "doors:door_steel",
|
output = "doors:door_steel 3",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:steel_ingot", "default:steel_ingot"},
|
{"default:steel_ingot", "default:steel_ingot"},
|
||||||
{"default:steel_ingot", "default:steel_ingot"},
|
{"default:steel_ingot", "default:steel_ingot"},
|
||||||
@ -329,7 +333,7 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
doors.register_door("doors:door_glass", {
|
doors:register_door("doors:door_glass", {
|
||||||
description = "Glass Door",
|
description = "Glass Door",
|
||||||
inventory_image = "door_glass.png",
|
inventory_image = "door_glass.png",
|
||||||
groups = {snappy = 1, cracky = 1, oddly_breakable_by_hand = 3, door= 1},
|
groups = {snappy = 1, cracky = 1, oddly_breakable_by_hand = 3, door= 1},
|
||||||
@ -340,7 +344,7 @@ doors.register_door("doors:door_glass", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "doors:door_glass",
|
output = "doors:door_glass 3",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:glass", "default:glass"},
|
{"default:glass", "default:glass"},
|
||||||
{"default:glass", "default:glass"},
|
{"default:glass", "default:glass"},
|
||||||
@ -348,7 +352,7 @@ minetest.register_craft({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
doors.register_door("doors:door_obsidian_glass", {
|
doors:register_door("doors:door_obsidian_glass", {
|
||||||
description = "Obsidian Glass Door",
|
description = "Obsidian Glass Door",
|
||||||
inventory_image = "door_obsidian_glass.png",
|
inventory_image = "door_obsidian_glass.png",
|
||||||
groups = {snappy = 1, cracky = 1, oddly_breakable_by_hand = 3, door= 1},
|
groups = {snappy = 1, cracky = 1, oddly_breakable_by_hand = 3, door= 1},
|
||||||
@ -359,7 +363,7 @@ doors.register_door("doors:door_obsidian_glass", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "doors:door_obsidian_glass",
|
output = "doors:door_obsidian_glass 3",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:obsidian_glass", "default:obsidian_glass"},
|
{"default:obsidian_glass", "default:obsidian_glass"},
|
||||||
{"default:obsidian_glass", "default:obsidian_glass"},
|
{"default:obsidian_glass", "default:obsidian_glass"},
|
||||||
@ -368,7 +372,7 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
----trapdoor----
|
---- Trapdoors ----
|
||||||
|
|
||||||
local function update_door(pos, node)
|
local function update_door(pos, node)
|
||||||
minetest.set_node(pos, node)
|
minetest.set_node(pos, node)
|
||||||
@ -380,13 +384,14 @@ local function punch(pos)
|
|||||||
local me = minetest.get_node(pos)
|
local me = minetest.get_node(pos)
|
||||||
local tmp_node
|
local tmp_node
|
||||||
local tmp_node2
|
local tmp_node2
|
||||||
|
oben = {x = pos.x, y = pos.y+1, z = pos.z}
|
||||||
if state == 1 then
|
if state == 1 then
|
||||||
state = 0
|
state = 0
|
||||||
minetest.sound_play("door_close", {pos = pos, gain = 0.3, max_hear_distance = 10})
|
minetest.sound_play("door_close", {pos = pos, gain = 0.175, max_hear_distance = 16})
|
||||||
tmp_node = {name = "doors:trapdoor", param1 = me.param1, param2 = me.param2}
|
tmp_node = {name = "doors:trapdoor", param1 = me.param1, param2 = me.param2}
|
||||||
else
|
else
|
||||||
state = 1
|
state = 1
|
||||||
minetest.sound_play("door_open", {pos = pos, gain = 0.3, max_hear_distance = 10})
|
minetest.sound_play("door_open", {pos = pos, gain = 0.175, max_hear_distance = 16})
|
||||||
tmp_node = {name = "doors:trapdoor_open", param1 = me.param1, param2 = me.param2}
|
tmp_node = {name = "doors:trapdoor_open", param1 = me.param1, param2 = me.param2}
|
||||||
end
|
end
|
||||||
update_door(pos, tmp_node)
|
update_door(pos, tmp_node)
|
||||||
@ -400,6 +405,7 @@ minetest.register_node("doors:trapdoor", {
|
|||||||
tiles = {"door_trapdoor.png", "door_trapdoor.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png"},
|
tiles = {"door_trapdoor.png", "door_trapdoor.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
|
sunlight_propagates = true,
|
||||||
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door= 1},
|
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door= 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
drop = "doors:trapdoor",
|
drop = "doors:trapdoor",
|
||||||
@ -424,10 +430,9 @@ minetest.register_node("doors:trapdoor_open", {
|
|||||||
tiles = {"door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor.png", "door_trapdoor.png"},
|
tiles = {"door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor_side.png", "door_trapdoor.png", "door_trapdoor.png"},
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
pointable = true,
|
sunlight_propagates = true,
|
||||||
stack_max = 0,
|
|
||||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1},
|
|
||||||
climbable = true,
|
climbable = true,
|
||||||
|
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, door= 1},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
drop = "doors:trapdoor",
|
drop = "doors:trapdoor",
|
||||||
node_box = {
|
node_box = {
|
||||||
@ -444,10 +449,14 @@ minetest.register_node("doors:trapdoor_open", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = 'doors:trapdoor 2',
|
output = "doors:trapdoor 6",
|
||||||
recipe = {
|
recipe = {
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
{'group:wood', 'group:wood', 'group:wood'},
|
{"group:wood", "group:wood", "group:wood"},
|
||||||
{'', '', ''},
|
{"", "", ""},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if minetest.setting_getbool("log_mods") then
|
||||||
|
minetest.log("action", "Carbone: [doors] loaded.")
|
||||||
|
end
|
||||||
|
@ -1,10 +1,63 @@
|
|||||||
-- minetest/dye/init.lua
|
-- minetest/dye/init.lua
|
||||||
|
|
||||||
|
-- To make recipes that will work with any dye ever made by anybody, define
|
||||||
|
-- them based on groups.
|
||||||
|
-- You can select any group of groups, based on your need for amount of colors.
|
||||||
|
-- basecolor: 9, excolor: 17, unicolor: 89
|
||||||
|
--
|
||||||
|
-- Example of one shapeless recipe using a color group:
|
||||||
|
-- Note: As this uses basecolor_*, you'd need 9 of these.
|
||||||
|
-- minetest.register_craft({
|
||||||
|
-- type = "shapeless",
|
||||||
|
-- output = '<mod>:item_yellow',
|
||||||
|
-- recipe = {'<mod>:item_no_color', 'group:basecolor_yellow'},
|
||||||
|
-- })
|
||||||
|
|
||||||
-- Other mods can use these for looping through available colors
|
-- Other mods can use these for looping through available colors
|
||||||
dye = {}
|
local dye = {}
|
||||||
dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"}
|
dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"}
|
||||||
dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow", "lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"}
|
dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow", "lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"}
|
||||||
|
|
||||||
|
-- Base color groups:
|
||||||
|
-- - basecolor_white
|
||||||
|
-- - basecolor_grey
|
||||||
|
-- - basecolor_black
|
||||||
|
-- - basecolor_red
|
||||||
|
-- - basecolor_yellow
|
||||||
|
-- - basecolor_green
|
||||||
|
-- - basecolor_cyan
|
||||||
|
-- - basecolor_blue
|
||||||
|
-- - basecolor_magenta
|
||||||
|
|
||||||
|
-- Extended color groups (* = equal to a base color):
|
||||||
|
-- * excolor_white
|
||||||
|
-- - excolor_lightgrey
|
||||||
|
-- * excolor_grey
|
||||||
|
-- - excolor_darkgrey
|
||||||
|
-- * excolor_black
|
||||||
|
-- * excolor_red
|
||||||
|
-- - excolor_orange
|
||||||
|
-- * excolor_yellow
|
||||||
|
-- - excolor_lime
|
||||||
|
-- * excolor_green
|
||||||
|
-- - excolor_aqua
|
||||||
|
-- * excolor_cyan
|
||||||
|
-- - excolor_sky_blue
|
||||||
|
-- * excolor_blue
|
||||||
|
-- - excolor_violet
|
||||||
|
-- * excolor_magenta
|
||||||
|
-- - excolor_red_violet
|
||||||
|
|
||||||
|
-- The whole unifieddyes palette as groups:
|
||||||
|
-- - unicolor_<excolor>
|
||||||
|
-- For the following, no white/grey/black is allowed:
|
||||||
|
-- - unicolor_medium_<excolor>
|
||||||
|
-- - unicolor_dark_<excolor>
|
||||||
|
-- - unicolor_light_<excolor>
|
||||||
|
-- - unicolor_<excolor>_s50
|
||||||
|
-- - unicolor_medium_<excolor>_s50
|
||||||
|
-- - unicolor_dark_<excolor>_s50
|
||||||
|
|
||||||
-- Local stuff
|
-- Local stuff
|
||||||
local dyelocal = {}
|
local dyelocal = {}
|
||||||
|
|
||||||
@ -85,3 +138,8 @@ for one,results in pairs(dyelocal.mixes) do
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Hide dyelocal
|
||||||
|
dyelocal = nil
|
||||||
|
|
||||||
|
-- EOF
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
-- minetest/fire/init.lua
|
-- minetest/fire/init.lua
|
||||||
|
|
||||||
fire = {}
|
|
||||||
|
|
||||||
minetest.register_node("fire:basic_flame", {
|
minetest.register_node("fire:basic_flame", {
|
||||||
description = "Fire",
|
description = "Fire",
|
||||||
drawtype = "firelike",
|
drawtype = "firelike",
|
||||||
@ -11,18 +9,18 @@ minetest.register_node("fire:basic_flame", {
|
|||||||
}},
|
}},
|
||||||
inventory_image = "fire_basic_flame.png",
|
inventory_image = "fire_basic_flame.png",
|
||||||
light_source = 14,
|
light_source = 14,
|
||||||
groups = {igniter=2,dig_immediate=3},
|
groups = {igniter=2,dig_immediate=3,hot=3},
|
||||||
drop = '',
|
drop = '',
|
||||||
walkable = false,
|
walkable = false,
|
||||||
buildable_to = true,
|
buildable_to = true,
|
||||||
damage_per_second = 4,
|
damage_per_second = 4,
|
||||||
|
|
||||||
on_construct = function(pos)
|
after_place_node = function(pos, placer)
|
||||||
minetest.after(0, fire.on_flame_add_at, pos)
|
fire.on_flame_add_at(pos)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
on_destruct = function(pos)
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
minetest.after(0, fire.on_flame_remove_at, pos)
|
fire.on_flame_remove_at(pos)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
-- 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
|
|
||||||
flowers = {}
|
|
||||||
|
|
||||||
-- Map Generation
|
-- Map Generation
|
||||||
dofile(minetest.get_modpath("flowers").."/mapgen.lua")
|
dofile(minetest.get_modpath("flowers").."/mapgen.lua")
|
||||||
|
|
||||||
@ -21,6 +18,7 @@ minetest.register_node("flowers:dandelion_white", {
|
|||||||
tiles = { "flowers_dandelion_white.png" },
|
tiles = { "flowers_dandelion_white.png" },
|
||||||
inventory_image = "flowers_dandelion_white.png",
|
inventory_image = "flowers_dandelion_white.png",
|
||||||
wield_image = "flowers_dandelion_white.png",
|
wield_image = "flowers_dandelion_white.png",
|
||||||
|
is_ground_content = true,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
@ -29,7 +27,7 @@ minetest.register_node("flowers:dandelion_white", {
|
|||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -0.5, -0.5, -0.5, 0.5, -0.2, 0.5 },
|
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -39,6 +37,7 @@ minetest.register_node("flowers:dandelion_yellow", {
|
|||||||
tiles = { "flowers_dandelion_yellow.png" },
|
tiles = { "flowers_dandelion_yellow.png" },
|
||||||
inventory_image = "flowers_dandelion_yellow.png",
|
inventory_image = "flowers_dandelion_yellow.png",
|
||||||
wield_image = "flowers_dandelion_yellow.png",
|
wield_image = "flowers_dandelion_yellow.png",
|
||||||
|
is_ground_content = true,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
@ -57,6 +56,7 @@ minetest.register_node("flowers:geranium", {
|
|||||||
tiles = { "flowers_geranium.png" },
|
tiles = { "flowers_geranium.png" },
|
||||||
inventory_image = "flowers_geranium.png",
|
inventory_image = "flowers_geranium.png",
|
||||||
wield_image = "flowers_geranium.png",
|
wield_image = "flowers_geranium.png",
|
||||||
|
is_ground_content = true,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
@ -75,6 +75,7 @@ minetest.register_node("flowers:rose", {
|
|||||||
tiles = { "flowers_rose.png" },
|
tiles = { "flowers_rose.png" },
|
||||||
inventory_image = "flowers_rose.png",
|
inventory_image = "flowers_rose.png",
|
||||||
wield_image = "flowers_rose.png",
|
wield_image = "flowers_rose.png",
|
||||||
|
is_ground_content = true,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
@ -83,7 +84,7 @@ minetest.register_node("flowers:rose", {
|
|||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -0.15, -0.5, -0.15, 0.15, 0.3, 0.15 },
|
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -93,6 +94,7 @@ minetest.register_node("flowers:tulip", {
|
|||||||
tiles = { "flowers_tulip.png" },
|
tiles = { "flowers_tulip.png" },
|
||||||
inventory_image = "flowers_tulip.png",
|
inventory_image = "flowers_tulip.png",
|
||||||
wield_image = "flowers_tulip.png",
|
wield_image = "flowers_tulip.png",
|
||||||
|
is_ground_content = true,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
@ -111,6 +113,7 @@ minetest.register_node("flowers:viola", {
|
|||||||
tiles = { "flowers_viola.png" },
|
tiles = { "flowers_viola.png" },
|
||||||
inventory_image = "flowers_viola.png",
|
inventory_image = "flowers_viola.png",
|
||||||
wield_image = "flowers_viola.png",
|
wield_image = "flowers_viola.png",
|
||||||
|
is_ground_content = true,
|
||||||
sunlight_propagates = true,
|
sunlight_propagates = true,
|
||||||
paramtype = "light",
|
paramtype = "light",
|
||||||
walkable = false,
|
walkable = false,
|
||||||
@ -119,40 +122,56 @@ minetest.register_node("flowers:viola", {
|
|||||||
sounds = default.node_sound_leaves_defaults(),
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
selection_box = {
|
selection_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
fixed = { -0.5, -0.5, -0.5, 0.5, -0.2, 0.5 },
|
fixed = { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node("flowers:lily_pad", {
|
||||||
|
description = "Lily Pad",
|
||||||
|
drawtype = "nodebox",
|
||||||
|
tiles = { "flowers_lily_pad.png" },
|
||||||
|
inventory_image = "flowers_lily_pad.png",
|
||||||
|
wield_image = "flowers_lily_pad.png",
|
||||||
|
wield_scale = {x = 1, y = 1, z = 0.001},
|
||||||
|
is_ground_content = true,
|
||||||
|
sunlight_propagates = true,
|
||||||
|
paramtype = "light",
|
||||||
|
walkable = false,
|
||||||
|
buildable_to = true,
|
||||||
|
groups = {snappy = 3, flammable = 2, flower = 1, flora = 1},
|
||||||
|
sounds = default.node_sound_leaves_defaults(),
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.45, -0.5, 0.5, -0.4375, 0.5},
|
||||||
|
},
|
||||||
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
nodenames = {"group:flora"},
|
nodenames = {"group:flora"},
|
||||||
neighbors = {"default:dirt_with_grass", "default:desert_sand"},
|
neighbors = {"default:dirt_with_grass", "default:desert_sand"},
|
||||||
interval = 50,
|
interval = 2,
|
||||||
chance = 25,
|
chance = 500,
|
||||||
action = function(pos, node)
|
action = function(pos, node)
|
||||||
pos.y = pos.y - 1
|
pos.y = pos.y - 1
|
||||||
local under = minetest.get_node(pos)
|
local under = minetest.get_node(pos)
|
||||||
pos.y = pos.y + 1
|
pos.y = pos.y + 1
|
||||||
if under.name == "default:desert_sand" then
|
if under.name == "default:desert_sand" then
|
||||||
minetest.set_node(pos, {name="default:dry_shrub"})
|
minetest.set_node(pos, {name="default:dry_shrub"})
|
||||||
elseif under.name ~= "default:dirt_with_grass" then
|
elseif under.name ~= "default:dirt_with_grass" then return end
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local light = minetest.get_node_light(pos)
|
local light = minetest.get_node_light(pos)
|
||||||
if not light or light < 13 then
|
if not light or light < 13 then return end
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local pos0 = {x = pos.x - 4, y = pos.y - 4, z = pos.z - 4}
|
local pos0 = {x = pos.x - 4, y = pos.y - 4, z = pos.z - 4}
|
||||||
local pos1 = {x = pos.x + 4, y = pos.y + 4, z = pos.z + 4}
|
local pos1 = {x = pos.x + 4, y = pos.y + 4, z = pos.z + 4}
|
||||||
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then
|
if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then return end
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora")
|
local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora")
|
||||||
if #flowers > 3 then
|
if #flowers > 3 then return end
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass")
|
local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass")
|
||||||
if #seedling > 0 then
|
if #seedling > 0 then
|
||||||
@ -168,3 +187,7 @@ minetest.register_abm({
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if minetest.setting_getbool("log_mods") then
|
||||||
|
minetest.log("action", "Carbone: [flowers] loaded.")
|
||||||
|
end
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function flowers.mgv6ongen(minp, maxp, seed)
|
minetest.register_on_generated(function(minp, maxp, seed)
|
||||||
if maxp.y >= 2 and minp.y <= 0 then
|
if maxp.y >= 2 and minp.y <= 0 then
|
||||||
-- Generate flowers
|
-- Generate flowers
|
||||||
local perlin1 = minetest.get_perlin(436, 3, 0.6, 100)
|
local perlin1 = minetest.get_perlin(436, 3, 0.6, 100)
|
||||||
@ -51,6 +51,12 @@ function flowers.mgv6ongen(minp, maxp, seed)
|
|||||||
flower = "flowers:viola"
|
flower = "flowers:viola"
|
||||||
end
|
end
|
||||||
minetest.set_node(p, {name = flower})
|
minetest.set_node(p, {name = flower})
|
||||||
|
elseif nn == "default:water_source" then
|
||||||
|
minetest.set_node(p, {name = "flowers:lily_pad"})
|
||||||
|
elseif nn == "default:sand" then
|
||||||
|
minetest.set_node(p, {name = "default:dry_shrub"})
|
||||||
|
elseif nn == "default:dirt_with_snow" then
|
||||||
|
minetest.set_node(p, {name = "default:snow"})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -59,12 +65,4 @@ function flowers.mgv6ongen(minp, maxp, seed)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- Enable in mapgen v6 only
|
|
||||||
|
|
||||||
minetest.register_on_mapgen_init(function(mg_params)
|
|
||||||
if mg_params.mgname == "v6" then
|
|
||||||
minetest.register_on_generated(flowers.mgv6ongen)
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 291 B |
@ -288,9 +288,3 @@ stairs.register_stair_and_slab("stonebrick", "default:stonebrick",
|
|||||||
"Stone Brick Stair",
|
"Stone Brick Stair",
|
||||||
"Stone Brick Slab",
|
"Stone Brick Slab",
|
||||||
default.node_sound_stone_defaults())
|
default.node_sound_stone_defaults())
|
||||||
stairs.register_stair_and_slab("pinewood", "default:pinewood",
|
|
||||||
{snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
|
||||||
{"default_pinewood.png"},
|
|
||||||
"Pinewood Stair",
|
|
||||||
"Pinewood Slab",
|
|
||||||
default.node_sound_wood_defaults())
|
|
0
mods/3d_armor/.gitignore
vendored
Normal file → Executable file
0
mods/3d_armor/3d_armor/README.txt
Normal file → Executable file
0
mods/3d_armor/3d_armor/armor.conf
Normal file → Executable file
0
mods/3d_armor/3d_armor/armor.conf.example
Normal file → Executable file
0
mods/3d_armor/3d_armor/armor.lua
Normal file → Executable file
0
mods/3d_armor/3d_armor/crafting_guide.txt
Normal file → Executable file
0
mods/3d_armor/3d_armor/depends.txt
Normal file → Executable file
0
mods/3d_armor/3d_armor/init.lua
Normal file → Executable file
0
mods/3d_armor/3d_armor/models/3d_armor_character.blend
Normal file → Executable file
0
mods/3d_armor/3d_armor/models/3d_armor_character.x
Normal file → Executable file
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_bronze.png
Normal file → Executable file
Before Width: | Height: | Size: 632 B After Width: | Height: | Size: 632 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_bronze_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_diamond.png
Normal file → Executable file
Before Width: | Height: | Size: 629 B After Width: | Height: | Size: 629 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_diamond_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_gold.png
Normal file → Executable file
Before Width: | Height: | Size: 567 B After Width: | Height: | Size: 567 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_gold_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_mithril.png
Normal file → Executable file
Before Width: | Height: | Size: 472 B After Width: | Height: | Size: 472 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_mithril_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_steel.png
Normal file → Executable file
Before Width: | Height: | Size: 609 B After Width: | Height: | Size: 609 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_steel_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_wood.png
Normal file → Executable file
Before Width: | Height: | Size: 565 B After Width: | Height: | Size: 565 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_boots_wood_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_bronze.png
Normal file → Executable file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_bronze_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_diamond.png
Normal file → Executable file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_diamond_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_gold.png
Normal file → Executable file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_gold_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_mithril.png
Normal file → Executable file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_mithril_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_steel.png
Normal file → Executable file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_steel_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_wood.png
Normal file → Executable file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_chestplate_wood_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_bronze.png
Normal file → Executable file
Before Width: | Height: | Size: 933 B After Width: | Height: | Size: 933 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_bronze_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_diamond.png
Normal file → Executable file
Before Width: | Height: | Size: 878 B After Width: | Height: | Size: 878 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_diamond_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_gold.png
Normal file → Executable file
Before Width: | Height: | Size: 830 B After Width: | Height: | Size: 830 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_gold_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_mithril.png
Normal file → Executable file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_mithril_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_steel.png
Normal file → Executable file
Before Width: | Height: | Size: 858 B After Width: | Height: | Size: 858 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_steel_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_wood.png
Normal file → Executable file
Before Width: | Height: | Size: 863 B After Width: | Height: | Size: 863 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_helmet_wood_preview.png
Normal file → Executable file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_boots_bronze.png
Normal file → Executable file
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 213 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_boots_diamond.png
Normal file → Executable file
Before Width: | Height: | Size: 212 B After Width: | Height: | Size: 212 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_boots_gold.png
Normal file → Executable file
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 182 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_boots_mithril.png
Normal file → Executable file
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_boots_steel.png
Normal file → Executable file
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 209 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_boots_wood.png
Normal file → Executable file
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 213 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_chestplate_bronze.png
Normal file → Executable file
Before Width: | Height: | Size: 246 B After Width: | Height: | Size: 246 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_chestplate_diamond.png
Normal file → Executable file
Before Width: | Height: | Size: 247 B After Width: | Height: | Size: 247 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_chestplate_gold.png
Normal file → Executable file
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 215 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_chestplate_mithril.png
Normal file → Executable file
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_chestplate_steel.png
Normal file → Executable file
Before Width: | Height: | Size: 258 B After Width: | Height: | Size: 258 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_chestplate_wood.png
Normal file → Executable file
Before Width: | Height: | Size: 244 B After Width: | Height: | Size: 244 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_helmet_bronze.png
Normal file → Executable file
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_helmet_diamond.png
Normal file → Executable file
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_helmet_gold.png
Normal file → Executable file
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_helmet_mithril.png
Normal file → Executable file
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_helmet_steel.png
Normal file → Executable file
Before Width: | Height: | Size: 229 B After Width: | Height: | Size: 229 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_helmet_wood.png
Normal file → Executable file
Before Width: | Height: | Size: 232 B After Width: | Height: | Size: 232 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_leggings_bronze.png
Normal file → Executable file
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 239 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_leggings_diamond.png
Normal file → Executable file
Before Width: | Height: | Size: 242 B After Width: | Height: | Size: 242 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_leggings_gold.png
Normal file → Executable file
Before Width: | Height: | Size: 215 B After Width: | Height: | Size: 215 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_leggings_mithril.png
Normal file → Executable file
Before Width: | Height: | Size: 237 B After Width: | Height: | Size: 237 B |
0
mods/3d_armor/3d_armor/textures/3d_armor_inv_leggings_steel.png
Normal file → Executable file
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 234 B |