1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-28 20:56:02 +02:00

109 Commits

Author SHA1 Message Date
2392842948 Fire: Slow down fire spread and reduce lua load
Increase chance value of ABMs
Disable ignition from a distance
Only detect neighbouring extinguishing nodes
Fix code style issues and add comments
2015-08-20 04:09:22 +01:00
3740efb393 New normalmaps for some nodes 2015-08-19 03:24:45 +01:00
835ca02be5 Add tiling info for grass nodes 2015-08-19 00:59:22 +01:00
99d0442cc9 Boats: Fix sinking through boat when detaching
By CProgrammerRU
Also, by paramat:
Slightly raise base of collision box
Improve code style
2015-08-18 22:35:16 +01:00
b24049950e Default: New stone brick and desert stone brick textures 2015-08-17 21:59:43 +01:00
86dab909ed Default: Change to 'pixelbox2' long grass textures by Gambit 2015-08-17 03:58:34 +01:00
ffcb3d6356 Stairs: Add aliases needed due to new pine wood name 2015-08-16 00:31:41 +01:00
c7b9e734ff Default: New grass textures, new footprint overlay texture 2015-08-15 21:19:39 +01:00
450543f782 Stairs: Add straw and metal blocks
Make replace ABM optional, disabled by default
2015-08-14 23:23:41 +01:00
b7a1426b42 Default: New darker jungletree_top and junglewood textures 2015-08-14 19:15:33 +01:00
408ee69fb8 Flowers: Add sporeless mushrooms and edit drops 2015-08-14 01:34:35 +01:00
35de5241f4 Fixed invalid check. This fixes minetest/minetest_game#609 2015-08-11 18:56:15 +02:00
be4dd6479d Default: Rename pine tree nodes, textures and mapgen aliases 2015-08-10 09:19:02 +01:00
7066a6a0dd Tweak mushroom drops
-> Don't always drop the main mushroom (allowed endless spore generation loop before)
-> Drop less spores, before you got lots of spores
2015-08-10 01:03:15 +02:00
6194f9ffea Default/trees: Combine sapling ABMs into one ABM 2015-08-09 05:52:46 +01:00
47c7b0b187 Mushrooms: Rename spore nodes. Single ABM for mushroom growing
Code re-arranged and clarified
2015-08-07 19:07:48 +01:00
0a3bf5b220 Biomes: Tune v5/v7 biomes and v5/v6/v7 mushroom distribution
More complex distribution of dry grasses
Remove water below glacier rivers
Gravel as glacier seabed
Do not force-place acacia root
Tune acacia tree density
Match mgv5/v7 mushrooms to tree density
Spawn mgv6 mushrooms by trees
2015-08-07 17:13:33 +01:00
14ee61ab92 Fix mese block alias
It should alias the old name (mese_block) to the new/current name (mese) rather than the other way round.
2015-08-04 01:02:01 +01:00
f7f178ce03 Stairs: Lengthen interval of replace abm 2015-08-04 01:01:40 +01:00
547a7b3304 Default/functions: Reduce lavacooling ABM/sound overload 2015-08-04 01:01:25 +01:00
8d1eef025d Flowers: Make mushrooms farmable using spores 2015-08-04 01:00:47 +01:00
84de5f0f40 Add biomes for mgv5 and mgv7 2015-07-30 01:19:12 +01:00
cbea61e8dd Default: Thicker snow nodebox 2015-07-29 01:18:30 +01:00
2885ae6018 Default: Add papyrus schematic 2015-07-28 02:27:45 +01:00
cf781ee218 Default: New appletree schematic with tuned apple chance 2015-07-27 05:06:32 +01:00
252dffce78 Default/mapgen: Disable nyancats in singlenode mapgen 2015-07-27 05:05:50 +01:00
83c2a88c91 Flowers: Keep mushrooms above water level 2015-07-24 21:56:16 +01:00
e7def5d4e6 Default: Add improved mgv5/mgv7 tree schematics 2015-07-24 00:59:44 +01:00
ec68283812 Stairs: Register acacia wood stair and slab 2015-07-23 05:14:43 +01:00
bc4d0c1344 Flowers: Add mushrooms to mgv6 2015-07-23 05:14:32 +01:00
e2033025b0 Default: Add biome API tree schematics and enable growing by sapling ABMs 2015-07-20 22:56:35 +01:00
da9789e3ce Fix not_in_creative_inventory
Update
2015-07-17 20:53:55 +01:00
26866e4c21 Grant multiple tiles on stairs model 2015-07-17 20:53:32 +01:00
0cf4fd4c18 Add mushrooms 2015-07-17 10:12:00 +02:00
2ddbf68e31 Better default stone normalmap, sharpened a bit 2015-07-14 14:53:13 +02:00
0c5f6dabc0 Add new texture for leaves, jungle leaves and style simple 2015-07-13 03:17:26 +01:00
fdae2832bb Default: New ice texture by Gambit and asl97 2015-07-13 00:45:38 +01:00
6843ddb814 Default: Add savanna nodes, textures, crafting and fuels 2015-07-12 22:41:59 +01:00
166b1c623a Add some normalmaps with heightmap in alpha channel 2015-07-12 12:24:02 +02:00
jp
e8cafeb3e7 Improved diamond block texture (from #548) 2015-07-12 12:06:38 +02:00
8a7af21e3a Improved stairs model, v2 2015-07-11 00:22:18 +01:00
407b32e04c Improved stairs model 2015-07-09 21:35:53 +01:00
f3f8b22698 Convert stairs in meshnode 2015-07-08 19:07:22 +01:00
585b2bc22e Default/trees: Add checks for air/ignore/needles to pinetree trunk
Speed optimise: Trunk placing, add_pine_needles, add_snow
2015-07-05 15:23:55 +01:00
0914e595c7 Default/mapgen: Add missing spaces 2015-07-01 08:34:25 +01:00
7361eb5e05 Add the listring functionality c977fbd928 2015-06-23 19:17:57 +02:00
44ac020f28 Fix node placing sound being heard on left channel only 2015-06-22 18:33:15 +02:00
e15fde1624 Fix is_ground_content settings for nodes
Remove line if set to the default of 'true'
2015-06-18 02:25:02 +01:00
15ef8b0995 Fix bookshelf's allow_metadata_inventory_move (check if item belongs to "book" group instead of checking if it is "default:book") 2015-06-17 18:33:54 +02:00
d8dd9332ed Improved Iron Bar texture 2015-06-14 11:34:52 +02:00
c4fb5bd385 Bucket: Register river water bucket, add texture
Add groups to registration and use water_bucket group
2015-06-14 01:18:14 +01:00
f09ae11e89 Add patch files to gitignore 2015-06-09 22:01:25 +02:00
8b4a92ef2d word-wrap book text
This change word-wraps text when reading a book.
2015-06-08 16:29:44 +02:00
f92d49feff Default/functions: Fix cactus growing by rotation again. Cleanup code 2015-06-08 00:32:40 +01:00
64fa8e6be5 Make books writable 2015-06-07 15:57:29 +02:00
0aebf864d1 Add gunpowder trails
Uses group “connect_to_raillike”
2015-06-07 14:27:18 +02:00
016fa0da40 Default/functions: Fix cacti not growing when rotation is 1-3 2015-06-07 04:39:25 +01:00
7786f7f8b1 Default/nodes: Match river_water post_effect_colour hue to that of new texture 2015-06-07 04:39:02 +01:00
6919d43d02 Remove deprecated ore generation code 2015-06-07 04:38:52 +01:00
01ad09036b Improved flowers' registration system - Specific nodeboxes, - Color groups - All datas were put into a table then unpacked for add_simple_flower 2015-06-06 14:51:25 +02:00
638add603f Simplified flowers' registration - Created a new local function to register flowers 2015-06-06 14:51:25 +02:00
750f9575af Improve water post effect color 2015-06-06 14:13:01 +02:00
40e2b945e3 Default: New obsidian brick texture. Add river water textures 2015-06-02 01:13:34 +01:00
03b51e8c8f Default: New sandstone brick texture 2015-05-31 05:55:12 +01:00
a4d056e493 Make some common nodes let light pass through 2015-05-14 17:34:17 +02:00
23a37e5e79 Apples give 2 HP instead of 1 HP, bread gives 5 HP instead of 4 HP 2015-05-14 17:33:10 +02:00
300b14078f Give 24 rails per craft instead of 15 2015-05-14 17:28:30 +02:00
eae3740d85 Fix missing argument for on_rotate 2015-05-14 16:07:19 +02:00
3669ca0a83 Make beds not skip night if nobody is online 2015-05-14 14:41:26 +02:00
46c6154444 Make doors not depend on screwdriver. 2015-05-14 14:24:14 +02:00
2824562dc9 Add screwdriver callbacks, and code them for doors and beds 2015-05-14 10:24:56 +02:00
852b337916 Use connect_to_raillike for rail
Used value: 2
2015-05-14 10:19:07 +02:00
dd34dffa45 Default/mapgen: Add sandstone alias for sandstone biome detection 2015-05-12 23:31:38 +01:00
aaa6c260cd Copy pos before giving it to on_blast because it can modify it; also remove a debug print that had nothing to do here 2015-05-12 21:03:02 +02:00
81259e9fcc De-duplicate code in doors mod in make_on_blast 2015-05-12 20:55:46 +02:00
4bd1094619 Fix problems with TNT 2015-05-12 16:53:04 +02:00
8bc8dd64c5 Make TNT respect on_blast, implement on_blast for some nodes
Implemented nodes:
- Steel Door: Ignores explosion
- Locked Chest: Ignores explosion
- Fire: Ignores explosion
- TNT: Starts burning
- Burning TNT: Explodes immediately
- Gunpowder: Starts burning
- Burning Gunpowder: Ignores explosion
2015-05-12 16:32:52 +02:00
ab4485f824 Default/mapgen: Add mapgen aliases for sandstone brick and sandstone brick stair, to enable sandstone dungeons 2015-05-12 16:23:09 +02:00
fa1b4d0d44 Default/nodes: Increase meselamp light level to light_max (14) 2015-05-11 22:50:44 +01:00
055157d084 Default/mapgen: Make register function selection compatible with future mapgens 2015-05-11 05:37:04 +01:00
fe3c5a7090 allow overriding papyrus and cactus grow functions
dont grow cactus on a lying one

use minetest.get_node 2 times less

do a bit what ShadowNinja wrote

add comment

return true if the plant is set
2015-04-27 01:09:32 +01:00
d0070f2b1a Default/mapgen: Add dry shrub to mgv6 tundra 2015-04-23 06:28:49 +01:00
c570f9f494 Default/mapgen: Add alias for river water source 2015-04-19 04:00:46 +01:00
f8c8047a52 Default: Add river_water nodes 2015-04-19 02:27:06 +01:00
f49faadc19 Minetest.conf: Move mapgen flags to engine .conf 2015-04-14 02:32:06 +01:00
fe7a982343 Default/nodes: Make water, lava and ice is_ground_content = false 2015-04-06 01:43:17 +01:00
87468eb6fc Default/mapgen: Fix missing num_spawn_by = 1 line for papyrus 2015-04-05 01:37:14 +01:00
4a7a51a46e Default/mapgen.lua: Remove ores absheight flags. Add aliases for mgv6 snow biomes 2015-03-30 00:21:47 +01:00
Rui
9c15ebccab Add max_hear_distance for fire 2015-03-29 21:35:03 +02:00
525f467057 Slow down fire spread a bit 2015-03-29 21:25:46 +02:00
820a97e397 Add Meselamps
- Mese glows
- Glass + Mese = Meselamp
- New mese mineral texture
2015-03-29 21:17:53 +02:00
jp
3f2e35e827 Add vessels shelf 2015-03-29 21:00:32 +02:00
ccb4b925ed default/mapgen.lua: Register mgv6 decorations
Organise and cleanup code
2015-03-27 00:29:44 +00:00
21c874ab52 flowers/mapgen.lua: Remove unnecessary double quotation marks 2015-03-25 22:03:53 +00:00
8a8712e4a3 flowers/mapgen.lua: Register flower decorations for mgv6 2015-03-25 21:28:15 +00:00
9eb9502209 Optimize boat model 2015-03-21 17:28:36 +01:00
a192f9fc78 default/mapgen.lua: Update biomes for new biome API
Register blob ores in mgv6 to replace addDirtGravelBlobs
Combine ores and blobs functions
2015-03-17 07:46:45 +00:00
794a436d86 Fix bucket code indentation 2015-03-07 21:26:55 -05:00
41837e6193 Fix beds respawn settings check 2015-03-06 19:29:16 +01:00
86e0e4b2bf Remove undeclared writing variable 2015-03-06 11:49:22 +01:00
2a6050e552 Add option to disable bed respawn, better recipe for fancy bed 2015-03-06 10:46:05 +01:00
e604d8d7f3 Remove dupe aliases (fixes #438) 2015-02-28 22:49:32 +01:00
5a2aab855f Make some tools dig faster 2015-02-28 22:44:31 +01:00
jp
f86ac2fdff Optimize textures and model (use *.b3d instead *.x) 2015-02-28 22:33:19 +01:00
df35360372 Make empty buckets stackable 2015-02-28 22:15:46 +01:00
3e912f7b85 Add reverse recipes for hoes
- Adds material for crafting (keeps def.recipe compatibility)
- Fix two typos in api documentation
2015-02-28 22:05:07 +01:00
ea7b04a712 Use only red and white wool for beds 2015-02-24 21:55:14 +01:00
edb02e9d33 Add beds 2015-02-24 20:59:04 +01:00
3b526a7276 mapgen.lua: Add dirt/sand/gravel blob ores for mgv5/mgv7
Create register ores function. Select and order functions per mapgen
Use blob ore for clay. Update ore height_min/max to y_min/max
Tune flower amount
2015-02-22 01:34:35 +00:00
352 changed files with 6484 additions and 19827 deletions

2
.gitignore vendored
View File

@ -5,3 +5,5 @@
tags tags
*.vim *.vim
## Files related to minetest development cycle
*.patch

View File

@ -24,6 +24,42 @@ The bucket API allows registering new types of buckets for non-default liquids.
"Lava Bucket" -- Bucket description "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 Doors API
--------- ---------
The doors mod allows modders to register custom doors and trapdoors. The doors mod allows modders to register custom doors and trapdoors.
@ -89,7 +125,8 @@ farming.register_plant(name, Plant definition)
description = "", -- Description for tooltip description = "", -- Description for tooltip
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
max_uses = 30, -- Uses until destroyed max_uses = 30, -- Uses until destroyed
recipe = { -- Craft recipe material = "", -- Material for recipes
recipe = { -- Craft recipe, if material isn't used
{"air", "air", "air"}, {"air", "air", "air"},
{"", "group:stick"}, {"", "group:stick"},
{"", "group:stick"}, {"", "group:stick"},
@ -102,11 +139,26 @@ farming.register_plant(name, Plant definition)
description = "", -- Description of seed item description = "", -- Description of seed item
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
steps = 8, -- How many steps the plant has to grow, until it can be harvested steps = 8, -- How many steps the plant has to grow, until it can be harvested
^ Always provide a plant texture for 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 minlight = 13, -- Minimum light to grow
maxlight = default.LIGHT_MAX -- Maximum 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 Stairs API
---------- ----------
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
@ -157,6 +209,24 @@ xpanes.register_pane(subname, def)
^ Recipe field only ^ Recipe field only
} }
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 Default sounds
-------------- --------------
Sounds inside the default table can be used within the sounds field of node definitions. Sounds inside the default table can be used within the sounds field of node definitions.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1,3 +0,0 @@
mg_flags = dungeons
mgv6_spflags = biomeblend, jungles

View File

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

18
mods/beds/Changelog.txt Normal file
View File

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

29
mods/beds/README.txt Normal file
View File

@ -0,0 +1,29 @@
Minetest mod "Beds"
===================
by BlockMen (c) 2014-2015
Version: 1.1.1
About
~~~~~
This mod adds a bed to Minetest which allows to skip the night. To sleep rightclick the bed, if playing
in singleplayer mode the night gets skipped imideatly. If playing on server you get shown how many other
players are in bed too. If all players are sleeping the night gets skipped aswell. Also the night skip can be forced
if more than 50% of the players are lying in bed and use this option.
Another feature is a controled respawning. If you have slept in bed (not just lying in it) your respawn point
is set to the beds location and you will respawn there after death.
You can disable the respawn at beds by setting "enable_bed_respawn = false" in minetest.conf
License of source code, textures: WTFPL
---------------------------------------
(c) Copyright BlockMen (2014-2015)
This program is free software. It comes without any warranty, to
the extent permitted by applicable law. You can redistribute it
and/or modify it under the terms of the Do What The Fuck You Want
To Public License, Version 2, as published by Sam Hocevar. See
http://sam.zoy.org/wtfpl/COPYING for more details.

111
mods/beds/api.lua Normal file
View File

@ -0,0 +1,111 @@
function beds.register_bed(name, def)
minetest.register_node(name .. "_bottom", {
description = def.description,
inventory_image = def.inventory_image,
wield_image = def.wield_image,
drawtype = "nodebox",
tiles = def.tiles.bottom,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
stack_max = 1,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = def.nodebox.bottom,
},
selection_box = {
type = "fixed",
fixed = def.selectionbox,
},
after_place_node = function(pos, placer, itemstack)
local n = minetest.get_node_or_nil(pos)
if not n or not n.param2 then
minetest.remove_node(pos)
return true
end
local dir = minetest.facedir_to_dir(n.param2)
local p = vector.add(pos, dir)
local n2 = minetest.get_node_or_nil(p)
local def = n2 and minetest.registered_items[n2.name]
if not def or not def.buildable_to then
minetest.remove_node(pos)
return true
end
minetest.set_node(p, {name = n.name:gsub("%_bottom", "_top"), param2 = n.param2})
return false
end,
on_destruct = function(pos)
local n = minetest.get_node_or_nil(pos)
if not n then return end
local dir = minetest.facedir_to_dir(n.param2)
local p = vector.add(pos, dir)
local n2 = minetest.get_node(p)
if minetest.get_item_group(n2.name, "bed") == 2 and n.param2 == n2.param2 then
minetest.remove_node(p)
end
end,
on_rightclick = function(pos, node, clicker)
beds.on_rightclick(pos, clicker)
end,
on_rotate = function(pos, node, user, mode, new_param2)
local dir = minetest.facedir_to_dir(node.param2)
local p = vector.add(pos, dir)
local node2 = minetest.get_node_or_nil(p)
if not node2 or not minetest.get_item_group(node2.name, "bed") == 2 or
not node.param2 == node2.param2 then
return false
end
if minetest.is_protected(p, user:get_player_name()) then
minetest.record_protection_violation(p, user:get_player_name())
return false
end
if mode ~= screwdriver.ROTATE_FACE then
return false
end
local newp = vector.add(pos, minetest.facedir_to_dir(new_param2))
local node3 = minetest.get_node_or_nil(newp)
local def = node3 and minetest.registered_nodes[node3.name]
if not def or not def.buildable_to then
return false
end
if minetest.is_protected(newp, user:get_player_name()) then
minetest.record_protection_violation(newp, user:get_player_name())
return false
end
node.param2 = new_param2
minetest.swap_node(pos, node)
minetest.remove_node(p)
minetest.set_node(newp, {name = node.name:gsub("%_bottom", "_top"), param2 = new_param2})
return true
end,
})
minetest.register_node(name .. "_top", {
drawtype = "nodebox",
tiles = def.tiles.top,
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2},
sounds = default.node_sound_wood_defaults(),
node_box = {
type = "fixed",
fixed = def.nodebox.top,
},
selection_box = {
type = "fixed",
fixed = {0, 0, 0, 0, 0, 0},
},
})
minetest.register_alias(name, name .. "_bottom")
-- register recipe
minetest.register_craft({
output = name,
recipe = def.recipe
})
end

