1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-03-28 23:30:44 +01:00

Update MinetestForFunGame

This commit is contained in:
LeMagnesium 2015-09-02 15:37:12 +02:00
parent 13b31ebf82
commit 265afe4855
31 changed files with 395 additions and 244 deletions

View File

@ -1,7 +1,9 @@
## Generic ignorable patterns and files
*~
.*.swp
*.bak*
*bak*
tags
*.vim
## Files related to minetest development cycle
*.patch

View File

@ -24,13 +24,55 @@ The bucket API allows registering new types of buckets for non-default liquids.
"Lava Bucket" -- Bucket description
)
Beds API
--------
beds.register_bed(
"beds:bed", -- Bed name
def: See [#Bed definition] -- Bed definition
)
beds.read_spawns() -- returns a table containing players respawn positions
beds.kick_players() -- forces all players to leave bed
beds.skip_night() -- sets world time to morning and saves respawn position of all players currently sleeping
#Bed definition
---------------
{
description = "Simple Bed",
inventory_image = "beds_bed.png",
wield_image = "beds_bed.png",
tiles = {
bottom = {[Tile definition],
^ the tiles of the bottom part of the bed
},
top = {[Tile definition],
^ the tiles of the bottom part of the bed
}
},
nodebox = {
bottom = regular nodebox, see [Node boxes], -- bottm part of bed
top = regular nodebox, see [Node boxes], -- top part of bed
},
selectionbox = regular nodebox, see [Node boxes], -- for both nodeboxes
recipe = { -- Craft recipe
{"group:wool", "group:wool", "group:wool"},
{"group:wood", "group:wood", "group:wood"}
}
}
Doors API
---------
The doors mod allows modders to register custom doors.
The doors mod allows modders to register custom doors and trapdoors.
doors.register_door(name, def)
^ name: "Door name"
^ def: See [#Door definition]
-> Registers new door
doors.register_trapdoor(name, def)
^ name: "Trapdoor name"
^ def: See [#Trapdoor definition]
-> Registers new trapdoor
#Door definition
----------------
@ -46,10 +88,27 @@ The doors mod allows modders to register custom doors.
node_box_top = regular nodebox, see [Node boxes], OPTIONAL,
selection_box_bottom = 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,
^ If true, only placer can open the door (locked for others)
}
#Trapdoor definition
----------------
{
tile_front = "doors_trapdoor.png",
^ the texture for the front and back of the trapdoor
tile_side: "doors_trapdoor_side.png",
^ the tiles of the four side parts of the trapdoor
sound_open = sound to play when opening the trapdoor, OPTIONAL,
sound_close = sound to play when closing the trapdoor, OPTIONAL,
-> You can add any other node definition properties for minetest.register_node,
such as wield_image, inventory_image, sounds, groups, description, ...
Only node_box, selection_box, tiles, drop, drawtype, paramtype, paramtype2, on_rightclick
will be overwritten by the trapdoor registration function
}
Farming API
-----------
The farming API allows you to easily register plants and hoes.
@ -66,7 +125,8 @@ farming.register_plant(name, Plant definition)
description = "", -- Description for tooltip
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
max_uses = 30, -- Uses until destroyed
recipe = { -- Craft recipe
material = "", -- Material for recipes
recipe = { -- Craft recipe, if material isn't used
{"air", "air", "air"},
{"", "group:stick"},
{"", "group:stick"},
@ -79,11 +139,26 @@ farming.register_plant(name, Plant definition)
description = "", -- Description of seed item
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
steps = 8, -- How many steps the plant has to grow, until it can be harvested
^ Always provide a plant texture for ech step, format: modname_plantname_i.png (i = stepnumber)
^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber)
minlight = 13, -- Minimum light to grow
maxlight = default.LIGHT_MAX -- Maximum light to grow
}
Screwdriver API
---------------
The screwdriver API allows you to control a node's behaviour when a screwdriver is used on it.
To use it, add the on_screwdriver function to the node definition.
on_rotate(pos, node, user, mode, new_param2)
^ pos: position of the node that the screwdriver is being used on
^ node: that node
^ user: the player who used the screwdriver
^ mode: screwdriver.ROTATE_FACE or screwdriver.ROTATE_AXIS
^ new_param2: the new value of param2 that would have been set if on_rotate wasn't there
^ return value: false to disallow rotation, nil to keep default behaviour, true to allow
it but to indicate that changed have already been made (so the screwdriver will wear out)
^ use on_rotate = screwdriver.disallow to always disallow rotation
^ use on_rotate = screwdriver.rotate_simple to allow only face rotation
Stairs API
----------
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
@ -118,7 +193,7 @@ Xpanes API
Creates panes that automatically connect to each other
xpanes.register_pane(subname, def)
-> subname: used for nodename. Result: "xpanes:subname_{1..16}"
-> subname: used for nodename. Result: "xpanes:subname" and "xpanes:subname_{2..15}"
-> def: See [#Pane definition]
#Pane definition
@ -132,12 +207,26 @@ xpanes.register_pane(subname, def)
^ See [#Default sounds]
recipe = {{"","","","","","","","",""}},
^ Recipe field only
on_construct = function(pos)
update_pane(pos, "pane")
end,
^ Required to handle rotation correctly
}
Raillike definitions
--------------------
The following nodes use the group `connect_to_raillike` and will only connect to
raillike nodes within this group and the same group value.
Use `minetest.raillike_group(<Name>)` to get the group value.
| Node type | Raillike group name
+-----------------------+----------------------------------
| default:rail | "rail"
| tnt:gunpowder | "gunpowder"
| tnt:gunpowder_burning | "gunpowder"
Example:
If you want to add a new rail type and want it to connect with default:rail,
add `connect_to_raillike=minetest.raillike_group("rail")` into the `groups` table
of your node.
Default sounds
--------------
Sounds inside the default table can be used within the sounds field of node definitions.
@ -206,6 +295,7 @@ 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.
@ -278,6 +368,7 @@ minetest.register_craft({
------------
dye.basecolors
^ Array containing the names of available base colors
dye.excolors
^ Array containing the names of the available extended colors

View File

@ -22,3 +22,7 @@
# The radius of a TNT explosion
#tnt_radius = 3
# Enable the stairs mod ABM that replaces the old 'upside down'
# stair and slab nodes in old maps with the new param2 versions.
#enable_stairs_replace_abm = false

View File

@ -1,4 +1,3 @@
--
-- Helper functions
--
@ -290,6 +289,7 @@ minetest.register_craft({
},
})
minetest.register_craft({
output = "boats:boat",
recipe = {
@ -297,4 +297,3 @@ minetest.register_craft({
{"group:wood", "group:wood", "group:wood"},
},
})

View File

@ -58,7 +58,6 @@ VanessaE (WTFPL):
default_nc_side.png
default_desert_sand.png
default_desert_stone.png
default_desert_stone_brick.png
default_sand.png
default_jungletree_top.png
@ -121,12 +120,13 @@ paramat (CC BY-SA 3.0):
default_junglewood.png, derived from a texture by BlockMen (CC BY-SA 3.0)
default_grass.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_grass_side.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_stone_brick.png, derived from a texture by Cisoun (WTFPL)
default_desert_stone_brick.png, derived from a texture by VanessaE (WTFPL)
brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png
BlockMen (CC BY-SA 3.0):
default_stone_brick.png
default_wood.png
default_clay_brick.png
default_iron_ingot.png

View File

@ -905,7 +905,7 @@ function default.register_biomes()
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
y_min = 1,
y_min = 5,
y_max = 31000,
heat_point = 95,
humidity_point = 10,
@ -923,7 +923,7 @@ function default.register_biomes()
--depth_water_top = ,
--node_water = "",
y_min = -112,
y_max = 0,
y_max = 4,
heat_point = 95,
humidity_point = 10,
})
@ -1292,7 +1292,7 @@ function default.register_decorations()
persist = 0.6
},
biomes = {"desert"},
y_min = 2,
y_min = 5,
y_max = 31000,
schematic = minetest.get_modpath("default").."/schematics/large_cactus.mts",
flags = "place_center_x",
@ -1314,7 +1314,7 @@ function default.register_decorations()
persist = 0.6
},
biomes = {"desert"},
y_min = 2,
y_min = 5,
y_max = 31000,
decoration = "default:cactus",
height = 2,

View File

@ -162,6 +162,7 @@ default:chest_locked
default:bookshelf
default:sign_wall
default:ladder
default:ladder_obsidian
default:fence_wood
@ -194,7 +195,7 @@ default:nyancat_rainbow
minetest.register_node("default:stone", {
description = "Stone",
tiles = {"default_stone.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky = 3, stone = 1},
drop = {
items = {
@ -207,7 +208,7 @@ minetest.register_node("default:stone", {
minetest.register_node("default:cobble", {
description = "Cobblestone",
tiles = {"default_cobble.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(),
})
@ -224,6 +225,7 @@ minetest.register_node("default:cobble_cooled", {
minetest.register_node("default:stonebrick", {
description = "Stone Brick",
tiles = {"default_stone_brick.png"},
is_ground_content = false,
groups = {cracky = 2, stone = 1},
sounds = default.node_sound_stone_defaults(),
})
@ -231,7 +233,7 @@ minetest.register_node("default:stonebrick", {
minetest.register_node("default:mossycobble", {
description = "Mossy Cobblestone",
tiles = {"default_mossycobble.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky=3, stone=1},
drop = {
items = {
@ -244,11 +246,10 @@ minetest.register_node("default:mossycobble", {
})
minetest.register_node("default:desert_stone", {
description = "Desert Stone",
tiles = {"default_desert_stone.png"},
is_ground_content = true,
legacy_mineral = true,
groups = {crumbly = 1, cracky = 3, stone = 1},
drop = {
items = {
@ -262,7 +263,7 @@ minetest.register_node("default:desert_stone", {
minetest.register_node("default:desert_cobble", {
description = "Desert Cobblestone",
tiles = {"default_desert_cobble.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky = 3, stone = 2},
sounds = default.node_sound_stone_defaults(),
})
@ -276,11 +277,9 @@ minetest.register_node("default:desert_stonebrick", {
})
minetest.register_node("default:sandstone", {
description = "Sandstone",
tiles = {"default_sandstone.png"},
is_ground_content = true,
groups = {crumbly=1,cracky=3},
sounds = default.node_sound_stone_defaults(),
})
@ -288,13 +287,12 @@ minetest.register_node("default:sandstone", {
minetest.register_node("default:sandstonebrick", {
description = "Sandstone Brick",
tiles = {"default_sandstone_brick.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky=2},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:obsidian", {
description = "Obsidian",
tiles = {"default_obsidian.png"},
@ -327,7 +325,6 @@ minetest.register_node("default:obsidianbrick", {
minetest.register_node("default:dirt", {
description = "Dirt",
tiles = {"default_dirt.png"},
is_ground_content = true,
groups = {crumbly=3, soil=1},
drop = {
items = {
@ -340,8 +337,9 @@ minetest.register_node("default:dirt", {
minetest.register_node("default:dirt_with_grass", {
description = "Dirt with Grass",
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
is_ground_content = true,
tiles = {"default_grass.png", "default_dirt.png",
{name = "default_dirt.png^default_grass_side.png",
tileable_vertical = false}},
groups = {crumbly=3,soil=1},
drop = {
items = {
@ -356,7 +354,8 @@ minetest.register_node("default:dirt_with_grass", {
minetest.register_node("default:dirt_with_grass_footsteps", {
description = "Dirt with Grass and Footsteps",
tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
"default_dirt.png^default_grass_side.png"},
{name = "default_dirt.png^default_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
@ -368,8 +367,8 @@ minetest.register_node("default:dirt_with_dry_grass", {
description = "Dirt with Dry Grass",
tiles = {"default_dry_grass.png",
"default_dirt.png",
"default_dirt.png^default_dry_grass_side.png"
},
{name = "default_dirt.png^default_dry_grass_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1},
drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({
@ -379,8 +378,9 @@ minetest.register_node("default:dirt_with_dry_grass", {
minetest.register_node("default:dirt_with_snow", {
description = "Dirt with Snow",
tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"},
is_ground_content = true,
tiles = {"default_snow.png", "default_dirt.png",
{name = "default_dirt.png^default_snow_side.png",
tileable_vertical = false}},
groups = {crumbly = 3, soil = 1},
drop = {
items = {
@ -394,24 +394,22 @@ minetest.register_node("default:dirt_with_snow", {
})
minetest.register_node("default:sand", {
description = "Sand",
tiles = {"default_sand.png"},
groups = {crumbly = 3, falling_node = 1, sand = 1},
is_ground_content = true,
drop = {
items = {
{items = {"default:sand"}},
},
},
groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(),
})
minetest.register_node("default:desert_sand", {
description = "Desert Sand",
tiles = {"default_desert_sand.png"},
is_ground_content = true,
drop = {
items = {
{items = {"default:desert_sand"}},
@ -422,11 +420,9 @@ minetest.register_node("default:desert_sand", {
})
minetest.register_node("default:gravel", {
description = "Gravel",
tiles = {"default_gravel.png"},
is_ground_content = true,
groups = {crumbly=2, falling_node=1},
drop = {
items = {
@ -440,7 +436,6 @@ minetest.register_node("default:gravel", {
})
minetest.register_node("default:clay", {
description = "Clay",
tiles = {"default_clay.png"},
@ -469,7 +464,6 @@ minetest.register_node("default:clay_burned", {
})
minetest.register_node("default:snow", {
description = "Snow",
tiles = {"default_snow.png"},
@ -489,7 +483,7 @@ minetest.register_node("default:snow", {
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
},
},
groups = {crumbly=3,falling_node=1, melts = 1, float = 1},
groups = {crumbly = 3, falling_node = 1, puts_out_fire = 1},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_snow_footstep", gain = 0.25},
dug = {name = "default_snow_footstep", gain = 0.75},
@ -503,13 +497,10 @@ minetest.register_node("default:snow", {
end,
})
minetest.register_node("default:snowblock", {
description = "Snow Block",
tiles = {"default_snow.png"},
is_ground_content = true,
freezemelt = "default:water_source",
groups = {crumbly=3, melts = 1},
groups = {crumbly = 3, puts_out_fire = 1},
sounds = default.node_sound_dirt_defaults({
footstep = {name = "default_snow_footstep", gain = 0.25},
dug = {name = "default_snow_footstep", gain = 0.75},
@ -517,17 +508,15 @@ minetest.register_node("default:snowblock", {
})
minetest.register_node("default:ice", {
description = "Ice",
drawtype = "glasslike",
tiles = {"default_ice.png"},
is_ground_content = true,
paramtype = "light",
groups = {cracky = 3, puts_out_fire = 1},
use_texture_alpha = true,
freezemelt = "default:water_source",
post_effect_color = {a = 120, r = 120, g = 160, b = 180},
groups = {cracky = 3, melts = 1},
sounds = default.node_sound_glass_defaults(),
})
@ -574,7 +563,8 @@ minetest.register_node("default:sapling", {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=3,flammable=2,attached_node=1,sapling=1},
groups = {snappy = 3, flammable=2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
})
@ -623,7 +613,8 @@ minetest.register_node("default:apple", {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
},
groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1},
groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
leafdecay = 3, leafdecay_drop = 1},
on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults(),
@ -635,18 +626,18 @@ minetest.register_node("default:apple", {
})
minetest.register_node("default:jungletree", {
description = "Jungle Tree",
tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
"default_jungletree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
drop = {
items = {
{items = {"default:jungletree"}},
},
},
groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
@ -703,12 +694,12 @@ minetest.register_node("default:junglesapling", {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
},
groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1},
groups = {snappy = 2, dig_immediate = 3, flammable = 2,
attached_node = 1, sapling = 1},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:pine_tree", {
description = "Pine Tree",
tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
@ -770,6 +761,7 @@ minetest.register_node("default:pine_sapling", {
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("default:acacia_tree", {
description = "Acacia Tree",
tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
@ -795,6 +787,7 @@ minetest.register_node("default:acacia_leaves", {
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_acacia_leaves.png"},
waving = 1,
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
@ -924,7 +917,6 @@ minetest.register_node("default:cherry_sapling", {
minetest.register_node("default:stone_with_coal", {
description = "Coal Ore",
tiles = {"default_stone.png^default_mineral_coal.png"},
is_ground_content = true,
groups = {cracky = 3},
drop = {
items = {
@ -954,17 +946,15 @@ minetest.register_node("default:desert_stone_with_coal", {
minetest.register_node("default:coalblock", {
description = "Coal Block",
tiles = {"default_coal_block.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky = 3},
sounds = default.node_sound_stone_defaults(),
})
minetest.register_node("default:stone_with_iron", {
description = "Iron Ore",
tiles = {"default_stone.png^default_mineral_iron.png"},
is_ground_content = true,
groups = {cracky = 3},
drop = {
items = {
@ -979,13 +969,12 @@ minetest.register_node("default:stone_with_iron", {
minetest.register_node("default:steelblock", {
description = "Steel Block",
tiles = {"default_steel_block.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky = 1,level = 2, ingot_block = 1},
sounds = default.node_sound_metal_defaults(),
})
minetest.register_node("default:stone_with_copper", {
description = "Copper Ore",
tiles = {"default_stone.png^default_mineral_copper.png"},
@ -1019,7 +1008,7 @@ minetest.register_node("default:desert_stone_with_copper", {
minetest.register_node("default:copperblock", {
description = "Copper Block",
tiles = {"default_copper_block.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky = 1, level = 2, ingot_block = 1},
sounds = default.node_sound_metal_defaults(),
})
@ -1027,13 +1016,12 @@ minetest.register_node("default:copperblock", {
minetest.register_node("default:bronzeblock", {
description = "Bronze Block",
tiles = {"default_bronze_block.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky = 1, level = 2, ingot_block = 1},
sounds = default.node_sound_metal_defaults(),
})
minetest.register_node("default:stone_with_mese", {
description = "Mese Ore",
tiles = {"default_stone.png^default_mineral_mese.png"},
@ -1092,12 +1080,9 @@ minetest.register_node("default:meze", {
minetest.register_alias("default:meze_block", "default:meze")
minetest.register_node("default:stone_with_gold", {
description = "Gold Ore",
tiles = {"default_stone.png^default_mineral_gold.png"},
is_ground_content = true,
groups = {cracky = 3},
drop = {
items = {
@ -1113,7 +1098,7 @@ minetest.register_node("default:stone_with_gold", {
minetest.register_node("default:goldblock", {
description = "Gold Block",
tiles = {"default_gold_block.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky = 1, ingot_block = 1},
sounds = default.node_sound_metal_defaults(),
})
@ -1123,7 +1108,6 @@ minetest.register_node("default:goldblock", {
minetest.register_node("default:stone_with_diamond", {
description = "Diamond Ore",
tiles = {"default_stone.png^default_mineral_diamond.png"},
is_ground_content = true,
groups = {cracky = 3},
drop = {
items = {
@ -1138,7 +1122,7 @@ minetest.register_node("default:stone_with_diamond", {
minetest.register_node("default:diamondblock", {
description = "Diamond Block",
tiles = {"default_diamond_block.png"},
is_ground_content = true,
is_ground_content = false,
groups = {cracky = 1, level = 3},
sounds = default.node_sound_metal_defaults(),
})
@ -1164,9 +1148,9 @@ minetest.register_node("default:stone_with_coin", {
minetest.register_node("default:cactus", {
description = "Cactus",
tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"},
tiles = {"default_cactus_top.png", "default_cactus_top.png",
"default_cactus_side.png"},
paramtype2 = "facedir",
is_ground_content = true,
groups = {snappy = 1, choppy = 3, flammable = 2},
drop = {
items = {
@ -1235,7 +1219,6 @@ minetest.register_node("default:junglegrass", {
sunlight_propagates = true,
walkable = false,
buildable_to = true,
is_ground_content = true,
groups = {snappy = 3, flammable = 2, flora = 1, attached_node = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
@ -1244,6 +1227,7 @@ minetest.register_node("default:junglegrass", {
},
})
minetest.register_node("default:grass_1", {
description = "Grass",
drawtype = "plantlike",
@ -1268,7 +1252,8 @@ minetest.register_node("default:grass_1", {
-- place a random grass node
local stack = ItemStack("default:grass_" .. math.random(1,5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("default:grass_1 "..itemstack:get_count()-(1-ret:get_count()))
return ItemStack("default:grass_1 " ..
itemstack:get_count() - (1 - ret:get_count()))
end,
})
@ -1286,7 +1271,8 @@ for i=2,5 do
buildable_to = true,
is_ground_content = true,
drop = "default:grass_1",
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
groups = {snappy = 3, flammable = 3, flora = 1,
attached_node = 1, not_in_creative_inventory = 1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
@ -1295,6 +1281,7 @@ for i=2,5 do
})
end
minetest.register_node("default:dry_grass_1", {
description = "Dry Grass",
drawtype = "plantlike",
@ -1317,7 +1304,8 @@ minetest.register_node("default:dry_grass_1", {
-- place a random dry grass node
local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
local ret = minetest.item_place(stack, placer, pointed_thing)
return ItemStack("default:dry_grass_1 "..itemstack:get_count()-(1-ret:get_count()))
return ItemStack("default:dry_grass_1 " ..
itemstack:get_count() - (1 - ret:get_count()))
end,
})
@ -1333,7 +1321,8 @@ for i=2,5 do
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
groups = {snappy = 3, flammable = 3, flora = 1,
attached_node = 1, not_in_creative_inventory=1},
drop = "default:dry_grass_1",
sounds = default.node_sound_leaves_defaults(),
selection_box = {
@ -1388,9 +1377,8 @@ minetest.register_node("default:water_source", {
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = 1,
freezemelt = "default:ice",
post_effect_color = {a = 120, r = 20, g = 60, b = 80},
groups = {water=3, liquid=3, puts_out_fire=1, freezes = 1},
groups = {water = 3, liquid = 3, puts_out_fire = 1},
})
minetest.register_node("default:water_flowing", {
@ -1434,9 +1422,9 @@ minetest.register_node("default:water_flowing", {
liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source",
liquid_viscosity = 1,
freezemelt = "default:snow",
post_effect_color = {a = 120, r = 20, g = 60, 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},
})
minetest.register_node("default:river_water_source", {
@ -1529,7 +1517,8 @@ minetest.register_node("default:river_water_flowing", {
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a = 64, r = 100, g = 100, b = 200},
groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
groups = {water = 3, liquid = 3, puts_out_fire = 1,
not_in_creative_inventory = 1},
})
minetest.register_node("default:lava_source", {
@ -1623,7 +1612,8 @@ minetest.register_node("default:lava_flowing", {
liquid_renewable = false,
damage_per_second = 4 * 2,
post_effect_color = {a = 220, r = 250, g = 70, b = 20},
groups = {lava=3, liquid=2, hot=3, igniter=1, not_in_creative_inventory=1},
groups = {lava = 3, liquid = 2, hot = 3, igniter = 1,
not_in_creative_inventory = 1},
})
minetest.register_node("default:acid_source", {
@ -1806,15 +1796,22 @@ minetest.register_node("default:torch", {
wall_bottom = {-0.25, -0.5 , -0.25, 0.25, 0.0625, 0.25},
wall_side = {-0.25, -0.5 , -0.25, -0.5, 0.0625, 0.25},
},
groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1, hot = 2},
groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1,
hot = 2},
legacy_wallmounter = true,
sounds = default.node_sound_wood_defaults(),
})
local chest_formspec =
"size[8,9]"..
default.gui_slots ..
default.gui_bg_img ..
default.gui_slots ..
"list[current_name;main;0,0.3;8,4;]" ..
"list[current_player;main;0,4.85;8,4;]" ..
"list[current_player;main;0,4.85;8,1;]" ..
"list[current_player;main;0,6.08;8,3;8]" ..
"listring[current_name;main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0, 4.85) ..
default.get_hotbar_bg(0, 5.85)
@ -1823,8 +1820,13 @@ local function get_locked_chest_formspec(pos)
local formspec =
"size[8,9]"..
default.gui_slots..
default.gui_bg_img ..
default.gui_slots ..
"list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"..
"list[current_player;main;0,4.85;8,4;]"..
"list[current_player;main;0,6.08;8,3;8]" ..
"listring[nodemeta:" .. spos .. ";main]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0, 4.85) ..
default.get_hotbar_bg(0, 5.85)
return formspec
@ -1843,7 +1845,7 @@ minetest.register_node("default:chest", {
"default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
paramtype2 = "facedir",
groups = {choppy = 2, oddly_breakable_by_hand = 2},
is_ground_content = false,
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
@ -1858,17 +1860,18 @@ minetest.register_node("default:chest", {
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
on_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
minetest.log("action", player:get_player_name() ..
" moves stuff in chest at "..minetest.pos_to_string(pos) .. ".")
" moves stuff in chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to chest at "..minetest.pos_to_string(pos) .. ".")
" moves stuff to chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" takes stuff from chest at "..minetest.pos_to_string(pos) .. ".")
" takes stuff from chest at " .. minetest.pos_to_string(pos))
end,
})
@ -1879,7 +1882,7 @@ minetest.register_node("default:chest_locked", {
"default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"},
paramtype2 = "facedir",
groups = {choppy = 2, oddly_breakable_by_hand = 2},
is_ground_content = false,
legacy_facedir_simple = true,
sounds = default.node_sound_wood_defaults(),
after_place_node = function(pos, placer)
@ -1900,7 +1903,8 @@ minetest.register_node("default:chest_locked", {
local inv = meta:get_inventory()
return inv:is_empty("main") and has_locked_chest_privilege(meta, player)
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
allow_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if not has_locked_chest_privilege(meta, player) then
minetest.log("action", player:get_player_name()..
@ -1939,11 +1943,11 @@ minetest.register_node("default:chest_locked", {
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" moves stuff to locked chest at "..minetest.pos_to_string(pos) .. ".")
" moves stuff to locked chest at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" takes stuff from locked chest at "..minetest.pos_to_string(pos) .. ".")
" takes stuff from locked chest at " .. minetest.pos_to_string(pos))
end,
on_rightclick = function(pos, node, clicker)
@ -1964,8 +1968,13 @@ minetest.register_node("default:chest_locked", {
default.bookshelf_formspec =
"size[8,7;]" ..
default.gui_slots ..
default.gui_bg_img ..
default.gui_slots ..
"list[context;books;0,0.3;8,2;]" ..
"list[current_player;main;0,2.85;8,4;]" ..
"list[current_player;main;0,2.85;8,1;]" ..
"list[current_player;main;0,4.08;8,3;8]" ..
"listring[context;books]" ..
"listring[current_player;main]" ..
default.get_hotbar_bg(0, 2.85) ..
default.get_hotbar_bg(0, 3.85)
@ -1973,7 +1982,6 @@ minetest.register_node("default:bookshelf", {
description = "Bookshelf",
tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"},
is_ground_content = false,
paramtype2 = "facedir",
groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
sounds = default.node_sound_wood_defaults(),
@ -2003,7 +2011,8 @@ minetest.register_node("default:bookshelf", {
end
end,
allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
allow_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = inv:get_stack(from_list, from_index)
@ -2018,20 +2027,22 @@ minetest.register_node("default:bookshelf", {
end
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
on_metadata_inventory_move = function(pos, from_list, from_index,
to_list, to_index, count, player)
minetest.log("action", player:get_player_name() ..
" moves stuff in bookshelf at "..minetest.pos_to_string(pos) .. ".")
" moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" moves stuff to bookshelf at "..minetest.pos_to_string(pos) .. ".")
" moves stuff to bookshelf at " .. minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name() ..
" takes stuff from bookshelf at "..minetest.pos_to_string(pos) .. ".")
" takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
end,
})
minetest.register_node("default:sign_wall", {
description = "Sign",
drawtype = "nodebox",
@ -2049,7 +2060,7 @@ minetest.register_node("default:sign_wall", {
wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
},
selection_box = {type = "wallmounted"},
legacy_wallmounted = true,
groups = {choppy = 2, dig_immediate = 2, attached_node = 1},
sounds = default.node_sound_wood_defaults(),
@ -2067,13 +2078,14 @@ minetest.register_node("default:sign_wall", {
end
local meta = minetest.get_meta(pos)
if not fields.text then return end
minetest.log("action", (sender:get_player_name() or "").." wrote \""..fields.text..
"\" to sign at "..minetest.pos_to_string(pos) .. ".")
minetest.log("action", (sender:get_player_name() or "") .. " wrote \"" ..
fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
meta:set_string("text", fields.text)
meta:set_string("infotext", "\"" .. fields.text .. "\"")
meta:set_string("infotext", '"' .. fields.text .. '"')
end,
})
minetest.register_node("default:ladder", {
description = "Ladder",
drawtype = "nodebox",
@ -2090,11 +2102,14 @@ minetest.register_node("default:ladder", {
wall_bottom = {-0.375, -0.5, -0.5, 0.375, -0.4375, 0.5},
wall_side = {-0.5, -0.5, -0.375, -0.4375, 0.5, 0.375},
},
selection_box = {type = "wallmounted"},
groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
legacy_wallmounted = true,
sounds = default.node_sound_wood_defaults(),
})
local fence_texture =
"default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126"
minetest.register_node("default:ladder_obsidian", {
description = "Ladder Obsidian",
drawtype = "nodebox",
@ -2130,7 +2145,8 @@ minetest.register_node("default:fence_wood", {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
groups = {not_in_creative_inventory=1,choppy=2,oddly_breakable_by_hand=2,flammable=2},
groups = {not_in_creative_inventory = 1, choppy = 2, oddly_breakable_by_hand = 2,
flammable = 2},
sounds = default.node_sound_wood_defaults(),
})
@ -2232,7 +2248,8 @@ minetest.register_node("default:obsidian_glass", {
minetest.register_node("default:rail", {
description = "Rail",
drawtype = "raillike",
tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"},
tiles = {"default_rail.png", "default_rail_curved.png",
"default_rail_t_junction.png", "default_rail_crossing.png"},
inventory_image = "default_rail.png",
wield_image = "default_rail.png",
paramtype = "light",
@ -2244,9 +2261,11 @@ minetest.register_node("default:rail", {
-- but how to specify the dimensions for curved and sideways rails?
fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
},
groups = {bendy=2,dig_immediate=2,attached_node=1,connect_to_raillike=1}, -- //MFF Temporary fix (Mg|06/21/2015) connect_to_raillike=minetest.raillike_group("rail")},
groups = {bendy = 2, dig_immediate = 2, attached_node = 1,
connect_to_raillike = minetest.raillike_group("rail")},
})
minetest.register_node("default:brick", {
description = "Brick Block",
tiles = {"default_brick.png"},

BIN
minetestforfun_game/mods/default/schematics/papyrus.mts Executable file → Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -36,27 +36,27 @@ minetest.register_abm({
if node.name == "default:sapling" then
minetest.log("action", "A sapling grows into a tree at "..
minetest.pos_to_string(pos))
-- if mapgen == "v6" then
if mapgen == "v6" then
default.grow_tree(pos, random(1, 4) == 1)
-- else
-- default.grow_new_apple_tree(pos)
-- end
else
default.grow_new_apple_tree(pos)
end
elseif node.name == "default:junglesapling" then
minetest.log("action", "A jungle sapling grows into a tree at "..
minetest.pos_to_string(pos))
-- if mapgen == "v6" then
if mapgen == "v6" then
default.grow_jungle_tree(pos)
-- else
-- default.grow_new_jungle_tree(pos)
-- end
else
default.grow_new_jungle_tree(pos)
end
elseif node.name == "default:pine_sapling" then
minetest.log("action", "A pine sapling grows into a tree at "..
minetest.pos_to_string(pos))
-- if mapgen == "v6" then
if mapgen == "v6" then
default.grow_pine_tree(pos)
-- else
-- default.grow_new_pine_tree(pos)
-- end
else
default.grow_new_pine_tree(pos)
end
elseif node.name == "default:acacia_sapling" then
minetest.log("action", "An acacia sapling grows into a tree at "..
minetest.pos_to_string(pos))
@ -359,7 +359,7 @@ end
-- New apple tree
function default.grow_new_apple_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/apple_tree.mts"
local path = minetest.get_modpath("default") .. "/schematics/apple_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
end
@ -368,8 +368,8 @@ end
-- New jungle tree
function default.grow_new_jungle_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/jungle_tree.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y, z = pos.z - 2},
local path = minetest.get_modpath("default") .. "/schematics/jungle_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
end
@ -377,7 +377,7 @@ end
-- New pine tree
function default.grow_new_pine_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/pine_tree.mts"
local path = minetest.get_modpath("default") .. "/schematics/pine_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 2, y = pos.y - 1, z = pos.z - 2},
path, 0, nil, false)
end
@ -386,7 +386,7 @@ end
-- New acacia tree
function default.grow_new_acacia_tree(pos)
local path = minetest.get_modpath("default") .. "/schematics/acacia_tree.mts"
local path = minetest.get_modpath("default") .. "/schematics/acacia_tree_from_sapling.mts"
minetest.place_schematic({x = pos.x - 4, y = pos.y - 1, z = pos.z - 4},
path, random, nil, false)
end

View File

@ -1,13 +1,19 @@
-- minetest/fire/init.lua
-- Global namespace for functions
fire = {}
-- Register flame node
minetest.register_node("fire:basic_flame", {
description = "Fire",
drawtype = "firelike",
tiles = {{
name = "fire_basic_flame_animated.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
animation = {type = "vertical_frames",
aspect_w = 16, aspect_h = 16, length = 1},
}},
inventory_image = "fire_basic_flame.png",
light_source = 14,
@ -29,11 +35,18 @@ minetest.register_node("fire:basic_flame", {
on_blast = function() end,
})
fire.D = 6
-- Fire sounds table
-- key: position hash of low corner of area
-- value: {handle=sound handle, name=sound name}
fire.sounds = {}
-- Get sound area of position
-- size of sound areas
fire.D = 6
function fire.get_area_p0p1(pos)
local p0 = {
x = math.floor(pos.x / fire.D) * fire.D,
@ -48,6 +61,9 @@ function fire.get_area_p0p1(pos)
return p0, p1
end
-- Update fire sounds in sound area of position
function fire.update_sounds_around(pos)
local p0, p1 = fire.get_area_p0p1(pos)
local cp = {x = (p0.x + p1.x) / 2, y = (p0.y + p1.y) / 2, z = (p0.z + p1.z) / 2}
@ -66,7 +82,8 @@ function fire.update_sounds_around(pos)
if not sound then
if should_have_sound then
fire.sounds[p0_hash] = {
handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}),
handle = minetest.sound_play(wanted_sound,
{pos = cp, max_hear_distance = 16, loop = true}),
name = wanted_sound.name,
}
end
@ -77,40 +94,53 @@ function fire.update_sounds_around(pos)
elseif sound.name ~= wanted_sound.name then
minetest.sound_stop(sound.handle)
fire.sounds[p0_hash] = {
handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}),
handle = minetest.sound_play(wanted_sound,
{pos = cp, max_hear_distance = 16, loop = true}),
name = wanted_sound.name,
}
end
end
end
-- Update fire sounds on flame node construct or destruct
function fire.on_flame_add_at(pos)
fire.update_sounds_around(pos)
end
function fire.on_flame_remove_at(pos)
fire.update_sounds_around(pos)
end
-- Return positions for flames around a burning node
function fire.find_pos_for_flame_around(pos)
return minetest.find_node_near(pos, 1, {"air"})
end
-- Detect nearby extinguishing nodes
function fire.flame_should_extinguish(pos)
if minetest.setting_getbool("disable_fire") then return true end
--return minetest.find_node_near(pos, 1, {"group:puts_out_fire"})
local p0 = {x=pos.x-2, y=pos.y, z=pos.z-2}
local p1 = {x=pos.x+2, y=pos.y, z=pos.z+2}
local p0 = {x = pos.x - 1, y = pos.y, z = pos.z - 1}
local p1 = {x = pos.x + 1, y = pos.y + 1, z = pos.z + 1}
local ps = minetest.find_nodes_in_area(p0, p1, {"group:puts_out_fire"})
return (#ps ~= 0)
end
--[[-- Ignite neighboring nodes
minetest.register_abm({
-- Ignite neighboring nodes
--[[minetest.register_abm({
nodenames = {"group:flammable"},
neighbors = {"group:igniter"},
interval = 5,
chance = 2,
interval = 7,
chance = 32,
action = function(p0, node, _, _)
-- If there is water or stuff like that around flame, don't ignite
if fire.flame_should_extinguish(p0) then
@ -123,7 +153,12 @@ minetest.register_abm({
end,
})
-- Rarely ignite things from far
--[[ Currently disabled to reduce the chance of uncontrollable spreading
fires that disrupt servers. Also for less lua processing load.
minetest.register_abm({
nodenames = {"group:igniter"},
neighbors = {"air"},
@ -150,10 +185,11 @@ minetest.register_abm({
})]]
-- Remove flammable nodes and flame
minetest.register_abm({
nodenames = {"fire:basic_flame"},
interval = 3,
chance = 2,
interval = 5,
chance = 16,
action = function(p0, node, _, _)
-- If there is water or stuff like that around flame, remove flame
if fire.flame_should_extinguish(p0) then