88
mods/beds/beds.lua Normal file
View File

@ -0,0 +1,88 @@
-- fancy shaped bed
beds.register_bed("beds:fancy_bed", {
description = "Fancy Bed",
inventory_image = "beds_bed_fancy.png",
wield_image = "beds_bed_fancy.png",
tiles = {
bottom = {
"beds_bed_top1.png",
"default_wood.png",
"beds_bed_side1.png",
"beds_bed_side1.png^[transformFX",
"default_wood.png",
"beds_bed_foot.png",
},
top = {
"beds_bed_top2.png",
"default_wood.png",
"beds_bed_side2.png",
"beds_bed_side2.png^[transformFX",
"beds_bed_head.png",
"default_wood.png",
}
},
nodebox = {
bottom = {
{-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375},
{0.375, -0.5, -0.5, 0.5, -0.065, -0.4375},
{-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375},
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
{-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5},
},
top = {
{-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5},
{0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5},
{-0.5, 0, 0.4375, 0.5, 0.125, 0.5},
{-0.5, -0.375, 0.4375, 0.5, -0.125, 0.5},
{-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5},
{0.4375, -0.375, -0.5, 0.5, -0.125, 0.5},
{-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375},
}
},
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"", "", "group:stick"},
{"wool:red", "wool:red", "wool:white"},
{"group:wood", "group:wood", "group:wood"},
},
})
-- simple shaped bed
beds.register_bed("beds:bed", {
description = "Simple Bed",
inventory_image = "beds_bed.png",
wield_image = "beds_bed.png",
tiles = {
bottom = {
"beds_bed_top_bottom.png^[transformR90",
"default_wood.png",
"beds_bed_side_bottom_r.png",
"beds_bed_side_bottom_r.png^[transformfx",
"beds_transparent.png",
"beds_bed_side_bottom.png"
},
top = {
"beds_bed_top_top.png^[transformR90",
"default_wood.png",
"beds_bed_side_top_r.png",
"beds_bed_side_top_r.png^[transformfx",
"beds_bed_side_top.png",
"beds_transparent.png",
}
},
nodebox = {
bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5},
},
selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5},
recipe = {
{"wool:red", "wool:red", "wool:white"},
{"group:wood", "group:wood", "group:wood"}
},
})
-- aliases for PA's beds mod
minetest.register_alias("beds:bed_bottom_red", "beds:bed_bottom")
minetest.register_alias("beds:bed_top_red", "beds:bed_top")

2
mods/beds/depends.txt Normal file
View File

@ -0,0 +1,2 @@
default
wool

213
mods/beds/functions.lua Normal file
View File

@ -0,0 +1,213 @@
local player_in_bed = 0
local is_sp = minetest.is_singleplayer()
local enable_respawn = minetest.setting_getbool("enable_bed_respawn")
if enable_respawn == nil then
enable_respawn = true
end
-- helper functions
local function get_look_yaw(pos)
local n = minetest.get_node(pos)
if n.param2 == 1 then
return 7.9, n.param2
elseif n.param2 == 3 then
return 4.75, n.param2
elseif n.param2 == 0 then
return 3.15, n.param2
else
return 6.28, n.param2
end
end
local function check_in_beds(players)
local in_bed = beds.player
if not players then
players = minetest.get_connected_players()
end
for n, player in ipairs(players) do
local name = player:get_player_name()
if not in_bed[name] then
return false
end
end
return #players > 0
end
local function lay_down(player, pos, bed_pos, state, skip)
local name = player:get_player_name()
local hud_flags = player:hud_get_flags()
if not player or not name then
return
end
-- stand up
if state ~= nil and not state then
local p = beds.pos[name] or nil
if beds.player[name] ~= nil then
beds.player[name] = nil
player_in_bed = player_in_bed - 1
end
-- skip here to prevent sending player specific changes (used for leaving players)
if skip then
return
end
if p then
player:setpos(p)
end
-- physics, eye_offset, etc
player:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0})
player:set_look_yaw(math.random(1, 180)/100)
default.player_attached[name] = false
player:set_physics_override(1, 1, 1)
hud_flags.wielditem = true
default.player_set_animation(player, "stand" , 30)
-- lay down
else
beds.player[name] = 1
beds.pos[name] = pos
player_in_bed = player_in_bed + 1
-- physics, eye_offset, etc
player:set_eye_offset({x=0,y=-13,z=0}, {x=0,y=0,z=0})
local yaw, param2 = get_look_yaw(bed_pos)
player:set_look_yaw(yaw)
local dir = minetest.facedir_to_dir(param2)
local p = {x=bed_pos.x+dir.x/2,y=bed_pos.y,z=bed_pos.z+dir.z/2}
player:set_physics_override(0, 0, 0)
player:setpos(p)
default.player_attached[name] = true
hud_flags.wielditem = false
default.player_set_animation(player, "lay" , 0)
end
player:hud_set_flags(hud_flags)
end
local function update_formspecs(finished)
local ges = #minetest.get_connected_players()
local form_n = ""
local is_majority = (ges/2) < player_in_bed
if finished then
form_n = beds.formspec ..
"label[2.7,11; Good morning.]"
else
form_n = beds.formspec ..
"label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]"
if is_majority then
form_n = form_n ..
"button_exit[2,8;4,0.75;force;Force night skip]"
end
end
for name,_ in pairs(beds.player) do
minetest.show_formspec(name, "beds_form", form_n)
end
end
-- public functions
function beds.kick_players()
for name,_ in pairs(beds.player) do
local player = minetest.get_player_by_name(name)
lay_down(player, nil, nil, false)
end
end
function beds.skip_night()
minetest.set_timeofday(0.23)
beds.set_spawns()
end
function beds.on_rightclick(pos, player)
local name = player:get_player_name()
local ppos = player:getpos()
local tod = minetest.get_timeofday()
if tod > 0.2 and tod < 0.805 then
if beds.player[name] then
lay_down(player, nil, nil, false)
end
minetest.chat_send_player(name, "You can only sleep at night.")
return
end
-- move to bed
if not beds.player[name] then
lay_down(player, ppos, pos)
else
lay_down(player, nil, nil, false)
end
if not is_sp then
update_formspecs(false)
end
-- skip the night and let all players stand up
if check_in_beds() then
minetest.after(2, function()
beds.skip_night()
if not is_sp then
update_formspecs(true)
end
beds.kick_players()
end)
end
end
-- callbacks
minetest.register_on_joinplayer(function(player)
beds.read_spawns()
end)
-- respawn player at bed if enabled and valid position is found
minetest.register_on_respawnplayer(function(player)
if not enable_respawn then
return false
end
local name = player:get_player_name()
local pos = beds.spawn[name] or nil
if pos then
player:setpos(pos)
return true
end
end)
minetest.register_on_leaveplayer(function(player)
local name = player:get_player_name()
lay_down(player, nil, nil, false, true)
beds.player[name] = nil
if check_in_beds() then
minetest.after(2, function()
beds.skip_night()
update_formspecs(true)
beds.kick_players()
end)
end
end)
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "beds_form" then
return
end
if fields.quit or fields.leave then
lay_down(player, nil, nil, false)
update_formspecs(false)
end
if fields.force then
beds.skip_night()
update_formspecs(true)
beds.kick_players()
end
end)

16
mods/beds/init.lua Normal file
View File

@ -0,0 +1,16 @@
beds = {}
beds.player = {}
beds.pos = {}
beds.spawn = {}
beds.formspec = "size[8,15;true]"..
"bgcolor[#080808BB; true]"..
"button_exit[2,12;4,0.75;leave;Leave Bed]"
local modpath = minetest.get_modpath("beds")
-- load files
dofile(modpath.."/functions.lua")
dofile(modpath.."/api.lua")
dofile(modpath.."/beds.lua")
dofile(modpath.."/spawns.lua")

58
mods/beds/spawns.lua Normal file
View File

@ -0,0 +1,58 @@
local world_path = minetest.get_worldpath()
local org_file = world_path .. "/beds_spawns"
local file = world_path .. "/beds_spawns"
local bkwd = false
-- check for PA's beds mod spawns
local cf = io.open(world_path .. "/beds_player_spawns", "r")
if cf ~= nil then
io.close(cf)
file = world_path .. "/beds_player_spawns"
bkwd = true
end
function beds.read_spawns()
local spawns = beds.spawn
local input = io.open(file, "r")
if input and not bkwd then
repeat
local x = input:read("*n")
if x == nil then
break
end
local y = input:read("*n")
local z = input:read("*n")
local name = input:read("*l")
spawns[name:sub(2)] = {x = x, y = y, z = z}
until input:read(0) == nil
io.close(input)
elseif input and bkwd then
beds.spawn = minetest.deserialize(input:read("*all"))
input:close()
beds.save_spawns()
os.rename(file, file .. ".backup")
file = org_file
else
spawns = {}
end
end
function beds.save_spawns()
if not beds.spawn then
return
end
local output = io.open(org_file, "w")
for i, v in pairs(beds.spawn) do
output:write(v.x.." "..v.y.." "..v.z.." "..i.."\n")
end
io.close(output)
end
function beds.set_spawns()
for name,_ in pairs(beds.player) do
local player = minetest.get_player_by_name(name)
local p = player:getpos()
beds.spawn[name] = p
end
beds.save_spawns()
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

View File

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

3111
mods/boats/models/boat.obj Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 851 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

After

Width:  |  Height:  |  Size: 546 B

View File

@ -34,8 +34,10 @@ end
-- flowing = name of the flowing node -- flowing = name of the flowing node
-- itemname = name of the new bucket item (or nil if liquid is not takeable) -- itemname = name of the new bucket item (or nil if liquid is not takeable)
-- inventory_image = texture of the new bucket item (ignored if itemname == nil) -- inventory_image = texture of the new bucket item (ignored if itemname == nil)
-- name = text description of the bucket item
-- groups = (optional) groups of the bucket item, for example {water_bucket = 1}
-- This function can be called from any mod (that depends on bucket). -- This function can be called from any mod (that depends on bucket).
function bucket.register_liquid(source, flowing, itemname, inventory_image, name) function bucket.register_liquid(source, flowing, itemname, inventory_image, name, groups)
bucket.liquids[source] = { bucket.liquids[source] = {
source = source, source = source,
flowing = flowing, flowing = flowing,
@ -49,6 +51,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
inventory_image = inventory_image, inventory_image = inventory_image,
stack_max = 1, stack_max = 1,
liquids_pointable = true, liquids_pointable = true,
groups = groups,
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
-- Must be pointing to node -- Must be pointing to node
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" then
@ -105,7 +108,7 @@ end
minetest.register_craftitem("bucket:bucket_empty", { minetest.register_craftitem("bucket:bucket_empty", {
description = "Empty Bucket", description = "Empty Bucket",
inventory_image = "bucket.png", inventory_image = "bucket.png",
stack_max = 1, stack_max = 99,
liquids_pointable = true, liquids_pointable = true,
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
-- Must be pointing to node -- Must be pointing to node
@ -115,17 +118,41 @@ minetest.register_craftitem("bucket:bucket_empty", {
-- Check if pointing to a liquid source -- Check if pointing to a liquid source
local node = minetest.get_node(pointed_thing.under) local node = minetest.get_node(pointed_thing.under)
local liquiddef = bucket.liquids[node.name] local liquiddef = bucket.liquids[node.name]
if liquiddef ~= nil and liquiddef.itemname ~= nil and local item_count = user:get_wielded_item():get_count()
node.name == liquiddef.source then
if liquiddef ~= nil
and liquiddef.itemname ~= nil
and node.name == liquiddef.source 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
return return
end end
-- default set to return filled bucket
local giving_back = liquiddef.itemname
-- check if holding more than 1 empty bucket
if item_count > 1 then
-- if space in inventory add filled bucked, otherwise drop as item
local inv = user:get_inventory()
if inv:room_for_item("main", {name=liquiddef.itemname}) then
inv:add_item("main", liquiddef.itemname)
else
local pos = user:getpos()
pos.y = math.floor(pos.y + 0.5)
core.add_item(pos, liquiddef.itemname)
end
-- set to return empty buckets minus 1
giving_back = "bucket:bucket_empty "..tostring(item_count-1)
end
minetest.add_node(pointed_thing.under, {name="air"}) minetest.add_node(pointed_thing.under, {name="air"})
return ItemStack(liquiddef.itemname) return ItemStack(giving_back)
end end
end, end,
}) })
@ -135,7 +162,17 @@ bucket.register_liquid(
"default:water_flowing", "default:water_flowing",
"bucket:bucket_water", "bucket:bucket_water",
"bucket_water.png", "bucket_water.png",
"Water Bucket" "Water Bucket",
{water_bucket = 1}
)
bucket.register_liquid(
"default:river_water_source",
"default:river_water_flowing",
"bucket:bucket_river_water",
"bucket_river_water.png",
"River Water Bucket",
{water_bucket = 1}
) )
bucket.register_liquid( bucket.register_liquid(
@ -152,3 +189,4 @@ minetest.register_craft({
burntime = 60, burntime = 60,
replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}}, replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}},
}) })

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

View File

@ -87,6 +87,10 @@ creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]".. "label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]"..
"button[0.3,6.5;1.6,1;creative_prev;<<]".. "button[0.3,6.5;1.6,1;creative_prev;<<]"..
"button[2.7,6.5;1.6,1;creative_next;>>]".. "button[2.7,6.5;1.6,1;creative_next;>>]"..
"listring[current_player;main]"..
"listring[current_player;craft]"..
"listring[current_player;main]"..
"listring[detached:creative;main]"..
"label[5,1.5;Trash:]".. "label[5,1.5;Trash:]"..
"list[detached:creative_trash;main;5,2;1,1;]".. "list[detached:creative_trash;main;5,2;1,1;]"..
default.get_hotbar_bg(5,3.5) default.get_hotbar_bg(5,3.5)

View File

@ -24,7 +24,6 @@ Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
Cisoun's WTFPL texture pack: Cisoun's WTFPL texture pack:
default_jungletree.png default_jungletree.png
default_jungletree_top.png
default_lava.png default_lava.png
default_leaves.png default_leaves.png
default_sapling.png default_sapling.png
@ -57,12 +56,10 @@ VanessaE (WTFPL):
default_nc_front.png default_nc_front.png
default_nc_rb.png default_nc_rb.png
default_nc_side.png default_nc_side.png
default_grass_*.png
default_desert_sand.png default_desert_sand.png
default_desert_stone.png default_desert_stone.png
default_desert_stone_brick.png
default_sand.png default_sand.png
default_sandstone_brick.png default_jungletree_top.png
Calinou (CC BY-SA): Calinou (CC BY-SA):
default_brick.png default_brick.png
@ -79,7 +76,6 @@ Jordach (CC BY-SA 3.0):
PilzAdam (WTFPL): PilzAdam (WTFPL):
default_jungleleaves.png default_jungleleaves.png
default_junglesapling.png default_junglesapling.png
default_junglewood.png
default_obsidian_glass.png default_obsidian_glass.png
default_obsidian_shard.png default_obsidian_shard.png
default_mineral_gold.png default_mineral_gold.png
@ -94,7 +90,6 @@ InfinityProject (WTFPL):
Splizard (CC BY-SA 3.0): Splizard (CC BY-SA 3.0):
default_snow.png default_snow.png
default_snow_side.png default_snow_side.png
default_ice.png
default_pine_sapling.png default_pine_sapling.png
Zeg9 (CC BY-SA 3.0): Zeg9 (CC BY-SA 3.0):
@ -105,23 +100,39 @@ Zeg9 (CC BY-SA 3.0):
default_gold_block.png default_gold_block.png
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, derived from character.png by Jordach (CC BY-SA 3.0)
default_pinetree.png default_pinetree.png
default_pinetree_top.png default_pinetree_top.png
default_pinewood.png default_pinewood.png
default_sandstone_brick.png
default_obsidian_brick.png
default_river_water.png
default_river_water_source_animated.png
default_river_water_flowing_animated.png
default_acacia_leaves.png
default_acacia_sapling.png
default_acacia_tree.png
default_acacia_tree_top.png
default_acacia_wood.png
default_dry_grass.png
default_dry_grass_side.png
default_dry_grass_*.png
default_junglewood.png, derived from a texture by BlockMen (CC BY-SA 3.0)
default_grass.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_grass_side.png, derived from a texture by Philipbenr (CC BY-SA 3.0)
default_stone_brick.png, derived from a texture by Cisoun (WTFPL)
default_desert_stone_brick.png, derived from a texture by VanessaE (WTFPL)
brunob.santos (CC BY-SA 4.0): brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png default_desert_cobble.png
BlockMen (CC BY-SA 3.0): BlockMen (CC BY-SA 3.0):
default_stone_brick.png
default_wood.png default_wood.png
default_clay_brick.png default_clay_brick.png
default_iron_ingot.png default_iron_ingot.png
default_gold_ingot.png default_gold_ingot.png
default_tool_steelsword.png default_tool_steelsword.png
default_diamond.png default_diamond.png
default_diamond_block.png
default_book.png default_book.png
default_tool_*.png default_tool_*.png
default_lava_source_animated.png default_lava_source_animated.png
@ -131,6 +142,8 @@ BlockMen (CC BY-SA 3.0):
default_chest_lock.png default_chest_lock.png
default_chest_side.png default_chest_side.png
default_chest_top.png default_chest_top.png
default_mineral_mese.png
default_meselamp.png
bubble.png bubble.png
heart.png heart.png
gui_*.png gui_*.png
@ -142,9 +155,20 @@ Neuromancer (CC BY-SA 3.0):
default_dirt.png default_dirt.png
default_furnace_*.png default_furnace_*.png
Philipbenr (CC BY-SA 3.0): Gambit (WTFPL):
default_grass.png default_bronze_ingot.png
default_grass_side.png default_copper_ingot.png
default_copper_lump.png
default_iron_lump.png
default_gold_lump.png
default_clay_lump.png
default_coal.png
default_grass_*.png
default_paper.png
default_diamond_block.png
asl97 (WTFPL):
default_ice.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/
@ -185,14 +209,3 @@ Mito551 (sounds) (CC BY-SA):
default_dirt_footstep.1.ogg default_dirt_footstep.1.ogg
default_dirt_footstep.2.ogg default_dirt_footstep.2.ogg
default_glass_footstep.ogg default_glass_footstep.ogg
Gambit (WTFPL):
default_bronze_ingot.png
default_copper_ingot.png
default_copper_lump.png
default_iron_lump.png
default_gold_lump.png
default_clay_lump.png
default_coal.png
default_grass_*.png
default_paper.png

View File

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

View File

@ -15,9 +15,16 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = 'default:pinewood 4', output = 'default:pine_wood 4',
recipe = { recipe = {
{'default:pinetree'}, {'default:pine_tree'},
}
})
minetest.register_craft({
output = 'default:acacia_wood 4',
recipe = {
{'default:acacia_tree'},
} }
}) })
@ -324,7 +331,7 @@ minetest.register_craft({
}) })
minetest.register_craft({ minetest.register_craft({
output = 'default:rail 15', output = 'default:rail 24',
recipe = { recipe = {
{'default:steel_ingot', '', 'default:steel_ingot'}, {'default:steel_ingot', '', 'default:steel_ingot'},
{'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, {'default:steel_ingot', 'group:stick', 'default:steel_ingot'},
@ -564,6 +571,14 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({
output = 'default:meselamp 1',
recipe = {
{'', 'default:mese_crystal',''},
{'default:mese_crystal', 'default:glass', 'default:mese_crystal'},
}
})
minetest.register_craft({ minetest.register_craft({
output = 'default:obsidian_shard 9', output = 'default:obsidian_shard 9',
recipe = { recipe = {
@ -788,7 +803,7 @@ minetest.register_craft({
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:sapling", recipe = "group:sapling",
burntime = 10, burntime = 10,
}) })
@ -810,12 +825,6 @@ minetest.register_craft({
burntime = 370, burntime = 370,
}) })
minetest.register_craft({
type = "fuel",
recipe = "default:junglesapling",
burntime = 10,
})
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:grass_1", recipe = "default:grass_1",
@ -824,7 +833,7 @@ minetest.register_craft({
minetest.register_craft({ minetest.register_craft({
type = "fuel", type = "fuel",
recipe = "default:pine_sapling", recipe = "default:dry_grass_1",
burntime = 10, burntime = 2,
}) })

View File

@ -11,10 +11,80 @@ minetest.register_craftitem("default:paper", {
inventory_image = "default_paper.png", inventory_image = "default_paper.png",
}) })
local function book_on_use(itemstack, user, pointed_thing)
local player_name = user:get_player_name()
local data = minetest.deserialize(itemstack:get_metadata())
local title, text, owner = "", "", player_name
if data then
title, text, owner = data.title, data.text, data.owner
end
local formspec
if owner == player_name then
formspec = "size[8,8]"..default.gui_bg..
"field[0.5,1;7.5,0;title;Title:;"..
minetest.formspec_escape(title).."]"..
"textarea[0.5,1.5;7.5,7;text;Contents:;"..
minetest.formspec_escape(text).."]"..
"button_exit[2.5,7.5;3,1;save;Save]"
else
formspec = "size[8,8]"..default.gui_bg..
"label[0.5,0.5;by "..owner.."]"..
"label[0.5,0;"..minetest.formspec_escape(title).."]"..
"textarea[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text)..";]"
end
minetest.show_formspec(user:get_player_name(), "default:book", formspec)
end
minetest.register_on_player_receive_fields(function(player, form_name, fields)
if form_name ~= "default:book" or not fields.save or
fields.title == "" or fields.text == "" then
return
end
local inv = player:get_inventory()
local stack = player:get_wielded_item()
local new_stack, data
if stack:get_name() ~= "default:book_written" then
local count = stack:get_count()
if count == 1 then
stack:set_name("default:book_written")
else
stack:set_count(count - 1)
new_stack = ItemStack("default:book_written")
end
else
data = minetest.deserialize(stack:get_metadata())
end
if not data then data = {} end
data.title = fields.title
data.text = fields.text
data.owner = player:get_player_name()
local data_str = minetest.serialize(data)
if new_stack then
new_stack:set_metadata(data_str)
if inv:room_for_item("main", new_stack) then
inv:add_item("main", new_stack)
else
minetest.add_item(player:getpos(), new_stack)
end
else
stack:set_metadata(data_str)
end
player:set_wielded_item(stack)
end)
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}, groups = {book=1},
on_use = book_on_use,
})
minetest.register_craftitem("default:book_written", {
description = "Book With Text",
inventory_image = "default_book.png",
groups = {book=1, not_in_creative_inventory=1},
stack_max = 1,
on_use = book_on_use,
}) })
minetest.register_craftitem("default:coal_lump", { minetest.register_craftitem("default:coal_lump", {

View File

@ -83,27 +83,30 @@ function default.node_sound_glass_defaults(table)
return table return table
end end
-- --
-- Lavacooling -- Lavacooling
-- --
default.cool_lava_source = function(pos) default.cool_lava_source = function(pos)
minetest.set_node(pos, {name = "default:obsidian"}) minetest.set_node(pos, {name = "default:obsidian"})
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25}) minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end end
default.cool_lava_flowing = function(pos) default.cool_lava_flowing = function(pos)
minetest.set_node(pos, {name = "default:stone"}) minetest.set_node(pos, {name = "default:stone"})
minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25}) minetest.sound_play("default_cool_lava",
{pos = pos, max_hear_distance = 16, gain = 0.25})
end end
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:lava_flowing"}, nodenames = {"default:lava_flowing"},
neighbors = {"group:water"}, neighbors = {"group:water"},
interval = 1, interval = 1,
chance = 1, chance = 2,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(...)
default.cool_lava_flowing(pos, node, active_object_count, active_object_count_wider) default.cool_lava_flowing(...)
end, end,
}) })
@ -111,38 +114,72 @@ minetest.register_abm({
nodenames = {"default:lava_source"}, nodenames = {"default:lava_source"},
neighbors = {"group:water"}, neighbors = {"group:water"},
interval = 1, interval = 1,
chance = 1, chance = 2,
action = function(pos, node, active_object_count, active_object_count_wider) action = function(...)
default.cool_lava_source(pos, node, active_object_count, active_object_count_wider) default.cool_lava_source(...)
end, end,
}) })
-- --
-- Papyrus and cactus growing -- Papyrus and cactus growing
-- --
-- wrapping the functions in abm action is necessary to make overriding them possible
function default.grow_cactus(pos, node)
if node.param2 >= 4 then
return
end
pos.y = pos.y - 1
if minetest.get_item_group(minetest.get_node(pos).name, "sand") == 0 then
return
end
pos.y = pos.y + 1
local height = 0
while node.name == "default:cactus" and height < 4 do
height = height + 1
pos.y = pos.y + 1
node = minetest.get_node(pos)
end
if height == 4 or node.name ~= "air" then
return
end
minetest.set_node(pos, {name = "default:cactus"})
return true
end
function default.grow_papyrus(pos, node)
pos.y = pos.y - 1
local name = minetest.get_node(pos).name
if name ~= "default:dirt_with_grass" and name ~= "default:dirt" then
return
end
if not minetest.find_node_near(pos, 3, {"group:water"}) then
return
end
pos.y = pos.y + 1
local height = 0
while node.name == "default:papyrus" and height < 4 do
height = height + 1
pos.y = pos.y + 1
node = minetest.get_node(pos)
end
if height == 4 or node.name ~= "air" then
return
end
minetest.set_node(pos, {name = "default:papyrus"})
return true
end
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:cactus"}, nodenames = {"default:cactus"},
neighbors = {"group:sand"}, neighbors = {"group:sand"},
interval = 50, interval = 50,
chance = 20, chance = 20,
action = function(pos, node) action = function(...)
pos.y = pos.y-1 default.grow_cactus(...)
local name = minetest.get_node(pos).name
if minetest.get_item_group(name, "sand") ~= 0 then
pos.y = pos.y+1
local height = 0
while minetest.get_node(pos).name == "default:cactus" and height < 4 do
height = height+1
pos.y = pos.y+1
end end
if height < 4 then
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="default:cactus"})
end
end
end
end,
}) })
minetest.register_abm({ minetest.register_abm({
@ -150,28 +187,12 @@ minetest.register_abm({
neighbors = {"default:dirt", "default:dirt_with_grass"}, neighbors = {"default:dirt", "default:dirt_with_grass"},
interval = 50, interval = 50,
chance = 20, chance = 20,
action = function(pos, node) action = function(...)
pos.y = pos.y-1 default.grow_papyrus(...)
local name = minetest.get_node(pos).name
if name == "default:dirt" or name == "default:dirt_with_grass" then
if minetest.find_node_near(pos, 3, {"group:water"}) == nil then
return
end end
pos.y = pos.y+1
local height = 0
while minetest.get_node(pos).name == "default:papyrus" and height < 4 do
height = height+1
pos.y = pos.y+1
end
if height < 4 then
if minetest.get_node(pos).name == "air" then
minetest.set_node(pos, {name="default:papyrus"})
end
end
end
end,
}) })
-- --
-- dig upwards -- dig upwards
-- --
@ -185,6 +206,7 @@ function default.dig_up(pos, node, digger)
end end
end end
-- --
-- Leafdecay -- Leafdecay
-- --
@ -233,8 +255,10 @@ 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
if n.name == "ignore" or (reg and reg.groups.tree and reg.groups.tree ~= 0) then -- work at the border of the active area
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
@ -248,7 +272,8 @@ 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
@ -279,6 +304,7 @@ minetest.register_abm({
end end
}) })
-- --
-- Grass growing -- Grass growing
-- --
@ -291,9 +317,9 @@ minetest.register_abm({
local above = {x = pos.x, y = pos.y + 1, z = pos.z} local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name] local nodedef = minetest.registered_nodes[name]
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and
and nodedef.liquidtype == "none" nodedef.liquidtype == "none" and
and (minetest.get_node_light(above) or 0) >= 13 then (minetest.get_node_light(above) or 0) >= 13 then
if name == "default:snow" or name == "default:snowblock" then if name == "default:snow" or name == "default:snowblock" then
minetest.set_node(pos, {name = "default:dirt_with_snow"}) minetest.set_node(pos, {name = "default:dirt_with_snow"})
else else
@ -304,17 +330,18 @@ minetest.register_abm({
}) })
minetest.register_abm({ minetest.register_abm({
nodenames = {"default:dirt_with_grass"}, nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"},
interval = 2, interval = 2,
chance = 20, chance = 20,
action = function(pos, node) action = function(pos, node)
local above = {x = pos.x, y = pos.y + 1, z = pos.z} local above = {x = pos.x, y = pos.y + 1, z = pos.z}
local name = minetest.get_node(above).name local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name] local nodedef = minetest.registered_nodes[name]
if name ~= "ignore" and nodedef if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or
and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") nodedef.paramtype == "light") and
and nodedef.liquidtype == "none") then nodedef.liquidtype == "none") then
minetest.set_node(pos, {name = "default:dirt"}) minetest.set_node(pos, {name = "default:dirt"})
end end
end end
}) })

View File

@ -18,6 +18,10 @@ local function active_formspec(fuel_percent, item_percent)
"list[current_name;dst;4.75,0.96;2,2;]".. "list[current_name;dst;4.75,0.96;2,2;]"..
"list[current_player;main;0,4.25;8,1;]".. "list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]".. "list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25) default.get_hotbar_bg(0, 4.25)
return formspec return formspec
end end
@ -34,6 +38,10 @@ local inactive_formspec =
"list[current_name;dst;4.75,0.96;2,2;]".. "list[current_name;dst;4.75,0.96;2,2;]"..
"list[current_player;main;0,4.25;8,1;]".. "list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]".. "list[current_player;main;0,5.5;8,3;8]"..
"listring[current_name;dst]"..
"listring[current_player;main]"..
"listring[current_name;src]"..
"listring[current_player;main]"..
default.get_hotbar_bg(0, 4.25) default.get_hotbar_bg(0, 4.25)
-- --

View File

@ -30,6 +30,8 @@ default.gui_survival_form = "size[8,8.5]"..
"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]".. "image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"listring[current_player;main]"..
"listring[current_player;craft]"..
default.get_hotbar_bg(0,4.25) default.get_hotbar_bg(0,4.25)
-- Load files -- Load files

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,15 @@
-- mods/default/nodes.lua -- mods/default/nodes.lua
--[[ Node name convention:
Although many node names are in combined-word form, the required form for new
node names is words separated by underscores. If both forms are used in written
language (for example pinewood and pine wood) the underscore form should be used.
--]]
--[[ Index: --[[ Index:
Stone Stone
@ -28,6 +38,7 @@ Soft / Non-Stone
default:dirt default:dirt
default:dirt_with_grass default:dirt_with_grass
default:dirt_with_grass_footsteps default:dirt_with_grass_footsteps
default:dirt_with_dry_grass
default:dirt_with_snow default:dirt_with_snow
default:sand default:sand
@ -57,11 +68,16 @@ default:junglewood
default:jungleleaves default:jungleleaves
default:junglesapling default:junglesapling
default:pinetree default:pine_tree
default:pinewood default:pine_wood
default:pine_needles default:pine_needles
default:pine_sapling default:pine_sapling
default:acacia_tree
default:acacia_wood
default:acacia_leaves
default:acacia_sapling
Ores Ores
---- ----
(1. In stone 2. Block) (1. In stone 2. Block)
@ -91,12 +107,19 @@ default:cactus
default:papyrus default:papyrus
default:dry_shrub default:dry_shrub
default:junglegrass default:junglegrass
default:grass_1 default:grass_1
default:grass_2 default:grass_2
default:grass_3 default:grass_3
default:grass_4 default:grass_4
default:grass_5 default:grass_5
default:dry_grass_1
default:dry_grass_2
default:dry_grass_3
default:dry_grass_4
default:dry_grass_5
Liquids Liquids
------- -------
(1. Source 2. Flowing) (1. Source 2. Flowing)
@ -104,6 +127,9 @@ Liquids
default:water_source default:water_source
default:water_flowing default:water_flowing
default:river_water_source
default:river_water_flowing
default:lava_source default:lava_source
default:lava_flowing default:lava_flowing
@ -127,6 +153,8 @@ default:rail
default:brick default:brick
default:meselamp
Misc Misc
---- ----
default:cloud default:cloud
@ -142,7 +170,6 @@ default:nyancat_rainbow
minetest.register_node("default:stone", { minetest.register_node("default:stone", {
description = "Stone", description = "Stone",
tiles = {"default_stone.png"}, tiles = {"default_stone.png"},
is_ground_content = true,
groups = {cracky=3, stone=1}, groups = {cracky=3, stone=1},
drop = 'default:cobble', drop = 'default:cobble',
legacy_mineral = true, legacy_mineral = true,
@ -152,7 +179,7 @@ minetest.register_node("default:stone", {
minetest.register_node("default:cobble", { minetest.register_node("default:cobble", {
description = "Cobblestone", description = "Cobblestone",
tiles = {"default_cobble.png"}, tiles = {"default_cobble.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=3, stone=2}, groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -160,6 +187,7 @@ minetest.register_node("default:cobble", {
minetest.register_node("default:stonebrick", { minetest.register_node("default:stonebrick", {
description = "Stone Brick", description = "Stone Brick",
tiles = {"default_stone_brick.png"}, tiles = {"default_stone_brick.png"},
is_ground_content = false,
groups = {cracky=2, stone=1}, groups = {cracky=2, stone=1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -167,7 +195,7 @@ minetest.register_node("default:stonebrick", {
minetest.register_node("default:mossycobble", { minetest.register_node("default:mossycobble", {
description = "Mossy Cobblestone", description = "Mossy Cobblestone",
tiles = {"default_mossycobble.png"}, tiles = {"default_mossycobble.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=3, stone=1}, groups = {cracky=3, stone=1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -177,7 +205,6 @@ minetest.register_node("default:mossycobble", {
minetest.register_node("default:desert_stone", { minetest.register_node("default:desert_stone", {
description = "Desert Stone", description = "Desert Stone",
tiles = {"default_desert_stone.png"}, tiles = {"default_desert_stone.png"},
is_ground_content = true,
groups = {cracky=3, stone=1}, groups = {cracky=3, stone=1},
drop = 'default:desert_cobble', drop = 'default:desert_cobble',
legacy_mineral = true, legacy_mineral = true,
@ -187,7 +214,7 @@ minetest.register_node("default:desert_stone", {
minetest.register_node("default:desert_cobble", { minetest.register_node("default:desert_cobble", {
description = "Desert Cobblestone", description = "Desert Cobblestone",
tiles = {"default_desert_cobble.png"}, tiles = {"default_desert_cobble.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=3, stone=2}, groups = {cracky=3, stone=2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -195,6 +222,7 @@ minetest.register_node("default:desert_cobble", {
minetest.register_node("default:desert_stonebrick", { minetest.register_node("default:desert_stonebrick", {
description = "Desert Stone Brick", description = "Desert Stone Brick",
tiles = {"default_desert_stone_brick.png"}, tiles = {"default_desert_stone_brick.png"},
is_ground_content = false,
groups = {cracky=2, stone=1}, groups = {cracky=2, stone=1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -204,7 +232,6 @@ minetest.register_node("default:desert_stonebrick", {
minetest.register_node("default:sandstone", { minetest.register_node("default:sandstone", {
description = "Sandstone", description = "Sandstone",
tiles = {"default_sandstone.png"}, tiles = {"default_sandstone.png"},
is_ground_content = true,
groups = {crumbly=2,cracky=3}, groups = {crumbly=2,cracky=3},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -212,7 +239,7 @@ minetest.register_node("default:sandstone", {
minetest.register_node("default:sandstonebrick", { minetest.register_node("default:sandstonebrick", {
description = "Sandstone Brick", description = "Sandstone Brick",
tiles = {"default_sandstone_brick.png"}, tiles = {"default_sandstone_brick.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=2}, groups = {cracky=2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -222,7 +249,6 @@ minetest.register_node("default:sandstonebrick", {
minetest.register_node("default:obsidian", { minetest.register_node("default:obsidian", {
description = "Obsidian", description = "Obsidian",
tiles = {"default_obsidian.png"}, tiles = {"default_obsidian.png"},
is_ground_content = true,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
groups = {cracky=1,level=2}, groups = {cracky=1,level=2},
}) })
@ -230,6 +256,7 @@ minetest.register_node("default:obsidian", {
minetest.register_node("default:obsidianbrick", { minetest.register_node("default:obsidianbrick", {
description = "Obsidian Brick", description = "Obsidian Brick",
tiles = {"default_obsidian_brick.png"}, tiles = {"default_obsidian_brick.png"},
is_ground_content = false,
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
groups = {cracky=1,level=2}, groups = {cracky=1,level=2},
}) })
@ -241,15 +268,15 @@ minetest.register_node("default:obsidianbrick", {
minetest.register_node("default:dirt", { minetest.register_node("default:dirt", {
description = "Dirt", description = "Dirt",
tiles = {"default_dirt.png"}, tiles = {"default_dirt.png"},
is_ground_content = true,
groups = {crumbly=3,soil=1}, groups = {crumbly=3,soil=1},
sounds = default.node_sound_dirt_defaults(), sounds = default.node_sound_dirt_defaults(),
}) })
minetest.register_node("default:dirt_with_grass", { minetest.register_node("default:dirt_with_grass", {
description = "Dirt with Grass", description = "Dirt with Grass",
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, tiles = {"default_grass.png", "default_dirt.png",
is_ground_content = true, {name = "default_dirt.png^default_grass_side.png",
tileable_vertical = false}},
groups = {crumbly=3,soil=1}, groups = {crumbly=3,soil=1},
drop = 'default:dirt', drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
@ -259,8 +286,9 @@ minetest.register_node("default:dirt_with_grass", {
minetest.register_node("default:dirt_with_grass_footsteps", { minetest.register_node("default:dirt_with_grass_footsteps", {
description = "Dirt with Grass and Footsteps", description = "Dirt with Grass and Footsteps",
tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
is_ground_content = true, {name = "default_dirt.png^default_grass_side.png",
tileable_vertical = false}},
groups = {crumbly=3,soil=1,not_in_creative_inventory=1}, groups = {crumbly=3,soil=1,not_in_creative_inventory=1},
drop = 'default:dirt', drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
@ -268,10 +296,24 @@ minetest.register_node("default:dirt_with_grass_footsteps", {
}), }),
}) })
minetest.register_node("default:dirt_with_dry_grass", {
description = "Dirt with Dry Grass",
tiles = {"default_dry_grass.png",
"default_dirt.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({
footstep = {name = "default_grass_footstep", gain = 0.4},
}),
})
minetest.register_node("default:dirt_with_snow", { minetest.register_node("default:dirt_with_snow", {
description = "Dirt with Snow", description = "Dirt with Snow",
tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"}, tiles = {"default_snow.png", "default_dirt.png",
is_ground_content = true, {name = "default_dirt.png^default_snow_side.png",
tileable_vertical = false}},
groups = {crumbly=3,soil=1}, groups = {crumbly=3,soil=1},
drop = 'default:dirt', drop = 'default:dirt',
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
@ -280,11 +322,9 @@ minetest.register_node("default:dirt_with_snow", {
}) })
minetest.register_node("default:sand", { minetest.register_node("default:sand", {
description = "Sand", description = "Sand",
tiles = {"default_sand.png"}, tiles = {"default_sand.png"},
is_ground_content = true,
groups = {crumbly=3, falling_node=1, sand=1}, groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(), sounds = default.node_sound_sand_defaults(),
}) })
@ -292,7 +332,6 @@ minetest.register_node("default:sand", {
minetest.register_node("default:desert_sand", { minetest.register_node("default:desert_sand", {
description = "Desert Sand", description = "Desert Sand",
tiles = {"default_desert_sand.png"}, tiles = {"default_desert_sand.png"},
is_ground_content = true,
groups = {crumbly=3, falling_node=1, sand=1}, groups = {crumbly=3, falling_node=1, sand=1},
sounds = default.node_sound_sand_defaults(), sounds = default.node_sound_sand_defaults(),
}) })
@ -302,7 +341,6 @@ minetest.register_node("default:desert_sand", {
minetest.register_node("default:gravel", { minetest.register_node("default:gravel", {
description = "Gravel", description = "Gravel",
tiles = {"default_gravel.png"}, tiles = {"default_gravel.png"},
is_ground_content = true,
groups = {crumbly=2, falling_node=1}, groups = {crumbly=2, falling_node=1},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.5}, footstep = {name="default_gravel_footstep", gain=0.5},
@ -315,7 +353,6 @@ minetest.register_node("default:gravel", {
minetest.register_node("default:clay", { minetest.register_node("default:clay", {
description = "Clay", description = "Clay",
tiles = {"default_clay.png"}, tiles = {"default_clay.png"},
is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3},
drop = 'default:clay_lump 4', drop = 'default:clay_lump 4',
sounds = default.node_sound_dirt_defaults(), sounds = default.node_sound_dirt_defaults(),
@ -328,14 +365,13 @@ minetest.register_node("default:snow", {
tiles = {"default_snow.png"}, tiles = {"default_snow.png"},
inventory_image = "default_snowball.png", inventory_image = "default_snowball.png",
wield_image = "default_snowball.png", wield_image = "default_snowball.png",
is_ground_content = true,
paramtype = "light", paramtype = "light",
buildable_to = true, buildable_to = true,
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = { fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5}, {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
}, },
}, },
groups = {crumbly = 3, falling_node = 1}, groups = {crumbly = 3, falling_node = 1},
@ -351,12 +387,11 @@ minetest.register_node("default:snow", {
end end
end, end,
}) })
minetest.register_alias("snow", "default:snow")
minetest.register_node("default:snowblock", { minetest.register_node("default:snowblock", {
description = "Snow Block", description = "Snow Block",
tiles = {"default_snow.png"}, tiles = {"default_snow.png"},
is_ground_content = true,
groups = {crumbly=3}, groups = {crumbly=3},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_snow_footstep", gain=0.25}, footstep = {name="default_snow_footstep", gain=0.25},
@ -369,7 +404,7 @@ minetest.register_node("default:snowblock", {
minetest.register_node("default:ice", { minetest.register_node("default:ice", {
description = "Ice", description = "Ice",
tiles = {"default_ice.png"}, tiles = {"default_ice.png"},
is_ground_content = true, is_ground_content = false,
paramtype = "light", paramtype = "light",
groups = {cracky=3}, groups = {cracky=3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
@ -393,6 +428,7 @@ minetest.register_node("default:tree", {
minetest.register_node("default:wood", { minetest.register_node("default:wood", {
description = "Wooden Planks", description = "Wooden Planks",
tiles = {"default_wood.png"}, tiles = {"default_wood.png"},
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
@ -405,8 +441,8 @@ minetest.register_node("default:sapling", {
inventory_image = "default_sapling.png", inventory_image = "default_sapling.png",
wield_image = "default_sapling.png", wield_image = "default_sapling.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
is_ground_content = true,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3}
@ -421,6 +457,7 @@ minetest.register_node("default:leaves", {
waving = 1, waving = 1,
visual_scale = 1.3, visual_scale = 1.3,
tiles = {"default_leaves.png"}, tiles = {"default_leaves.png"},
special_tiles = {"default_leaves_simple.png"},
paramtype = "light", paramtype = "light",
is_ground_content = false, is_ground_content = false,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
@ -453,13 +490,13 @@ minetest.register_node("default:apple", {
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
is_ground_content = true, is_ground_content = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2} 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(1), on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer, itemstack) after_place_node = function(pos, placer, itemstack)
@ -485,6 +522,7 @@ minetest.register_node("default:jungletree", {
minetest.register_node("default:junglewood", { minetest.register_node("default:junglewood", {
description = "Junglewood Planks", description = "Junglewood Planks",
tiles = {"default_junglewood.png"}, tiles = {"default_junglewood.png"},
is_ground_content = false,
groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
@ -495,6 +533,7 @@ minetest.register_node("default:jungleleaves", {
waving = 1, waving = 1,
visual_scale = 1.3, visual_scale = 1.3,
tiles = {"default_jungleleaves.png"}, tiles = {"default_jungleleaves.png"},
special_tiles = {"default_jungleleaves_simple.png"},
paramtype = "light", paramtype = "light",
is_ground_content = false, is_ground_content = false,
groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, groups = {snappy=3, leafdecay=3, flammable=2, leaves=1},
@ -526,6 +565,7 @@ minetest.register_node("default:junglesapling", {
inventory_image = "default_junglesapling.png", inventory_image = "default_junglesapling.png",
wield_image = "default_junglesapling.png", wield_image = "default_junglesapling.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -537,9 +577,10 @@ minetest.register_node("default:junglesapling", {
minetest.register_node("default:pinetree", { minetest.register_node("default:pine_tree", {
description = "Pine Tree", description = "Pine Tree",
tiles = {"default_pinetree_top.png", "default_pinetree_top.png", "default_pinetree.png"}, tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
"default_pine_tree.png"},
paramtype2 = "facedir", paramtype2 = "facedir",
is_ground_content = false, is_ground_content = false,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2}, groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
@ -548,9 +589,10 @@ minetest.register_node("default:pinetree", {
on_place = minetest.rotate_node on_place = minetest.rotate_node
}) })
minetest.register_node("default:pinewood", { minetest.register_node("default:pine_wood", {
description = "Pinewood Planks", description = "Pine Wood Planks",
tiles = {"default_pinewood.png"}, tiles = {"default_pine_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
@ -567,16 +609,8 @@ minetest.register_node("default:pine_needles",{
drop = { drop = {
max_items = 1, max_items = 1,
items = { items = {
{ {items = {"default:pine_sapling"}, rarity = 20},
-- player will get sapling with 1/20 chance {items = {"default:pine_needles"}}
items = {"default:pine_sapling"},
rarity = 20,
},
{
-- player will get leaves only if he get no saplings,
-- this is because max_items is 1
items = {"default:pine_needles"},
}
} }
}, },
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -592,13 +626,73 @@ minetest.register_node("default:pine_sapling", {
inventory_image = "default_pine_sapling.png", inventory_image = "default_pine_sapling.png",
wield_image = "default_pine_sapling.png", wield_image = "default_pine_sapling.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
is_ground_content = true,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} 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:acacia_tree", {
description = "Acacia Tree",
tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
"default_acacia_tree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("default:acacia_wood", {
description = "Acacia Wood Planks",
tiles = {"default_acacia_wood.png"},
is_ground_content = false,
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("default:acacia_leaves", {
description = "Acacia Leaves",
drawtype = "allfaces_optional",
visual_scale = 1.3,
tiles = {"default_acacia_leaves.png"},
paramtype = "light",
is_ground_content = false,
groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
drop = {
max_items = 1,
items = {
{items = {"default:acacia_sapling"}, rarity = 20},
{items = {"default:acacia_leaves"}}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
minetest.register_node("default:acacia_sapling", {
description = "Acacia Tree Sapling",
drawtype = "plantlike",
visual_scale = 1.0,
tiles = {"default_acacia_sapling.png"},
inventory_image = "default_acacia_sapling.png",
wield_image = "default_acacia_sapling.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
selection_box = {
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},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
}) })
@ -609,7 +703,6 @@ minetest.register_node("default:pine_sapling", {
minetest.register_node("default:stone_with_coal", { minetest.register_node("default:stone_with_coal", {
description = "Coal Ore", description = "Coal Ore",
tiles = {"default_stone.png^default_mineral_coal.png"}, tiles = {"default_stone.png^default_mineral_coal.png"},
is_ground_content = true,
groups = {cracky=3}, groups = {cracky=3},
drop = 'default:coal_lump', drop = 'default:coal_lump',
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -618,7 +711,7 @@ minetest.register_node("default:stone_with_coal", {
minetest.register_node("default:coalblock", { minetest.register_node("default:coalblock", {
description = "Coal Block", description = "Coal Block",
tiles = {"default_coal_block.png"}, tiles = {"default_coal_block.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=3}, groups = {cracky=3},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -628,7 +721,6 @@ minetest.register_node("default:coalblock", {
minetest.register_node("default:stone_with_iron", { minetest.register_node("default:stone_with_iron", {
description = "Iron Ore", description = "Iron Ore",
tiles = {"default_stone.png^default_mineral_iron.png"}, tiles = {"default_stone.png^default_mineral_iron.png"},
is_ground_content = true,
groups = {cracky=2}, groups = {cracky=2},
drop = 'default:iron_lump', drop = 'default:iron_lump',
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -637,7 +729,7 @@ minetest.register_node("default:stone_with_iron", {
minetest.register_node("default:steelblock", { minetest.register_node("default:steelblock", {
description = "Steel Block", description = "Steel Block",
tiles = {"default_steel_block.png"}, tiles = {"default_steel_block.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=1,level=2}, groups = {cracky=1,level=2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -647,7 +739,6 @@ minetest.register_node("default:steelblock", {
minetest.register_node("default:stone_with_copper", { minetest.register_node("default:stone_with_copper", {
description = "Copper Ore", description = "Copper Ore",
tiles = {"default_stone.png^default_mineral_copper.png"}, tiles = {"default_stone.png^default_mineral_copper.png"},
is_ground_content = true,
groups = {cracky=2}, groups = {cracky=2},
drop = 'default:copper_lump', drop = 'default:copper_lump',
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -656,7 +747,7 @@ minetest.register_node("default:stone_with_copper", {
minetest.register_node("default:copperblock", { minetest.register_node("default:copperblock", {
description = "Copper Block", description = "Copper Block",
tiles = {"default_copper_block.png"}, tiles = {"default_copper_block.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=1,level=2}, groups = {cracky=1,level=2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -664,7 +755,7 @@ minetest.register_node("default:copperblock", {
minetest.register_node("default:bronzeblock", { minetest.register_node("default:bronzeblock", {
description = "Bronze Block", description = "Bronze Block",
tiles = {"default_bronze_block.png"}, tiles = {"default_bronze_block.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=1,level=2}, groups = {cracky=1,level=2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -674,27 +765,28 @@ minetest.register_node("default:bronzeblock", {
minetest.register_node("default:stone_with_mese", { minetest.register_node("default:stone_with_mese", {
description = "Mese Ore", description = "Mese Ore",
tiles = {"default_stone.png^default_mineral_mese.png"}, tiles = {"default_stone.png^default_mineral_mese.png"},
is_ground_content = true, paramtype = "light",
groups = {cracky = 1}, groups = {cracky = 1},
drop = "default:mese_crystal", drop = "default:mese_crystal",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
light_source = 1,
}) })
minetest.register_node("default:mese", { minetest.register_node("default:mese", {
description = "Mese Block", description = "Mese Block",
tiles = {"default_mese_block.png"}, tiles = {"default_mese_block.png"},
is_ground_content = true, paramtype = "light",
groups = {cracky = 1, level = 2}, groups = {cracky = 1, level = 2},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
light_source = 3,
}) })
minetest.register_alias("default:mese_block", "default:mese")
minetest.register_node("default:stone_with_gold", { minetest.register_node("default:stone_with_gold", {
description = "Gold Ore", description = "Gold Ore",
tiles = {"default_stone.png^default_mineral_gold.png"}, tiles = {"default_stone.png^default_mineral_gold.png"},
is_ground_content = true,
groups = {cracky=2}, groups = {cracky=2},
drop = "default:gold_lump", drop = "default:gold_lump",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -703,7 +795,7 @@ minetest.register_node("default:stone_with_gold", {
minetest.register_node("default:goldblock", { minetest.register_node("default:goldblock", {
description = "Gold Block", description = "Gold Block",
tiles = {"default_gold_block.png"}, tiles = {"default_gold_block.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=1}, groups = {cracky=1},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -713,7 +805,6 @@ minetest.register_node("default:goldblock", {
minetest.register_node("default:stone_with_diamond", { minetest.register_node("default:stone_with_diamond", {
description = "Diamond Ore", description = "Diamond Ore",
tiles = {"default_stone.png^default_mineral_diamond.png"}, tiles = {"default_stone.png^default_mineral_diamond.png"},
is_ground_content = true,
groups = {cracky=1}, groups = {cracky=1},
drop = "default:diamond", drop = "default:diamond",
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
@ -722,7 +813,7 @@ minetest.register_node("default:stone_with_diamond", {
minetest.register_node("default:diamondblock", { minetest.register_node("default:diamondblock", {
description = "Diamond Block", description = "Diamond Block",
tiles = {"default_diamond_block.png"}, tiles = {"default_diamond_block.png"},
is_ground_content = true, is_ground_content = false,
groups = {cracky=1,level=3}, groups = {cracky=1,level=3},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
@ -735,7 +826,6 @@ minetest.register_node("default:cactus", {
description = "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", paramtype2 = "facedir",
is_ground_content = true,
groups = {snappy=1,choppy=3,flammable=2}, groups = {snappy=1,choppy=3,flammable=2},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node, on_place = minetest.rotate_node,
@ -752,8 +842,8 @@ minetest.register_node("default:papyrus", {
inventory_image = "default_papyrus.png", inventory_image = "default_papyrus.png",
wield_image = "default_papyrus.png", wield_image = "default_papyrus.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
is_ground_content = true,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
@ -775,8 +865,8 @@ minetest.register_node("default:dry_shrub", {
inventory_image = "default_dry_shrub.png", inventory_image = "default_dry_shrub.png",
wield_image = "default_dry_shrub.png", wield_image = "default_dry_shrub.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
is_ground_content = true,
buildable_to = true, buildable_to = true,
groups = {snappy=3,flammable=3,attached_node=1}, groups = {snappy=3,flammable=3,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -795,9 +885,9 @@ minetest.register_node("default:junglegrass", {
inventory_image = "default_junglegrass.png", inventory_image = "default_junglegrass.png",
wield_image = "default_junglegrass.png", wield_image = "default_junglegrass.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
is_ground_content = true,
groups = {snappy=3,flammable=2,flora=1,attached_node=1}, groups = {snappy=3,flammable=2,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
selection_box = { selection_box = {
@ -815,8 +905,8 @@ minetest.register_node("default:grass_1", {
inventory_image = "default_grass_3.png", inventory_image = "default_grass_3.png",
wield_image = "default_grass_3.png", wield_image = "default_grass_3.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
is_ground_content = true,
buildable_to = true, buildable_to = true,
groups = {snappy=3,flammable=3,flora=1,attached_node=1}, groups = {snappy=3,flammable=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
@ -842,9 +932,9 @@ for i=2,5 do
inventory_image = "default_grass_"..i..".png", inventory_image = "default_grass_"..i..".png",
wield_image = "default_grass_"..i..".png", wield_image = "default_grass_"..i..".png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
buildable_to = true, buildable_to = true,
is_ground_content = true,
drop = "default:grass_1", 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(), sounds = default.node_sound_leaves_defaults(),
@ -855,6 +945,54 @@ for i=2,5 do
}) })
end end
minetest.register_node("default:dry_grass_1", {
description = "Dry Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"default_dry_grass_1.png"},
inventory_image = "default_dry_grass_3.png",
wield_image = "default_dry_grass_3.png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
groups = {snappy=3,flammable=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
on_place = function(itemstack, placer, pointed_thing)
-- 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()))
end,
})
for i=2,5 do
minetest.register_node("default:dry_grass_"..i, {
description = "Dry Grass",
drawtype = "plantlike",
waving = 1,
tiles = {"default_dry_grass_"..i..".png"},
inventory_image = "default_dry_grass_"..i..".png",
wield_image = "default_dry_grass_"..i..".png",
paramtype = "light",
sunlight_propagates = true,
walkable = false,
buildable_to = true,
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 = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
end
-- --
-- Liquids -- Liquids
-- --
@ -893,13 +1031,14 @@ minetest.register_node("default:water_source", {
pointable = false, pointable = false,
diggable = false, diggable = false,
buildable_to = true, buildable_to = true,
is_ground_content = false,
drop = "", drop = "",
drowning = 1, drowning = 1,
liquidtype = "source", liquidtype = "source",
liquid_alternative_flowing = "default:water_flowing", liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source", liquid_alternative_source = "default:water_source",
liquid_viscosity = 1, liquid_viscosity = 1,
post_effect_color = {a=64, r=100, g=100, b=200}, post_effect_color = {a=120, r=30, g=60, b=90},
groups = {water=3, liquid=3, puts_out_fire=1}, groups = {water=3, liquid=3, puts_out_fire=1},
}) })
@ -937,13 +1076,108 @@ minetest.register_node("default:water_flowing", {
pointable = false, pointable = false,
diggable = false, diggable = false,
buildable_to = true, buildable_to = true,
is_ground_content = false,
drop = "", drop = "",
drowning = 1, drowning = 1,
liquidtype = "flowing", liquidtype = "flowing",
liquid_alternative_flowing = "default:water_flowing", liquid_alternative_flowing = "default:water_flowing",
liquid_alternative_source = "default:water_source", liquid_alternative_source = "default:water_source",
liquid_viscosity = 1, liquid_viscosity = 1,
post_effect_color = {a=64, r=100, g=100, b=200}, post_effect_color = {a=120, r=30, g=60, b=90},
groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1},
})
minetest.register_node("default:river_water_source", {
description = "River Water Source",
inventory_image = minetest.inventorycube("default_river_water.png"),
drawtype = "liquid",
tiles = {
{
name = "default_river_water_source_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
special_tiles = {
{
name = "default_river_water_source_animated.png",
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
backface_culling = false,
},
},
alpha = 160,
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "source",
liquid_alternative_flowing = "default:river_water_flowing",
liquid_alternative_source = "default:river_water_source",
liquid_viscosity = 1,
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a=120, r=30, g=76, b=90},
groups = {water=3, liquid=3, puts_out_fire=1},
})
minetest.register_node("default:river_water_flowing", {
description = "Flowing River Water",
inventory_image = minetest.inventorycube("default_river_water.png"),
drawtype = "flowingliquid",
tiles = {"default_river_water.png"},
special_tiles = {
{
name = "default_river_water_flowing_animated.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.8,
},
},
{
name = "default_river_water_flowing_animated.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 0.8,
},
},
},
alpha = 160,
paramtype = "light",
paramtype2 = "flowingliquid",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "flowing",
liquid_alternative_flowing = "default:river_water_flowing",
liquid_alternative_source = "default:river_water_source",
liquid_viscosity = 1,
liquid_renewable = false,
liquid_range = 2,
post_effect_color = {a=120, r=30, g=76, b=90},
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},
}) })
@ -983,6 +1217,7 @@ minetest.register_node("default:lava_source", {
pointable = false, pointable = false,
diggable = false, diggable = false,
buildable_to = true, buildable_to = true,
is_ground_content = false,
drop = "", drop = "",
drowning = 1, drowning = 1,
liquidtype = "source", liquidtype = "source",
@ -1029,6 +1264,7 @@ minetest.register_node("default:lava_flowing", {
pointable = false, pointable = false,
diggable = false, diggable = false,
buildable_to = true, buildable_to = true,
is_ground_content = false,
drop = "", drop = "",
drowning = 1, drowning = 1,
liquidtype = "flowing", liquidtype = "flowing",
@ -1106,6 +1342,8 @@ local chest_formspec =
"list[current_name;main;0,0.3;8,4;]".. "list[current_name;main;0,0.3;8,4;]"..
"list[current_player;main;0,4.85;8,1;]".. "list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]".. "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,4.85)
local function get_locked_chest_formspec(pos) local function get_locked_chest_formspec(pos)
@ -1118,6 +1356,8 @@ local function get_locked_chest_formspec(pos)
"list[nodemeta:".. spos .. ";main;0,0.3;8,4;]".. "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]"..
"list[current_player;main;0,4.85;8,1;]".. "list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]".. "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,4.85)
return formspec return formspec
end end
@ -1234,6 +1474,7 @@ minetest.register_node("default:chest_locked", {
) )
end end
end, end,
on_blast = function() end,
}) })
@ -1246,6 +1487,8 @@ local bookshelf_formspec =
"list[context;books;0,0.3;8,2;]".. "list[context;books;0,0.3;8,2;]"..
"list[current_player;main;0,2.85;8,1;]".. "list[current_player;main;0,2.85;8,1;]"..
"list[current_player;main;0,4.08;8,3;8]".. "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,2.85)
minetest.register_node("default:bookshelf", { minetest.register_node("default:bookshelf", {
@ -1287,7 +1530,8 @@ minetest.register_node("default:bookshelf", {
local stack = inv:get_stack(from_list, from_index) local stack = inv:get_stack(from_list, from_index)
local to_stack = inv:get_stack(to_list, to_index) local to_stack = inv:get_stack(to_list, to_index)
if to_list == "books" then if to_list == "books" then
if stack:get_name() == "default:book" and to_stack:is_empty() then if minetest.get_item_group(stack:get_name(), "book") ~= 0
and to_stack:is_empty() then
return 1 return 1
else else
return 0 return 0
@ -1361,6 +1605,7 @@ minetest.register_node("default:ladder", {
wield_image = "default_ladder.png", wield_image = "default_ladder.png",
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = false, walkable = false,
climbable = true, climbable = true,
is_ground_content = false, is_ground_content = false,
@ -1383,6 +1628,7 @@ minetest.register_node("default:fence_wood", {
inventory_image = fence_texture, inventory_image = fence_texture,
wield_image = fence_texture, wield_image = fence_texture,
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
is_ground_content = false, is_ground_content = false,
selection_box = { selection_box = {
type = "fixed", type = "fixed",
@ -1426,6 +1672,7 @@ minetest.register_node("default:rail", {
inventory_image = "default_rail.png", inventory_image = "default_rail.png",
wield_image = "default_rail.png", wield_image = "default_rail.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true,
walkable = false, walkable = false,
is_ground_content = false, is_ground_content = false,
selection_box = { selection_box = {
@ -1433,7 +1680,7 @@ minetest.register_node("default:rail", {
-- but how to specify the dimensions for curved and sideways rails? -- 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}, fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2},
}, },
groups = {bendy=2,dig_immediate=2,attached_node=1}, groups = {bendy=2,dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("rail")},
}) })
@ -1446,6 +1693,19 @@ minetest.register_node("default:brick", {
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("default:meselamp", {
description = "Mese Lamp",
drawtype = "glasslike",
tiles = {"default_meselamp.png"},
paramtype = "light",
sunlight_propagates = true,
is_ground_content = false,
groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(),
light_source = default.LIGHT_MAX,
})
-- --
-- Misc -- Misc
-- --
@ -1453,6 +1713,7 @@ minetest.register_node("default:brick", {
minetest.register_node("default:cloud", { minetest.register_node("default:cloud", {
description = "Cloud", description = "Cloud",
tiles = {"default_cloud.png"}, tiles = {"default_cloud.png"},
is_ground_content = false,
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
groups = {not_in_creative_inventory=1}, groups = {not_in_creative_inventory=1},
}) })

View File

@ -15,7 +15,7 @@ function default.player_register_model(name, def)
end end
-- Default player appearance -- Default player appearance
default.player_register_model("character.x", { default.player_register_model("character.b3d", {
animation_speed = 30, animation_speed = 30,
textures = {"character.png", }, textures = {"character.png", },
animations = { animations = {
@ -93,7 +93,7 @@ end
-- Update appearance when the player joins -- Update appearance when the player joins
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.b3d")
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30) player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
-- set GUI -- set GUI

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 B

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 639 B

After

Width:  |  Height:  |  Size: 471 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 B

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 B

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 B

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 589 B

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 546 B

After

Width:  |  Height:  |  Size: 267 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 B

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 739 B

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 608 B

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 B

After

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 647 B

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 516 B

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 277 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

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