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

151 Commits

Author SHA1 Message Date
03c00a831d Clean up trapdoors code and make them more flexible, so custom trapdoors
can be registered by other mods
2015-02-14 00:48:28 +01:00
60520b8032 Fix download URL 2015-02-12 22:25:07 +01:00
a9137e8c21 Fix typo in survival formspec & create legacy file 2015-02-12 22:18:22 +01:00
Tim
75ea7e3160 Bones mod fixes
1. don't delete protected nodes, 2. time out in loaded chunks, 3. don't crash when dying in certain nodes (like default doors or sign_lib signs)
2015-02-12 22:10:15 +01:00
047ecea3a2 Make trapdoor better visible when held in the hand
Screenshots at: https://github.com/minetest/minetest_game/issues/411
2015-02-12 16:51:32 +01:00
5518c277f3 Textures Update 2015-01-25 10:48:42 +01:00
4468015cbe Fix typo for obsidian glass door texture
I think that was just a typo?
2015-01-24 20:40:08 +01:00
0755a8fa05 Mossycobble fixes 2015-01-24 20:36:37 +01:00
5d8b2442ce Add straw 2015-01-17 16:30:31 +01:00
6157982787 Follow naming convention of textures and sounds in doors 2015-01-17 16:05:23 +01:00
07dcae7258 Add fancy inventory for bones 2015-01-17 16:05:19 +01:00
d546a5a1fa Return to original water sink speed for player 2015-01-11 11:27:08 +01:00
3689bdad75 Fix typo in water_flowing tile animation Also add missing commas and use non-deprecated field-names 2015-01-10 15:47:30 +01:00
4ce47528e1 Clarify comment in default:grass_1 2015-01-10 15:47:30 +01:00
2edfb55c29 Restructure default/nodes.lua 2015-01-10 15:47:30 +01:00
d1e715ebac Add tree growing functions to game_api.txt 2015-01-10 15:47:30 +01:00
c654c9fd11 Remove weird constants in default 2015-01-10 15:47:30 +01:00
2c0f716a13 Remove useless, empty callbacks 2015-01-10 15:47:29 +01:00
64bf6c1b89 Add crafting grid result arrow to creative inventory 2015-01-10 15:32:16 +01:00
047bfb9ad1 Simple biomes for mgv5/mgv7. Uses get_mapgen_params 2015-01-10 15:32:16 +01:00
cab01b6694 Add Obsidian / Obsidian Brick stairs & slabs 2015-01-10 15:32:16 +01:00
554d15fadb Change furnace fire icons 2015-01-10 15:16:41 +01:00
a9ac480dcd Set number of screwdriver uses to 200 2014-12-21 22:36:20 +01:00
1237bc3a4b Don't override param2 bits that are not used for rotation in screwdriver 2014-12-20 13:06:53 +01:00
854415fd33 Fix typo in furnace.lua 2014-12-13 12:52:47 +01:00
99cfe73bbf Give 4 obsidianbrick for 4 obsidian 2014-12-12 17:15:48 +01:00
697b39d40d Only allow rotating nodes that could be dug 2014-12-12 16:14:25 +01:00
2b7ca68805 Cleanup
* Remove unused variables
* Fix wearing out of screwdriver
* Move magic numbers into constants
* Scale down texture
2014-12-12 16:14:25 +01:00
bd24c15db4 Screwdriver rewrite 2014-12-12 16:14:24 +01:00
69614dc20d Pinetree (by sfan5, from mg mapgen) lua generation and sapling ABM. Add checks for ignore to other trees 2014-12-12 16:11:42 +01:00
75dfcdb1e7 Add 3D signs 2014-12-12 16:10:30 +01:00
c332081e81 Add white to the crack texture
This makes the crack stand out better on dark textures,
like obsidian and black wool.
2014-12-12 16:06:55 +01:00
608e51f16d Add obsidianbrick
use Zeg9`s texture
2014-12-12 16:04:27 +01:00
b0fb180e4d Use an overlay over default_dirt.png for soil 2014-12-07 19:46:23 +01:00
2ebd6b3839 Correct node definitons for pine saplings and pine needles 2014-12-07 11:57:37 +01:00
5a06de184c Rewrite furnace
* Move furnace related code into furnace.lua
* Move duplicated code into functions
* Rewrite ABM:
	* Easier to follow strcuture (no returns in the middle)
	* No unnecessary calls to get_craft_result
	* Split logic and "visual feedback" (a bit)
	* Fewer calls to meta:set and meta:get
	* Better feedback on the current state of the furnace
2014-12-06 21:18:02 +01:00
957f94534b Remove remains of finite liquids from bucket mod
This reverts commit 79856c914d.
2014-12-06 20:58:03 +01:00
4ec4672f01 Remove remains of weather 2014-12-06 20:58:03 +01:00
954d64afdc Add a minetest.conf.example with all available settings 2014-12-06 20:56:52 +01:00
ef0eb4d435 Move doc for dyes to game_api.txt 2014-12-06 20:54:53 +01:00
11a7b88434 Fix visibility of global/local dye tables 2014-12-06 20:54:02 +01:00
9ec33f34f1 Set param2 to 1 if player places leaves 2014-12-06 20:36:20 +01:00
2c2edfad04 Move leafdecay doc to game_api.txt 2014-12-06 20:36:20 +01:00
22dd46dcc6 Dont dry out soil if unloaded blocks are nearby 2014-12-06 11:54:56 +01:00
20f938e44a Allow the group book to be placed into bookshelfs 2014-12-06 11:46:04 +01:00
fd34872de8 Fix possible stacking of books in bookshelf
Original author: @MT-Modder
2014-12-06 11:43:07 +01:00
31edc5a9ff Add all saplings to group sapling 2014-12-03 17:26:01 +01:00
19bdcb26f6 Add missing groups to pine sapling 2014-12-03 17:26:01 +01:00
5b7db48372 Fix various fire sound bugs 2014-12-03 16:59:36 +01:00
128f0adb24 Fix some undeclared global variables 2014-11-30 18:02:33 +01:00
6fb072e5ff Pine tree, pine needles, pine sapling and pinewood nodes, including textures by Splizard and Cisoun 2014-11-30 17:47:02 +01:00
8007c142de Added the new door textures 2014-11-30 17:34:35 +01:00
e707ba3cf1 Fix leaked globals. 2014-11-29 18:03:18 +01:00
6680a51988 New ladder texture 2014-11-23 11:54:40 +01:00
3bf3249d71 Fix leaking globals in flowers and default mapgen.lua
Signed-off-by: Craig Robbins <kde.psych@gmail.com>
2014-11-22 00:24:49 +10:00
e71b71c1a9 Default and flowers: only run on-generated functions in mgv6. Remove indev ore definitions 2014-11-16 19:38:04 +01:00
a90338d40d New flower textures 2014-11-08 23:45:18 +01:00
929559fe85 Revert "Fix fire blocking sunlight"
This reverts commit dcce6e9795.
2014-11-08 23:25:40 +01:00
c41762d211 New grass(plant) and leaves textures 2014-11-08 22:54:00 +01:00
f06d4b8547 Vessels: new textures 2014-11-08 17:39:52 +01:00
dcce6e9795 Fix fire blocking sunlight 2014-11-04 16:17:56 -05:00
d57cb0a110 Boats mod improve y motion. Smaller collision box. Reverse turn with negative velocity only. Smooth turning. Enable underwater higher acceleration 2014-10-29 10:54:39 +00:00
ba8cbbcdbd Add new ore blocks textures 2014-10-05 08:49:55 +02:00
56cc4191ca Tweak some textures, new chest texture 2014-10-03 11:29:17 +02:00
6532978a58 Add improved grass textures by @Philipbenr (slightly modified), fixes #323 2014-10-03 11:29:10 +02:00
349a63ed14 Allow only boat driver to be detached from boat (fixes #276) 2014-10-03 03:20:31 +02:00
7f44a49d99 Use new optional framed glasslike drawtype 2014-10-02 11:51:47 +02:00
5047540db2 Make new textures fit existing style 2014-09-27 20:33:17 +02:00
9dfaab7f20 Some new textures (natural beauty texturepack) 2014-09-27 20:10:58 +02:00
8fe62ea7f6 Use new firelike drawtype 2014-09-21 22:25:00 +02:00
c4969665e7 Fix dye stuff, fixes #243 2014-09-16 19:40:50 +02:00
9670c27161 Clean up treegen code 2014-09-16 18:38:11 +02:00
c32957f942 Enable dungeons by default 2014-09-16 18:26:32 +02:00
c95cd8414b Fix xpanes API 2014-09-16 17:11:54 +02:00
cc2573acdf Remove API from player.lua
It's now in game_api.txt
2014-09-16 17:07:43 +02:00
44dc611088 Fix farming unloaded node crash 2014-09-06 20:36:40 -04:00
49a8ddc822 Make sand and some leaves sounds quieter 2014-08-22 11:52:51 +02:00
11c04e984d Localize player_attached 2014-08-21 16:49:30 +02:00
ef1f66a64e Fix some farming stuff 2014-08-21 16:48:48 +02:00
a1aee9a68f Fix door hardness detection for open/close sounds 2014-08-07 13:47:01 +02:00
Jat
5dbc738dbd Add API doors : Sound for door open and close. 2014-08-07 12:42:37 +02:00
5b5aa493b5 Fix boat flying up and some tweaks 2014-08-07 12:27:40 +02:00
6967232619 Fix TNT init for undefined enable_tnt setting 2014-07-25 23:29:44 -04:00
263b6f2fdf Show filled buckets in creative inventory 2014-07-24 13:41:17 +02:00
0ca4520cc2 Rewrite TNT 2014-07-22 12:05:40 -04:00
ea3fcdd077 Pair door with door of any type
Mirror the setup of a door placed next to any door, not just next to
a door of the same type.  This is particularly useful where there are
multiple door types that have the same appearance, but one wants the
doors of a pair to have different behaviour in some other respect.
2014-07-22 13:41:32 +02:00
820e48badc Make open trapdoor climbable
When a trapdoor is mounted upside down, to make its top surface flush
with the floor above when closed, it is necessary to have some way to
climb through the trapdoor node when it's open.  Making it climbable
like a ladder satisfies this need.  It is somewhat realistic, as a real
trapdoor can have a ladder segment mounted on one face.  When the trapdoor
is mounted in its default orientation, making the bottom surface flush
with the ceiling below when closed, the climbability when open is not
strictly necessary, but is still a convenience.
2014-07-22 13:04:45 +02:00
c39b9b29de Improve message about screwdriver control
The message to "hold shift" makes an unwarranted assumption about the
user's keybindings.  Messages from the server should refer to a key's
game function, rather than its extragame identity.
2014-07-22 13:04:20 +02:00
a8ad9bfc9d Consistently use group:stick in tool recipes
The left-handed recipes for axes were using default:stick instead of
the group:stick used by all other tool recipes.
2014-07-22 13:03:45 +02:00
d4c24a30e9 Retain sign text when editing is aborted by <esc> 2014-07-22 13:00:20 +02:00
c8845e8d44 Fix desert_sand_soil dropping itself, and changed the descriptions 2014-07-22 12:56:20 +02:00
5175897cdc Alias string to cotton
Cotton plants used to drop strings, now they drop farming:cotton. Some mods (namely, throwing) still use farming:string, therefore we need farming:string to be equal farming:cotton.
2014-07-13 20:04:14 +02:00
c521cb06bf Better ingot textures 2014-07-13 19:37:01 +02:00
3180bdfe6c Add protection to TNT (by @tenplus1) 2014-07-13 19:24:57 +02:00
c993e14084 Add spaces around operators in boat mod code, fix a problem with boat staticdata, fix a crash that can occur with boat going over unknown nodes. 2014-07-09 09:47:51 +02:00
955f3cf310 Fix crafting recipe for iron bars 2014-07-08 19:10:55 +02:00
814c17631d Fix jump-stacking 2014-07-08 16:50:06 +02:00
ca7f6bb97a Convert spaces to tabs and add unknown node checks to xpanes 2014-07-06 21:49:47 -04:00
5e0c49345a Fix boats again 2014-07-06 12:12:05 +02:00
584718a2a7 Rename functions, update API 2014-07-06 10:54:47 +02:00
46b6cee1fc Fix crash in boats mod 2014-07-06 10:30:59 +02:00
7e5dc6c374 Add a minetest_game API documentation 2014-07-06 10:22:20 +02:00
30e57bcc99 NeXt becomes minetest_game 2014-07-05 16:07:03 +02:00
e0673908bf Update only moving boats 2014-07-05 16:06:55 +02:00
7ea81f0906 Fix papyurs texture 2014-07-05 16:06:23 +02:00
49ad1c1bf7 Make gui part of default 2014-07-05 16:06:16 +02:00
ff80b87783 Remove debug line 2014-07-05 16:06:08 +02:00
e106fd51ca Compress all textures losslessly using optipng and advpng 2014-07-05 16:06:00 +02:00
18d0bdd2bb Add boats 2014-07-05 16:03:33 +02:00
60ccb522d4 Make farming more flexible
- API {farming.register_hoe(), farming.register_plant()}
- Fertilities -> Plant only grow on soil with a fitting fertility, e.g. Wheat only grows on grassland, while cotton grows in deserts and grassland)
- New soil: Desert Sand
- Place seeds instead of plants
2014-07-05 16:03:24 +02:00
d0aa09dd8d New fence texture 2014-07-05 16:03:14 +02:00
13dfc2c0e9 More new Textures, Clean up a bit 2014-07-05 16:03:06 +02:00
1e628ed92a Add tnt mod (freeminer version) 2014-07-05 16:02:58 +02:00
b468a23f60 Enable jungles & tweak physics a bit 2014-07-05 16:02:50 +02:00
7d63db1703 Add glasspanes and ironbars 2014-07-05 16:02:42 +02:00
f85e9ba691 Add mese and diamond hoe, new tool textures 2014-07-05 16:02:34 +02:00
fa485f7d63 Make creative inventory use new fancy layout 2014-07-05 16:02:26 +02:00
da9579846c Added Glass and Obsidian Glass door (doors mod) 2014-07-05 16:02:17 +02:00
8dc6b0124e Add /sethome & /home 2014-07-05 16:02:09 +02:00
4602bd5999 Remove legacy, move aliases to default 2014-07-05 16:02:01 +02:00
a3e92c4524 New textures 2014-07-05 16:01:53 +02:00
72f9f64c04 Added desert and sandstone brick slabs and stairs 2014-07-05 16:01:45 +02:00
8bf344e461 Remove external_legacy (no longer needed) 2014-07-05 16:01:36 +02:00
a32751800c Add furnace protection, eat some lines of codes
This adds protection for furnaces (when the area is protected, so it the
furnace).
Also made the codes a bit shorter..
2014-07-05 16:01:28 +02:00
d47201f813 Add punch to pickup, drop instead of delete
These changes allow players to punch up old bones or their own.
If there is no area for bones, drop the items instead of delete.
Notify the player where he died, so he can find them again.
2014-07-05 16:01:19 +02:00
f2255ccba0 Change game name to "Minetest Next" 2014-07-05 15:58:03 +02:00
16b625d963 Add fancy inventory for bookshelves 2014-07-05 15:57:55 +02:00
bb76f17703 Add a inventory to bookshelf, in which books are unstackable 2014-07-05 15:57:45 +02:00
104018d711 Add fancy inventories 2014-07-05 15:57:35 +02:00
5e2902fd92 Add Desertstone / Desert Cobblestone stairs & slabs 2014-07-05 15:57:27 +02:00
43b1608f86 Update header 2014-07-05 15:57:18 +02:00
abdc707f28 Update README 2014-07-05 15:57:09 +02:00
15e2470493 Update icon 2014-07-05 15:57:01 +02:00
07d3981d61 Fix farming (caused by outdated pull) 2014-07-05 15:56:53 +02:00
d0a98b5331 Add cuboid wieldhand (Sam II) 2014-07-05 15:56:40 +02:00
195fec2689 Add mirrored recipes for axes 2014-07-05 15:56:32 +02:00
664b45ac75 Adjust stair output amount
Stair recipe now outputs six stairs rather than four.
2014-07-05 15:56:23 +02:00
b3f4f406c4 Modify default grasses rather than entirely re-defining them
Also, move "waving = 1" property for grasses/shrubs over to default/nodes.lua
and put all instances of this property right under the drawtype, since they
are directly related and depend on the above.
2014-07-05 15:56:15 +02:00
9559f695ec Dig upwards for papyrus and cactus 2014-07-05 15:56:07 +02:00
919c9d152b Add Desert Cobblestone 2014-07-05 15:55:59 +02:00
253af00743 Don't create bones if the player's inventory is empty 2014-06-25 15:46:45 -04:00
579c279be2 Fix semitransparent pixel in bread's texture. 2014-05-20 19:58:30 +02:00
15740ffd3d Add animations for third person view 2014-04-12 01:17:54 +02:00
a5dcf123e0 Add animated front texture for active furnace 2014-02-17 18:21:08 -05:00
d5fcae085d Remove trailing whitespace from doors 2014-02-12 18:26:48 -05:00
3e2781bc00 Add protection support to doors 2014-02-12 18:26:43 -05:00
e134282093 Add Sam II
<PilzAdam> why dont you include sam II in there?
2014-02-07 18:45:00 -05:00
428a8127cb Added a caped player model, which works like the
hat layer, when the area for the cape (a 8x12 set of pixels) which is to
the right of the arm texture, is given a non-alpha or semi-alpha pixel,
it will display ingame, similar to the hat layer on the player's head.
2014-02-07 18:45:00 -05:00
04e560328f Reverse and combine if statements in the screwdriver 2014-01-16 18:40:04 -05:00
c971ec7dc7 Fix crash when using the screwdriver on an unknown node 2014-01-16 18:32:13 -05:00
d09d8f02a4 Fix crash with nil fuel 2014-01-11 11:27:21 -05:00
367 changed files with 23030 additions and 8769 deletions

View File

@ -1,7 +1,7 @@
The main game for the Minetest game engine [minetest_game]
==========================================================
To build the wholeness of the Minetest project, insert this repository as
To use this game with Minetest, insert this repository as
/games/minetest_game
in the Minetest Engine.
@ -14,10 +14,10 @@ The minetest_game github master HEAD is generally compatible with the github
master HEAD of minetest.
Additionally, when the minetest engine is tagged to be a certain version (eg.
0.4.dev-20120326), minetest_game is tagged with the version too.
0.4.10), minetest_game is tagged with the version too.
When stable releases are made, minetest_game is packaged and made available in
http://minetest.net/download.php
http://minetest.net/download
and in case the repository has grown too much, it may be reset. In that sense,
this is not a "real" git repository. (Package maintainers please note!)
@ -50,4 +50,3 @@ http://creativecommons.org/licenses/by-sa/3.0/
License of menu/header.png
Copyright (C) 2013 BlockMen CC BY-3.0

314
game_api.txt Normal file
View File

@ -0,0 +1,314 @@
minetest_game API
======================
GitHub Repo: https://github.com/minetest/minetest_game
Introduction
------------
The minetest_game gamemode offers multiple new possibilities in addition to Minetest's built-in API, allowing you to
add new plants to farming mod, buckets for new liquids, new stairs and custom panes.
For information on the Minetest API, visit https://github.com/minetest/minetest/blob/master/doc/lua_api.txt
Please note:
[XYZ] refers to a section the Minetest API
[#ABC] refers to a section in this document
^ Explanation for line above
Bucket API
----------
The bucket API allows registering new types of buckets for non-default liquids.
bucket.register_liquid(
"default:lava_source", -- Source node name
"default:lava_flowing", -- Flowing node name
"bucket:bucket_lava", -- Name to be used for bucket
"bucket_lava.png", -- Bucket texture (for wielditem and inventory_image)
"Lava Bucket" -- Bucket description
)
Doors API
---------
The doors mod allows modders to register custom doors and trapdoors.
doors.register_door(name, def)
^ name: "Door name"
^ def: See [#Door definition]
-> Registers new door
doors.register_trapdoor(name, def)
^ name: "Trapdoor name"
^ def: See [#Trapdoor definition]
-> Registers new trapdoor
#Door definition
----------------
{
description = "Door description",
inventory_image = "mod_door_inv.png",
groups = {group = 1},
tiles_bottom: [Tile definition],
^ the tiles of the bottom part of the door {front, side}
tiles_top: [Tile definition],
^ the tiles of the bottom part of the door {front, side}
node_box_bottom = regular nodebox, see [Node boxes], OPTIONAL,
node_box_top = regular nodebox, see [Node boxes], OPTIONAL,
selection_box_bottom = regular nodebox, see [Node boxes], OPTIONAL,
selection_box_top = regular nodebox, see [Node boxes], OPTIONAL,
sound_open_door = sound play for open door, OPTIONAL,
sound_close_door = sound play for close door, OPTIONAL,
only_placer_can_open = true/false,
^ If true, only placer can open the door (locked for others)
}
#Trapdoor definition
----------------
{
tile_front = "doors_trapdoor.png",
^ the texture for the front and back of the trapdoor
tile_side: "doors_trapdoor_side.png",
^ the tiles of the four side parts of the trapdoor
sound_open = sound to play when opening the trapdoor, OPTIONAL,
sound_close = sound to play when closing the trapdoor, OPTIONAL,
-> You can add any other node definition properties for minetest.register_node,
such as wield_image, inventory_image, sounds, groups, description, ...
Only node_box, selection_box, tiles, drop, drawtype, paramtype, paramtype2, on_rightclick
will be overwritten by the trapdoor registration function
}
Farming API
-----------
The farming API allows you to easily register plants and hoes.
farming.register_hoe(name, hoe definition)
-> Register a new hoe, see [#hoe definition]
farming.register_plant(name, Plant definition)
-> Register a new growing plant, see [#Plant definition]
#Hoe Definition
---------------
{
description = "", -- Description for tooltip
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
max_uses = 30, -- Uses until destroyed
recipe = { -- Craft recipe
{"air", "air", "air"},
{"", "group:stick"},
{"", "group:stick"},
}
}
#Plant definition
-----------------
{
description = "", -- Description of seed item
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
steps = 8, -- How many steps the plant has to grow, until it can be harvested
^ Always provide a plant texture for ech step, format: modname_plantname_i.png (i = stepnumber)
minlight = 13, -- Minimum light to grow
maxlight = default.LIGHT_MAX -- Maximum light to grow
}
Stairs API
----------
The stairs API lets you register stairs and slabs and ensures that they are registered the same way as those
delivered with minetest_game, to keep them compatible with other mods.
stairs.register_stair(subname, recipeitem, groups, images, description, sounds)
-> Registers a stair.
-> subname: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
-> recipeitem: Item used in the craft recipe, e.g. "default:cobble"
-> groups: see [Known damage and digging time defining groups]
-> images: see [Tile definition]
-> description: used for the description field in the stair's definition
-> sounds: see [#Default sounds]
stairs.register_slab(subname, recipeitem, groups, images, description, sounds)
-> Registers a slabs
-> subname: Basically the material name (e.g. cobble) used for the stair name. Nodename pattern: "stairs:stair_subname"
-> recipeitem: Item used in the craft recipe, e.g. "default:cobble"
-> groups: see [Known damage and digging time defining groups]
-> images: see [Tile definition]
-> description: used for the description field in the stair's definition
-> sounds: see [#Default sounds]
stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds)
-> A wrapper for stairs.register_stair and stairs.register_slab
-> Uses almost the same arguments as stairs.register_stair
-> desc_stair: Description for stair node
-> desc_slab: Description for slab node
Xpanes API
----------
Creates panes that automatically connect to each other
xpanes.register_pane(subname, def)
-> subname: used for nodename. Result: "xpanes:subname" and "xpanes:subname_{2..15}"
-> def: See [#Pane definition]
#Pane definition
----------------
{
textures = {"texture_Bottom_top", "texture_left_right", "texture_front_back"},
^ More tiles aren't supported
groups = {group = rating},
^ Uses the known node groups, see [Known damage and digging time defining groups]
sounds = SoundSpec,
^ See [#Default sounds]
recipe = {{"","","","","","","","",""}},
^ Recipe field only
}
Default sounds
--------------
Sounds inside the default table can be used within the sounds field of node definitions.
default.node_sound_defaults()
default.node_sound_stone_defaults()
default.node_sound_dirt_defaults()
default.node_sound_sand_defaults()
default.node_sound_wood_defaults()
default.node_sound_leaves_defaults()
default.node_sound_glass_defaults()
Default constants
-----------------
default.LIGHT_MAX
^ The maximum light level (see [Node definition] light_source)
Player API
----------
The player API can register player models and update the player's appearence
default.player_register_model(name, def)
^ Register a new model to be used by players.
-> name: model filename such as "character.x", "foo.b3d", etc.
-> def: See [#Model definition]
default.registered_player_models[name]
^ Get a model's definition
-> see [#Model definition]
default.player_set_model(player, model_name)
^ Change a player's model
-> player: PlayerRef
-> model_name: model registered with player_register_model()
default.player_set_animation(player, anim_name [, speed])
^ Applies an animation to a player
-> anim_name: name of the animation.
-> speed: frames per second. If nil, default from the model is used
default.player_set_textures(player, textures)
^ Sets player textures
-> player: PlayerRef
-> textures: array of textures
^ If <textures> is nil, the default textures from the model def are used
default.player_get_animation(player)
^ Returns a table containing fields "model", "textures" and "animation".
^ Any of the fields of the returned table may be nil.
-> player: PlayerRef
Model Definition
----------------
{
animation_speed = 30, -- Default animation speed, in FPS.
textures = {"character.png", }, -- Default array of textures.
visual_size = {x=1, y=1,}, -- Used to scale the model.
animations = {
-- <anim_name> = { x=<start_frame>, y=<end_frame>, },
foo = { x= 0, y=19, },
bar = { x=20, y=39, },
-- ...
},
}
Leafdecay
---------
To enable leaf decay for a node, add it to the "leafdecay" group.
The rating of the group determines how far from a node in the group "tree"
the node can be without decaying.
If param2 of the node is ~= 0, the node will always be preserved. Thus, if
the player places a node of that kind, you will want to set param2=1 or so.
The function default.after_place_leaves can be set as after_place_node of a node
to set param2 to 1 if the player places the node (should not be used for nodes
that use param2 otherwise (e.g. facedir)).
If the node is in the leafdecay_drop group then it will always be dropped as an
item.
Dyes
----
To make recipes that will work with any dye ever made by anybody, define
them based on groups. You can select any group of groups, based on your need for
amount of colors.
#Color groups
-------------
Base color groups:
- basecolor_white
- basecolor_grey
- basecolor_black
- basecolor_red
- basecolor_yellow
- basecolor_green
- basecolor_cyan
- basecolor_blue
- basecolor_magenta
Extended color groups (* = equal to a base color):
* excolor_white
- excolor_lightgrey
* excolor_grey
- excolor_darkgrey
* excolor_black
* excolor_red
- excolor_orange
* excolor_yellow
- excolor_lime
* excolor_green
- excolor_aqua
* excolor_cyan
- excolor_sky_blue
* excolor_blue
- excolor_violet
* excolor_magenta
- excolor_red_violet
The whole unifieddyes palette as groups:
- unicolor_<excolor>
For the following, no white/grey/black is allowed:
- unicolor_medium_<excolor>
- unicolor_dark_<excolor>
- unicolor_light_<excolor>
- unicolor_<excolor>_s50
- unicolor_medium_<excolor>_s50
- unicolor_dark_<excolor>_s50
Example of one shapeless recipe using a color group:
minetest.register_craft({
type = "shapeless",
output = '<mod>:item_yellow',
recipe = {'<mod>:item_no_color', 'group:basecolor_yellow'},
})
#Color lists
------------
dye.basecolors
^ Array containing the names of available base colors
dye.excolors
^ Array containing the names of the available extended colors
Trees
-----
default.grow_tree(pos, is_apple_tree)
^ Grows a tree or apple tree at pos
default.grow_jungle_tree(pos)
^ Grows a jungletree at pos
default.grow_pine_tree(pos)
^ Grows a pinetree at pos

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

3
minetest.conf Normal file
View File

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

24
minetest.conf.example Normal file
View File

@ -0,0 +1,24 @@
# This file contains settings of minetest_game that can be changed in
# minetest.conf
#
# By default, all the settings are commented and not functional.
# Uncomment settings by removing the preceding #.
# Whether creative mode (fast digging of all blocks, unlimited resources) should be enabled
#creative_mode = false
# The time in seconds after which the bones of a dead player can be looted by everyone
# 0 to disable
#share_bones_time = 1200
# Whether fire should be disabled (all fire nodes will instantly disappear)
#disable_fire = false
# Whether steel tools, torches and cobblestone should be given to new players
#give_initial_stuff = false
# Whether the TNT mod should be enabled
#enable_tnt = <true in singleplayer, false in multiplayer>
# The radius of a TNT explosion
#tnt_radius = 3

16
mods/boats/README.txt Normal file
View File

@ -0,0 +1,16 @@
Minetest 0.4 mod: boats
=======================
by PilzAdam, slightly modified for NeXt
License of source code:
-----------------------
WTFPL
License of media (textures and sounds):
---------------------------------------
WTFPL
Authors of media files:
-----------------------
textures: Zeg9
model: thetoon and Zeg9, modified by PavelS(SokolovPavel)

View File

@ -1,2 +1 @@
default

217
mods/boats/init.lua Normal file
View File

@ -0,0 +1,217 @@
--
-- Helper functions
--
local function is_water(pos)
local nn = minetest.get_node(pos).name
return minetest.get_item_group(nn, "water") ~= 0
end
local function get_sign(i)
if i == 0 then
return 0
else
return i / math.abs(i)
end
end
local function get_velocity(v, yaw, y)
local x = -math.sin(yaw) * v
local z = math.cos(yaw) * v
return {x = x, y = y, z = z}
end
local function get_v(v)
return math.sqrt(v.x ^ 2 + v.z ^ 2)
end
--
-- Boat entity
--
local boat = {
physical = true,
collisionbox = {-0.5, -0.4, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = "boat.x",
textures = {"default_wood.png"},
driver = nil,
v = 0,
last_v = 0,
removed = false
}
function boat.on_rightclick(self, clicker)
if not clicker or not clicker:is_player() then
return
end
local name = clicker:get_player_name()
if self.driver and clicker == self.driver then
self.driver = nil
clicker:set_detach()
default.player_attached[name] = false
default.player_set_animation(clicker, "stand" , 30)
elseif not self.driver then
self.driver = clicker
clicker:set_attach(self.object, "", {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0})
default.player_attached[name] = true
minetest.after(0.2, function()
default.player_set_animation(clicker, "sit" , 30)
end)
self.object:setyaw(clicker:get_look_yaw() - math.pi / 2)
end
end
function boat.on_activate(self, staticdata, dtime_s)
self.object:set_armor_groups({immortal = 1})
if staticdata then
self.v = tonumber(staticdata)
end
self.last_v = self.v
end
function boat.get_staticdata(self)
return tostring(self.v)
end
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
return
end
if self.driver and puncher == self.driver then
self.driver = nil
puncher:set_detach()
default.player_attached[puncher:get_player_name()] = false
end
if not self.driver then
self.removed = true
-- delay remove to ensure player is detached
minetest.after(0.1, function()
self.object:remove()
end)
if not minetest.setting_getbool("creative_mode") then
puncher:get_inventory():add_item("main", "boats:boat")
end
end
end
function boat.on_step(self, dtime)
self.v = get_v(self.object:getvelocity()) * get_sign(self.v)
if self.driver then
local ctrl = self.driver:get_player_control()
local yaw = self.object:getyaw()
if ctrl.up then
self.v = self.v + 0.1
elseif ctrl.down then
self.v = self.v - 0.1
end
if ctrl.left then
if self.v < 0 then
self.object:setyaw(yaw - (1 + dtime) * 0.03)
else
self.object:setyaw(yaw + (1 + dtime) * 0.03)
end
elseif ctrl.right then
if self.v < 0 then
self.object:setyaw(yaw + (1 + dtime) * 0.03)
else
self.object:setyaw(yaw - (1 + dtime) * 0.03)
end
end
end
local velo = self.object:getvelocity()
if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then
self.object:setpos(self.object:getpos())
return
end
local s = get_sign(self.v)
self.v = self.v - 0.02 * s
if s ~= get_sign(self.v) then
self.object:setvelocity({x = 0, y = 0, z = 0})
self.v = 0
return
end
if math.abs(self.v) > 4.5 then
self.v = 4.5 * get_sign(self.v)
end
local p = self.object:getpos()
p.y = p.y - 0.5
local new_velo = {x = 0, y = 0, z = 0}
local new_acce = {x = 0, y = 0, z = 0}
if not is_water(p) then
local nodedef = minetest.registered_nodes[minetest.get_node(p).name]
if (not nodedef) or nodedef.walkable then
self.v = 0
new_acce = {x = 0, y = 1, z = 0}
else
new_acce = {x = 0, y = -9.8, z = 0}
end
new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
else
p.y = p.y + 1
if is_water(p) then
local y = self.object:getvelocity().y
if y >= 4.5 then
y = 4.5
elseif y < 0 then
new_acce = {x = 0, y = 20, z = 0}
else
new_acce = {x = 0, y = 5, z = 0}
end
new_velo = get_velocity(self.v, self.object:getyaw(), y)
self.object:setpos(self.object:getpos())
else
new_acce = {x = 0, y = 0, z = 0}
if math.abs(self.object:getvelocity().y) < 1 then
local pos = self.object:getpos()
pos.y = math.floor(pos.y) + 0.5
self.object:setpos(pos)
new_velo = get_velocity(self.v, self.object:getyaw(), 0)
else
new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y)
self.object:setpos(self.object:getpos())
end
end
end
self.object:setvelocity(new_velo)
self.object:setacceleration(new_acce)
end
minetest.register_entity("boats:boat", boat)
minetest.register_craftitem("boats:boat", {
description = "Boat",
inventory_image = "boat_inventory.png",
wield_image = "boat_wield.png",
wield_scale = {x = 2, y = 2, z = 1},
liquids_pointable = true,
on_place = function(itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then
return
end
if not is_water(pointed_thing.under) then
return
end
pointed_thing.under.y = pointed_thing.under.y + 0.5
minetest.add_entity(pointed_thing.under, "boats:boat")
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end,
})
minetest.register_craft({
output = "boats:boat",
recipe = {
{"", "", "" },
{"group:wood", "", "group:wood"},
{"group:wood", "group:wood", "group:wood"},
},
})

11110
mods/boats/models/boat.x Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

View File

@ -1,6 +1,8 @@
-- Minetest 0.4 mod: bones
-- See README.txt for licensing and other information.
bones = {}
local function is_owner(pos, name)
local owner = minetest.get_meta(pos):get_string("owner")
if owner == "" or owner == name then
@ -9,6 +11,19 @@ local function is_owner(pos, name)
return false
end
bones.bones_formspec =
"size[8,9]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_name;main;0,0.3;8,4;]"..
"list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]"..
default.get_hotbar_bg(0,4.85)
local share_bones_time = tonumber(minetest.setting_get("share_bones_time") or 1200)
local share_bones_time_early = tonumber(minetest.setting_get("share_bones_time_early") or (share_bones_time/4))
minetest.register_node("bones:bones", {
description = "Bones",
tiles = {
@ -51,81 +66,154 @@ minetest.register_node("bones:bones", {
on_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if meta:get_string("owner") ~= "" and meta:get_inventory():is_empty("main") then
meta:set_string("infotext", meta:get_string("owner").."'s old bones")
meta:set_string("formspec", "")
meta:set_string("owner", "")
if meta:get_inventory():is_empty("main") then
minetest.remove_node(pos)
end
end,
on_punch = function(pos, node, player)
if(not is_owner(pos, player:get_player_name())) then
return
end
local inv = minetest.get_meta(pos):get_inventory()
local player_inv = player:get_inventory()
local has_space = true
for i=1,inv:get_size("main") do
local stk = inv:get_stack("main", i)
if player_inv:room_for_item("main", stk) then
inv:set_stack("main", i, nil)
player_inv:add_item("main", stk)
else
has_space = false
break
end
end
-- remove bones if player emptied them
if has_space then
minetest.remove_node(pos)
end
end,
on_timer = function(pos, elapsed)
local meta = minetest.get_meta(pos)
local time = meta:get_int("time") + elapsed
local publish = 1200
if tonumber(minetest.setting_get("share_bones_time")) then
publish = tonumber(minetest.setting_get("share_bones_time"))
end
if publish == 0 then
return
end
if time >= publish then
if time >= share_bones_time then
meta:set_string("infotext", meta:get_string("owner").."'s old bones")
meta:set_string("owner", "")
else
meta:set_int("time", time)
return true
end
end,
})
local function may_replace(pos, player)
local node_name = minetest.get_node(pos).name
local node_definition = minetest.registered_nodes[node_name]
-- if the node is unknown, we let the protection mod decide
-- this is consistent with when a player could dig or not dig it
-- unknown decoration would often be removed
-- while unknown building materials in use would usually be left
if not node_definition then
-- only replace nodes that are not protected
return not minetest.is_protected(pos, player:get_player_name())
end
-- allow replacing air and liquids
if node_name == "air" or node_definition.liquidtype ~= "none" then
return true
end
-- don't replace filled chests and other nodes that don't allow it
local can_dig_func = node_definition.can_dig
if can_dig_func and not can_dig_func(pos, player) then
return false
end
-- default to each nodes buildable_to; if a placed block would replace it, why shouldn't bones?
-- flowers being squished by bones are more realistical than a squished stone, too
-- exception are of course any protected buildable_to
return node_definition.buildable_to and not minetest.is_protected(pos, player:get_player_name())
end
minetest.register_on_dieplayer(function(player)
if minetest.setting_getbool("creative_mode") then
return
end
local player_inv = player:get_inventory()
if player_inv:is_empty("main") and
player_inv:is_empty("craft") then
return
end
local pos = player:getpos()
pos.x = math.floor(pos.x+0.5)
pos.y = math.floor(pos.y+0.5)
pos.z = math.floor(pos.z+0.5)
local param2 = minetest.dir_to_facedir(player:get_look_dir())
local nn = minetest.get_node(pos).name
if minetest.registered_nodes[nn].can_dig and
not minetest.registered_nodes[nn].can_dig(pos, player) then
local player_name = player:get_player_name()
local player_inv = player:get_inventory()
if (not may_replace(pos, player)) then
if (may_replace({x=pos.x, y=pos.y+1, z=pos.z}, player)) then
-- drop one node above if there's space
-- this should solve most cases of protection related deaths in which players dig straight down
-- yet keeps the bones reachable
pos.y = pos.y+1
else
-- drop items instead of delete
for i=1,player_inv:get_size("main") do
player_inv:set_stack("main", i, nil)
minetest.add_item(pos, player_inv:get_stack("main", i))
end
for i=1,player_inv:get_size("craft") do
player_inv:set_stack("craft", i, nil)
minetest.add_item(pos, player_inv:get_stack("craft", i))
end
-- empty lists main and craft
player_inv:set_list("main", {})
player_inv:set_list("craft", {})
return
end
end
minetest.dig_node(pos)
minetest.add_node(pos, {name="bones:bones", param2=param2})
minetest.set_node(pos, {name="bones:bones", param2=param2})
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local player_inv = player:get_inventory()
inv:set_size("main", 8*4)
local empty_list = inv:get_list("main")
inv:set_list("main", player_inv:get_list("main"))
player_inv:set_list("main", empty_list)
for i=1,player_inv:get_size("craft") do
inv:add_item("main", player_inv:get_stack("craft", i))
player_inv:set_stack("craft", i, nil)
local stack = player_inv:get_stack("craft", i)
if inv:room_for_item("main", stack) then
inv:add_item("main", stack)
else
--drop if no space left
minetest.add_item(pos, stack)
end
end
meta:set_string("formspec", "size[8,9;]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", player:get_player_name().."'s fresh bones")
meta:set_string("owner", player:get_player_name())
meta:set_int("time", 0)
player_inv:set_list("main", {})
player_inv:set_list("craft", {})
local timer = minetest.get_node_timer(pos)
timer:start(10)
meta:set_string("formspec", bones.bones_formspec)
meta:set_string("owner", player_name)
if share_bones_time ~= 0 then
meta:set_string("infotext", player_name.."'s fresh bones")
if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then
meta:set_int("time", 0)
else
meta:set_int("time", (share_bones_time - share_bones_time_early))
end
minetest.get_node_timer(pos):start(10)
else
meta:set_string("infotext", player_name.."'s bones")
end
end)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 B

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 289 B

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 182 B

View File

@ -1,8 +1,6 @@
-- Minetest 0.4 mod: bucket
-- See README.txt for licensing and other information.
local LIQUID_MAX = 8 --The number of water levels when liquid_finite is enabled
minetest.register_alias("bucket", "bucket:bucket_empty")
minetest.register_alias("bucket_water", "bucket:bucket_water")
minetest.register_alias("bucket_lava", "bucket:bucket_lava")
@ -51,7 +49,6 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
inventory_image = inventory_image,
stack_max = 1,
liquids_pointable = true,
groups = {not_in_creative_inventory=1},
on_place = function(itemstack, user, pointed_thing)
-- Must be pointing to node
if pointed_thing.type ~= "node" then
@ -72,40 +69,20 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
itemstack) or itemstack
end
local place_liquid = function(pos, node, source, flowing, fullness)
local place_liquid = function(pos, node, source, flowing)
if check_protection(pos,
user and user:get_player_name() or "",
"place "..source) then
return
end
if math.floor(fullness/128) == 1 or
not minetest.setting_getbool("liquid_finite") then
minetest.add_node(pos, {name=source,
param2=fullness})
return
elseif node.name == flowing then
fullness = fullness + node.param2
elseif node.name == source then
fullness = LIQUID_MAX
end
if fullness >= LIQUID_MAX then
minetest.add_node(pos, {name=source,
param2=LIQUID_MAX})
else
minetest.add_node(pos, {name=flowing,
param2=fullness})
end
minetest.add_node(pos, {name=source})
end
-- Check if pointing to a buildable node
local fullness = tonumber(itemstack:get_metadata())
if not fullness then fullness = LIQUID_MAX end
if ndef and ndef.buildable_to then
-- buildable; replace the node
place_liquid(pointed_thing.under, node,
source, flowing, fullness)
source, flowing)
else
-- not buildable to; place the liquid above
-- check if the node above can be replaced
@ -113,7 +90,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
if node and minetest.registered_nodes[node.name].buildable_to then
place_liquid(pointed_thing.above,
node, source,
flowing, fullness)
flowing)
else
-- do not remove the bucket with the liquid
return
@ -136,12 +113,10 @@ minetest.register_craftitem("bucket:bucket_empty", {
return
end
-- Check if pointing to a liquid source
node = minetest.get_node(pointed_thing.under)
liquiddef = bucket.liquids[node.name]
local node = minetest.get_node(pointed_thing.under)
local liquiddef = bucket.liquids[node.name]
if liquiddef ~= nil and liquiddef.itemname ~= nil and
(node.name == liquiddef.source or
(node.name == liquiddef.flowing and
minetest.setting_getbool("liquid_finite"))) then
node.name == liquiddef.source then
if check_protection(pointed_thing.under,
user:get_player_name(),
"take ".. node.name) then
@ -150,11 +125,7 @@ minetest.register_craftitem("bucket:bucket_empty", {
minetest.add_node(pointed_thing.under, {name="air"})
if node.name == liquiddef.source then
node.param2 = LIQUID_MAX
end
return ItemStack({name = liquiddef.itemname,
metadata = tostring(node.param2)})
return ItemStack(liquiddef.itemname)
end
end,
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 B

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 288 B

After

Width:  |  Height:  |  Size: 169 B

View File

@ -72,17 +72,25 @@ trash:set_size("main", 1)
creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
pagenum = math.floor(pagenum)
local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1)
player:set_inventory_formspec("size[13,7.5]"..
player:set_inventory_formspec(
"size[13,7.5]"..
--"image[6,0.6;1,2;player.png]"..
"list[current_player;main;5,3.5;8,4;]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_player;main;5,3.5;8,1;]"..
"list[current_player;main;5,4.75;8,3;8]"..
"list[current_player;craft;8,0;3,3;]"..
"list[current_player;craftpreview;12,1;1,1;]"..
"image[11,1;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]"..
"label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]"..
"button[0.3,6.5;1.6,1;creative_prev;<<]"..
"button[2.7,6.5;1.6,1;creative_next;>>]"..
"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)
)
end
minetest.register_on_joinplayer(function(player)
-- If in creative mode, modify player's inventory forms

View File

@ -23,14 +23,6 @@ Everything not listed in here:
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
Cisoun's WTFPL texture pack:
default_chest_front.png
default_chest_lock.png
default_chest_side.png
default_chest_top.png
default_stone_brick.png
default_dirt.png
default_grass.png
default_grass_side.png
default_jungletree.png
default_jungletree_top.png
default_lava.png
@ -38,23 +30,17 @@ Cisoun's WTFPL texture pack:
default_sapling.png
default_sign_wall.png
default_stone.png
default_tool_mesepick.png
default_tool_steelpick.png
default_tool_steelshovel.png
default_tool_stonepick.png
default_tool_stoneshovel.png
default_tool_woodpick.png
default_tool_woodshovel.png
default_tree.png
default_tree_top.png
default_water.png
Cisoun's conifers mod (WTFPL):
default_pine_needles.png
Originating from G4JC's Almost MC Texture Pack:
default_wood.png
default_torch.png
default_torch_on_ceiling.png
default_torch_on_floor.png
default_cobble.png
VanessaE's animated torches (WTFPL):
default_torch_animated.png
@ -80,13 +66,9 @@ VanessaE (WTFPL):
Calinou (CC BY-SA):
default_brick.png
default_clay_brick.png
default_papyrus.png
default_tool_steelsword.png
default_bronze_ingot.png
default_copper_ingot.png
default_copper_lump.png
default_mineral_copper.png
default_glass_detail.png
MirceaKitsune (WTFPL):
character.x
@ -100,22 +82,7 @@ PilzAdam (WTFPL):
default_junglewood.png
default_obsidian_glass.png
default_obsidian_shard.png
default_mossycobble.png
default_gold_ingot.png
default_gold_lump.png
default_mineral_gold.png
default_diamond.png
default_tool_diamondpick.png
default_tool_diamondsword.png
default_tool_diamondshovel.png
default_tool_diamondaxe.png
default_tool_meseaxe.png
default_tool_meseshovel.png
default_tool_mesesword.png
default_tool_bronzeaxe.png
default_tool_bronzepick.png
default_tool_bronzeshovel.png
default_tool_bronzesword.png
default_snowball.png
jojoa1997 (WTFPL):
@ -128,6 +95,7 @@ Splizard (CC BY-SA 3.0):
default_snow.png
default_snow_side.png
default_ice.png
default_pine_sapling.png
Zeg9 (CC BY-SA 3.0):
default_coal_block.png
@ -135,10 +103,48 @@ Zeg9 (CC BY-SA 3.0):
default_copper_block.png
default_bronze_block.png
default_gold_block.png
default_diamond_block.png
kaeza (WTFPL):
paramat (CC BY-SA 3.0):
wieldhand.png, based on character.png by Jordach (CC BY-SA 3.0)
default_pinetree.png
default_pinetree_top.png
default_pinewood.png
brunob.santos (CC BY-SA 4.0):
default_desert_cobble.png
BlockMen (CC BY-SA 3.0):
default_stone_brick.png
default_wood.png
default_clay_brick.png
default_iron_ingot.png
default_gold_ingot.png
default_tool_steelsword.png
default_diamond.png
default_diamond_block.png
default_book.png
default_tool_*.png
default_lava_source_animated.png
default_lava_flowing_animated.png
default_stick.png
default_chest_front.png
default_chest_lock.png
default_chest_side.png
default_chest_top.png
bubble.png
heart.png
gui_*.png
Neuromancer (CC BY-SA 2.0):
default_cobble.png, based on texture by Brane praefect
default_mossycobble.png, based on texture by Brane praefect
Neuromancer (CC BY-SA 3.0):
default_dirt.png
default_furnace_*.png
Philipbenr (CC BY-SA 3.0):
default_grass.png
default_grass_side.png
Glass breaking sounds (CC BY 3.0):
1: http://www.freesound.org/people/cmusounddesign/sounds/71947/
@ -179,3 +185,14 @@ Mito551 (sounds) (CC BY-SA):
default_dirt_footstep.1.ogg
default_dirt_footstep.2.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

@ -1,10 +1,7 @@
-- legacy (Minetest 0.4 mod)
-- Provides as much backwards-compatibility as feasible
--
-- Aliases to support loading 0.3 and old 0.4 worlds and inventories
--
-- mods/default/aliases.lua
-- Aliases to support loading worlds using nodes following the old naming convention
-- These can also be helpful when using chat commands, for example /giveme
minetest.register_alias("stone", "default:stone")
minetest.register_alias("stone_with_coal", "default:stone_with_coal")
minetest.register_alias("stone_with_iron", "default:stone_with_iron")
@ -69,39 +66,7 @@ minetest.register_alias("lump_of_iron", "default:iron_lump")
minetest.register_alias("lump_of_clay", "default:clay_lump")
minetest.register_alias("steel_ingot", "default:steel_ingot")
minetest.register_alias("clay_brick", "default:clay_brick")
minetest.register_alias("scorched_stuff", "default:scorched_stuff")
minetest.register_alias("snow", "default:snow")
--
-- Old items
--
minetest.register_craftitem(":rat", {
description = "Rat",
inventory_image = "rat.png",
})
minetest.register_craftitem(":cooked_rat", {
description = "Cooked rat",
inventory_image = "cooked_rat.png",
on_use = minetest.item_eat(6),
})
minetest.register_craftitem(":firefly", {
description = "Firefly",
inventory_image = "firefly.png",
groups = {not_in_creative_inventory=1},
})
minetest.register_craft({
type = "cooking",
output = "cooked_rat",
recipe = "rat",
})
minetest.register_craft({
type = "cooking",
output = "scorched_stuff",
recipe = "cooked_rat",
})
-- END
-- Mese now comes in the form of blocks, ore, crystal and fragments
minetest.register_alias("default:mese", "default:mese_block")

View File

@ -14,6 +14,13 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'default:pinewood 4',
recipe = {
{'default:pinetree'},
}
})
minetest.register_craft({
output = 'default:stick 4',
recipe = {
@ -208,6 +215,60 @@ minetest.register_craft({
}
})
minetest.register_craft({
output = 'default:axe_wood',
recipe = {
{'group:wood', 'group:wood'},
{'group:stick', 'group:wood'},
{'group:stick',''},
}
})
minetest.register_craft({
output = 'default:axe_stone',
recipe = {
{'group:stone', 'group:stone'},
{'group:stick', 'group:stone'},
{'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:axe_steel',
recipe = {
{'default:steel_ingot', 'default:steel_ingot'},
{'group:stick', 'default:steel_ingot'},
{'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:axe_bronze',
recipe = {
{'default:bronze_ingot', 'default:bronze_ingot'},
{'group:stick', 'default:bronze_ingot'},
{'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:axe_mese',
recipe = {
{'default:mese_crystal', 'default:mese_crystal'},
{'group:stick', 'default:mese_crystal'},
{'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:axe_diamond',
recipe = {
{'default:diamond', 'default:diamond'},
{'group:stick', 'default:diamond'},
{'group:stick', ''},
}
})
minetest.register_craft({
output = 'default:sword_wood',
recipe = {
@ -416,7 +477,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'default:sandstonebrick',
output = 'default:sandstonebrick 4',
recipe = {
{'default:sandstone', 'default:sandstone'},
{'default:sandstone', 'default:sandstone'},
@ -520,7 +581,15 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'default:stonebrick',
output = 'default:obsidianbrick 4',
recipe = {
{'default:obsidian', 'default:obsidian'},
{'default:obsidian', 'default:obsidian'}
}
})
minetest.register_craft({
output = 'default:stonebrick 4',
recipe = {
{'default:stone', 'default:stone'},
{'default:stone', 'default:stone'},
@ -528,7 +597,7 @@ minetest.register_craft({
})
minetest.register_craft({
output = 'default:desert_stonebrick',
output = 'default:desert_stonebrick 4',
recipe = {
{'default:desert_stone', 'default:desert_stone'},
{'default:desert_stone', 'default:desert_stone'},
@ -581,6 +650,18 @@ minetest.register_craft({
recipe = "default:cobble",
})
minetest.register_craft({
type = "cooking",
output = "default:stone",
recipe = "default:mossycobble",
})
minetest.register_craft({
type = "cooking",
output = "default:desert_stone",
recipe = "default:desert_cobble",
})
minetest.register_craft({
type = "cooking",
output = "default:steel_ingot",
@ -740,3 +821,10 @@ minetest.register_craft({
recipe = "default:grass_1",
burntime = 2,
})
minetest.register_craft({
type = "fuel",
recipe = "default:pine_sapling",
burntime = 10,
})

View File

@ -14,11 +14,13 @@ minetest.register_craftitem("default:paper", {
minetest.register_craftitem("default:book", {
description = "Book",
inventory_image = "default_book.png",
groups = {book=1},
})
minetest.register_craftitem("default:coal_lump", {
description = "Coal Lump",
inventory_image = "default_coal_lump.png",
groups = {coal = 1}
})
minetest.register_craftitem("default:iron_lump", {
@ -81,11 +83,6 @@ minetest.register_craftitem("default:clay_brick", {
inventory_image = "default_clay_brick.png",
})
minetest.register_craftitem("default:scorched_stuff", {
description = "Scorched Stuff",
inventory_image = "default_scorched_stuff.png",
})
minetest.register_craftitem("default:obsidian_shard", {
description = "Obsidian Shard",
inventory_image = "default_obsidian_shard.png",

View File

@ -40,9 +40,9 @@ end
function default.node_sound_sand_defaults(table)
table = table or {}
table.footstep = table.footstep or
{name="default_sand_footstep", gain=0.5}
{name="default_sand_footstep", gain=0.2}
table.dug = table.dug or
{name="default_sand_footstep", gain=1.0}
{name="default_sand_footstep", gain=0.4}
table.place = table.place or
{name="default_place_node", gain=1.0}
default.node_sound_defaults(table)
@ -64,7 +64,7 @@ function default.node_sound_leaves_defaults(table)
table.footstep = table.footstep or
{name="default_grass_footstep", gain=0.35}
table.dug = table.dug or
{name="default_grass_footstep", gain=0.85}
{name="default_grass_footstep", gain=0.7}
table.dig = table.dig or
{name="default_dig_crumbly", gain=0.4}
table.place = table.place or
@ -83,100 +83,6 @@ function default.node_sound_glass_defaults(table)
return table
end
--
-- Legacy
--
function default.spawn_falling_node(p, nodename)
spawn_falling_node(p, nodename)
end
-- Horrible crap to support old code
-- Don't use this and never do what this does, it's completely wrong!
-- (More specifically, the client and the C++ code doesn't get the group)
function default.register_falling_node(nodename, texture)
minetest.log("error", debug.traceback())
minetest.log('error', "WARNING: default.register_falling_node is deprecated")
if minetest.registered_nodes[nodename] then
minetest.registered_nodes[nodename].groups.falling_node = 1
end
end
--
-- Global callbacks
--
-- Global environment step function
function on_step(dtime)
-- print("on_step")
end
minetest.register_globalstep(on_step)
function on_placenode(p, node)
--print("on_placenode")
end
minetest.register_on_placenode(on_placenode)
function on_dignode(p, node)
--print("on_dignode")
end
minetest.register_on_dignode(on_dignode)
function on_punchnode(p, node)
end
minetest.register_on_punchnode(on_punchnode)
--
-- Grow trees
--
minetest.register_abm({
nodenames = {"default:sapling"},
interval = 10,
chance = 50,
action = function(pos, node)
local nu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
local is_soil = minetest.get_item_group(nu, "soil")
if is_soil == 0 then
return
end
minetest.log("action", "A sapling grows into a tree at "..minetest.pos_to_string(pos))
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map({x=pos.x-16, y=pos.y, z=pos.z-16}, {x=pos.x+16, y=pos.y+16, z=pos.z+16})
local a = VoxelArea:new{MinEdge=minp, MaxEdge=maxp}
local data = vm:get_data()
default.grow_tree(data, a, pos, math.random(1, 4) == 1, math.random(1,100000))
vm:set_data(data)
vm:write_to_map(data)
vm:update_map()
end
})
minetest.register_abm({
nodenames = {"default:junglesapling"},
interval = 10,
chance = 50,
action = function(pos, node)
local nu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
local is_soil = minetest.get_item_group(nu, "soil")
if is_soil == 0 then
return
end
minetest.log("action", "A jungle sapling grows into a tree at "..minetest.pos_to_string(pos))
local vm = minetest.get_voxel_manip()
local minp, maxp = vm:read_from_map({x=pos.x-16, y=pos.y-1, z=pos.z-16}, {x=pos.x+16, y=pos.y+16, z=pos.z+16})
local a = VoxelArea:new{MinEdge=minp, MaxEdge=maxp}
local data = vm:get_data()
default.grow_jungletree(data, a, pos, math.random(1,100000))
vm:set_data(data)
vm:write_to_map(data)
vm:update_map()
end
})
--
-- Lavacooling
--
@ -267,19 +173,21 @@ minetest.register_abm({
})
--
-- Leafdecay
-- dig upwards
--
-- To enable leaf decay for a node, add it to the "leafdecay" group.
function default.dig_up(pos, node, digger)
if digger == nil then return end
local np = {x = pos.x, y = pos.y + 1, z = pos.z}
local nn = minetest.get_node(np)
if nn.name == node.name then
minetest.node_dig(np, nn, digger)
end
end
--
-- The rating of the group determines how far from a node in the group "tree"
-- the node can be without decaying.
-- Leafdecay
--
-- If param2 of the node is ~= 0, the node will always be preserved. Thus, if
-- the player places a node of that kind, you will want to set param2=1 or so.
--
-- If the node is in the leafdecay_drop group then the it will always be dropped
-- as an item
default.leafdecay_trunk_cache = {}
default.leafdecay_enable_cache = true
@ -292,6 +200,12 @@ minetest.register_globalstep(function(dtime)
math.floor(dtime * finds_per_second)
end)
default.after_place_leaves = function(pos, placer, itemstack, pointed_thing)
local node = minetest.get_node(pos)
node.param2 = 1
minetest.set_node(pos, node)
end
minetest.register_abm({
nodenames = {"group:leafdecay"},
neighbors = {"air", "group:liquid"},
@ -346,7 +260,7 @@ minetest.register_abm({
end
if not do_preserve then
-- Drop stuff other than the node itself
itemstacks = minetest.get_node_drops(n0.name)
local itemstacks = minetest.get_node_drops(n0.name)
for _, itemname in ipairs(itemstacks) do
if minetest.get_item_group(n0.name, "leafdecay_drop") ~= 0 or
itemname ~= n0.name then
@ -365,3 +279,42 @@ minetest.register_abm({
end
})
--
-- Grass growing
--
minetest.register_abm({
nodenames = {"default:dirt"},
interval = 2,
chance = 200,
action = function(pos, node)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light")
and nodedef.liquidtype == "none"
and (minetest.get_node_light(above) or 0) >= 13 then
if name == "default:snow" or name == "default:snowblock" then
minetest.set_node(pos, {name = "default:dirt_with_snow"})
else
minetest.set_node(pos, {name = "default:dirt_with_grass"})
end
end
end
})
minetest.register_abm({
nodenames = {"default:dirt_with_grass"},
interval = 2,
chance = 20,
action = function(pos, node)
local above = {x=pos.x, y=pos.y+1, z=pos.z}
local name = minetest.get_node(above).name
local nodedef = minetest.registered_nodes[name]
if name ~= "ignore" and nodedef
and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light")
and nodedef.liquidtype == "none") then
minetest.set_node(pos, {name = "default:dirt"})
end
end
})

283
mods/default/furnace.lua Normal file
View File

@ -0,0 +1,283 @@
--
-- Formspecs
--
local function active_formspec(fuel_percent, item_percent)
local formspec =
"size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_name;src;2.75,0.5;1,1;]"..
"list[current_name;fuel;2.75,2.5;1,1;]"..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:"..
(100-fuel_percent)..":default_furnace_fire_fg.png]"..
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:"..
(item_percent)..":gui_furnace_arrow_fg.png^[transformR270]"..
"list[current_name;dst;4.75,0.96;2,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
default.get_hotbar_bg(0, 4.25)
return formspec
end
local inactive_formspec =
"size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_name;src;2.75,0.5;1,1;]"..
"list[current_name;fuel;2.75,2.5;1,1;]"..
"image[2.75,1.5;1,1;default_furnace_fire_bg.png]"..
"image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"list[current_name;dst;4.75,0.96;2,2;]"..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
default.get_hotbar_bg(0, 4.25)
--
-- Node callback functions that are the same for active and inactive furnace
--
local function can_dig(pos, player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("fuel") and inv:is_empty("dst") and inv:is_empty("src")
end
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
if listname == "fuel" then
if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then
if inv:is_empty("src") then
meta:set_string("infotext", "Furnace is empty")
end
return stack:get_count()
else
return 0
end
elseif listname == "src" then
return stack:get_count()
elseif listname == "dst" then
return 0
end
end
local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()
local stack = inv:get_stack(from_list, from_index)
return allow_metadata_inventory_put(pos, to_list, to_index, stack, player)
end
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
if minetest.is_protected(pos, player:get_player_name()) then
return 0
end
return stack:get_count()
end
--
-- Node definitions
--
minetest.register_node("default:furnace", {
description = "Furnace",
tiles = {
"default_furnace_top.png", "default_furnace_bottom.png",
"default_furnace_side.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_front.png"
},
paramtype2 = "facedir",
groups = {cracky=2},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
})
minetest.register_node("default:furnace_active", {
description = "Furnace",
tiles = {
"default_furnace_top.png", "default_furnace_bottom.png",
"default_furnace_side.png", "default_furnace_side.png",
"default_furnace_side.png",
{
image = "default_furnace_front_active.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 1.5
},
}
},
paramtype2 = "facedir",
light_source = 8,
drop = "default:furnace",
groups = {cracky=2, not_in_creative_inventory=1},
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_stone_defaults(),
can_dig = can_dig,
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
})
--
-- ABM
--
local function swap_node(pos, name)
local node = minetest.get_node(pos)
if node.name == name then
return
end
node.name = name
minetest.swap_node(pos, node)
end
minetest.register_abm({
nodenames = {"default:furnace", "default:furnace_active"},
interval = 1.0,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
--
-- Inizialize metadata
--
local meta = minetest.get_meta(pos)
local fuel_time = meta:get_float("fuel_time") or 0
local src_time = meta:get_float("src_time") or 0
local fuel_totaltime = meta:get_float("fuel_totaltime") or 0
--
-- Inizialize inventory
--
local inv = meta:get_inventory()
for listname, size in pairs({
src = 1,
fuel = 1,
dst = 4,
}) do
if inv:get_size(listname) ~= size then
inv:set_size(listname, size)
end
end
local srclist = inv:get_list("src")
local fuellist = inv:get_list("fuel")
local dstlist = inv:get_list("dst")
--
-- Cooking
--
-- Check if we have cookable content
local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist})
local cookable = true
if cooked.time == 0 then
cookable = false
end
-- Check if we have enough fuel to burn
if fuel_time < fuel_totaltime then
-- The furnace is currently active and has enough fuel
fuel_time = fuel_time + 1
-- If there is a cookable item then check if it is ready yet
if cookable then
src_time = src_time + 1
if src_time >= cooked.time then
-- Place result in dst list if possible
if inv:room_for_item("dst", cooked.item) then
inv:add_item("dst", cooked.item)
inv:set_stack("src", 1, aftercooked.items[1])
src_time = 0
end
end
end
else
-- Furnace ran out of fuel
if cookable then
-- We need to get new fuel
local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist})
if fuel.time == 0 then
-- No valid fuel in fuel list
fuel_totaltime = 0
fuel_time = 0
src_time = 0
else
-- Take fuel from fuel list
inv:set_stack("fuel", 1, afterfuel.items[1])
fuel_totaltime = fuel.time
fuel_time = 0
end
else
-- We don't need to get new fuel since there is no cookable item
fuel_totaltime = 0
fuel_time = 0
src_time = 0
end
end
--
-- Update formspec, infotext and node
--
local formspec = inactive_formspec
local item_state = ""
local item_percent = 0
if cookable then
item_percent = math.floor(src_time / cooked.time * 100)
item_state = item_percent .. "%"
else
if srclist[1]:is_empty() then
item_state = "Empty"
else
item_state = "Not cookable"
end
end
local fuel_state = "Empty"
local active = "inactive "
if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then
active = "active "
local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100)
fuel_state = fuel_percent .. "%"
formspec = active_formspec(fuel_percent, item_percent)
swap_node(pos, "default:furnace_active")
else
if not fuellist[1]:is_empty() then
fuel_state = "0%"
end
swap_node(pos, "default:furnace")
end
local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")"
--
-- Set meta values
--
meta:set_float("fuel_totaltime", fuel_totaltime)
meta:set_float("fuel_time", fuel_time)
meta:set_float("src_time", src_time)
meta:set_string("formspec", formspec)
meta:set_string("infotext", infotext)
end,
})

View File

@ -1,22 +1,46 @@
-- Minetest 0.4 mod: default
-- See README.txt for licensing and other information.
-- The API documentation in here was moved into doc/lua_api.txt
WATER_ALPHA = 160
WATER_VISC = 1
LAVA_VISC = 7
LIGHT_MAX = 14
-- The API documentation in here was moved into game_api.txt
-- Definitions made by this mod that other mods can use too
default = {}
default.LIGHT_MAX = 14
-- GUI related stuff
default.gui_bg = "bgcolor[#080808BB;true]"
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
function default.get_hotbar_bg(x,y)
local out = ""
for i=0,7,1 do
out = out .."image["..x+i..","..y..";1,1;gui_hb_bg.png]"
end
return out
end
default.gui_survival_form = "size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"list[current_player;craft;1.75,0.5;3,3;]"..
"list[current_player;craftpreview;5.75,1.5;1,1;]"..
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
default.get_hotbar_bg(0,4.25)
-- Load files
dofile(minetest.get_modpath("default").."/functions.lua")
dofile(minetest.get_modpath("default").."/nodes.lua")
dofile(minetest.get_modpath("default").."/furnace.lua")
dofile(minetest.get_modpath("default").."/tools.lua")
dofile(minetest.get_modpath("default").."/craftitems.lua")
dofile(minetest.get_modpath("default").."/crafting.lua")
dofile(minetest.get_modpath("default").."/mapgen.lua")
dofile(minetest.get_modpath("default").."/player.lua")
dofile(minetest.get_modpath("default").."/trees.lua")
dofile(minetest.get_modpath("default").."/aliases.lua")
dofile(minetest.get_modpath("default").."/legacy.lua")

25
mods/default/legacy.lua Normal file
View File

@ -0,0 +1,25 @@
-- mods/default/legacy.lua
-- Horrible crap to support old code registering falling nodes
-- Don't use this and never do what this does, it's completely wrong!
-- (More specifically, the client and the C++ code doesn't get the group)
function default.register_falling_node(nodename, texture)
minetest.log("error", debug.traceback())
minetest.log('error', "WARNING: default.register_falling_node is deprecated")
if minetest.registered_nodes[nodename] then
minetest.registered_nodes[nodename].groups.falling_node = 1
end
end
function default.spawn_falling_node(p, nodename)
spawn_falling_node(p, nodename)
end
-- Liquids
WATER_ALPHA = minetest.registered_nodes["default:water_source"].alpha
WATER_VISC = minetest.registered_nodes["default:water_source"].liquid_viscosity
LAVA_VISC = minetest.registered_nodes["default:lava_source"].liquid_viscosity
LIGHT_MAX = default.LIGHT_MAX
-- Formspecs
default.gui_suvival_form = default.gui_survival_form

View File

@ -207,69 +207,6 @@ minetest.register_ore({
flags = "absheight",
})
if minetest.setting_get("mg_name") == "indev" then
-- Floatlands and high mountains springs
minetest.register_ore({
ore_type = "scatter",
ore = "default:water_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 40*40*40,
clust_num_ores = 8,
clust_size = 3,
height_min = 100,
height_max = 31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:lava_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 50*50*50,
clust_num_ores = 5,
clust_size = 2,
height_min = 10000,
height_max = 31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:sand",
wherein = "default:stone",
clust_scarcity = 20*20*20,
clust_num_ores = 5*5*3,
clust_size = 5,
height_min = 500,
height_max = 31000,
})
-- Underground springs
minetest.register_ore({
ore_type = "scatter",
ore = "default:water_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 25*25*25,
clust_num_ores = 8,
clust_size = 3,
height_min = -10000,
height_max = -10,
})
minetest.register_ore({
ore_type = "scatter",
ore = "default:lava_source",
ore_param2 = 128,
wherein = "default:stone",
clust_scarcity = 35*35*35,
clust_num_ores = 5,
clust_size = 2,
height_min = -31000,
height_max = -100,
})
end
minetest.register_ore({
ore_type = "scatter",
ore = "default:clay",
@ -323,6 +260,12 @@ function default.generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume
--print("generate_ore done")
end
--
-- Mgv6 papyrus, cactus, long grasses
--
function default.mgv6_ongen(minp, maxp, seed)
function default.make_papyrus(pos, size)
for y=0,size-1 do
local p = {x=pos.x, y=pos.y+y, z=pos.z}
@ -349,55 +292,6 @@ function default.make_cactus(pos, size)
end
end
-- facedir: 0/1/2/3 (head node facedir value)
-- length: length of rainbow tail
function default.make_nyancat(pos, facedir, length)
local tailvec = {x=0, y=0, z=0}
if facedir == 0 then
tailvec.z = 1
elseif facedir == 1 then
tailvec.x = 1
elseif facedir == 2 then
tailvec.z = -1
elseif facedir == 3 then
tailvec.x = -1
else
--print("default.make_nyancat(): Invalid facedir: "+dump(facedir))
facedir = 0
tailvec.z = 1
end
local p = {x=pos.x, y=pos.y, z=pos.z}
minetest.set_node(p, {name="default:nyancat", param2=facedir})
for i=1,length do
p.x = p.x + tailvec.x
p.z = p.z + tailvec.z
minetest.set_node(p, {name="default:nyancat_rainbow", param2=facedir})
end
end
function generate_nyancats(seed, minp, maxp)
local height_min = -31000
local height_max = -32
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed + 9324342)
local max_num_nyancats = math.floor(volume / (16*16*16))
for i=1,max_num_nyancats do
if pr:next(0, 1000) == 0 then
local x0 = pr:next(minp.x, maxp.x)
local y0 = pr:next(minp.y, maxp.y)
local z0 = pr:next(minp.z, maxp.z)
local p0 = {x=x0, y=y0, z=z0}
default.make_nyancat(p0, pr:next(0,3), pr:next(3,15))
end
end
end
minetest.register_on_generated(function(minp, maxp, seed)
if maxp.y >= 2 and minp.y <= 0 then
-- Generate papyrus
local perlin1 = minetest.get_perlin(354, 3, 0.7, 100)
@ -507,7 +401,311 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
end
-- Generate nyan cats
generate_nyancats(seed, minp, maxp)
end)
end
--
-- Generate nyan cats in all mapgens
--
-- facedir: 0/1/2/3 (head node facedir value)
-- length: length of rainbow tail
function default.make_nyancat(pos, facedir, length)
local tailvec = {x=0, y=0, z=0}
if facedir == 0 then
tailvec.z = 1
elseif facedir == 1 then
tailvec.x = 1
elseif facedir == 2 then
tailvec.z = -1
elseif facedir == 3 then
tailvec.x = -1
else
--print("default.make_nyancat(): Invalid facedir: "+dump(facedir))
facedir = 0
tailvec.z = 1
end
local p = {x=pos.x, y=pos.y, z=pos.z}
minetest.set_node(p, {name="default:nyancat", param2=facedir})
for i=1,length do
p.x = p.x + tailvec.x
p.z = p.z + tailvec.z
minetest.set_node(p, {name="default:nyancat_rainbow", param2=facedir})
end
end
function default.generate_nyancats(minp, maxp, seed)
local height_min = -31000
local height_max = -32
if maxp.y < height_min or minp.y > height_max then
return
end
local y_min = math.max(minp.y, height_min)
local y_max = math.min(maxp.y, height_max)
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
local pr = PseudoRandom(seed + 9324342)
local max_num_nyancats = math.floor(volume / (16*16*16))
for i=1,max_num_nyancats do
if pr:next(0, 1000) == 0 then
local x0 = pr:next(minp.x, maxp.x)
local y0 = pr:next(minp.y, maxp.y)
local z0 = pr:next(minp.z, maxp.z)
local p0 = {x=x0, y=y0, z=z0}
default.make_nyancat(p0, pr:next(0,3), pr:next(3,15))
end
end
end
minetest.register_on_generated(default.generate_nyancats)
--
-- Register biomes
--
function default.register_biomes()
minetest.clear_registered_biomes()
-- Temperate biomes
minetest.register_biome({
name = "grassland",
node_top = "default:dirt_with_grass",
node_shore_top = "default:sand",
depth_top = 1,
node_filler = "default:dirt",
node_shore_filler = "default:sand",
depth_filler = 2,
height_shore = 3,
node_underwater = "default:sand",
--node_stone = "",
--node_water_top = "",
--depth_water_top = ,
--node_water = "",
--node_dust = "",
y_min = -32000,
y_max = 32000,
heat_point = 50,
humidity_point = 50,
})
--
-- Register decorations
--
-- Grassland
-- Flowers
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 436,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "flowers:rose",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 19822,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "flowers:tulip",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 1220999,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "flowers:dandelion_yellow",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 36662,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "flowers:geranium",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 1133,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "flowers:viola",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.015,
scale = 0.03,
spread = {x=100, y=100, z=100},
seed = 73133,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "flowers:dandelion_white",
})
-- Grasses
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.04,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "default:grass_1",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0.02,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "default:grass_2",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = 0,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "default:grass_3",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.02,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "default:grass_4",
})
minetest.register_decoration({
deco_type = "simple",
place_on = {"default:dirt_with_grass"},
sidelen = 16,
noise_params = {
offset = -0.04,
scale = 0.08,
spread = {x=100, y=100, z=100},
seed = 66440,
octaves = 3,
persist = 0.6
},
biomes = {"grassland"},
y_min = -32000,
y_max = 32000,
decoration = "default:grass_5",
})
end
--
-- Detect mapgen and select suitable biome code
--
local mg_params = minetest.get_mapgen_params()
if mg_params.mgname == "v6" then
minetest.register_on_generated(default.mgv6_ongen)
else
default.register_biomes()
end

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,55 +1,6 @@
-- Minetest 0.4 mod: player
-- See README.txt for licensing and other information.
--[[
API
---
default.player_register_model(name, def)
^ Register a new model to be used by players.
^ <name> is the model filename such as "character.x", "foo.b3d", etc.
^ See Model Definition below for format of <def>.
default.registered_player_models[name]
^ See Model Definition below for format.
default.player_set_model(player, model_name)
^ <player> is a PlayerRef.
^ <model_name> is a model registered with player_register_model.
default.player_set_animation(player, anim_name [, speed])
^ <player> is a PlayerRef.
^ <anim_name> is the name of the animation.
^ <speed> is in frames per second. If nil, default from the model is used
default.player_set_textures(player, textures)
^ <player> is a PlayerRef.
^ <textures> is an array of textures
^ If <textures> is nil, the default textures from the model def are used
default.player_get_animation(player)
^ <player> is a PlayerRef.
^ Returns a table containing fields "model", "textures" and "animation".
^ Any of the fields of the returned table may be nil.
Model Definition
----------------
model_def = {
animation_speed = 30, -- Default animation speed, in FPS.
textures = {"character.png", }, -- Default array of textures.
visual_size = {x=1, y=1,}, -- Used to scale the model.
animations = {
-- <anim_name> = { x=<start_frame>, y=<end_frame>, },
foo = { x= 0, y=19, },
bar = { x=20, y=39, },
-- ...
},
}
]]
-- Player animation blending
-- Note: This is currently broken due to a bug in Irrlicht, leave at 0
local animation_blend = 0
@ -84,6 +35,7 @@ local player_model = {}
local player_textures = {}
local player_anim = {}
local player_sneak = {}
default.player_attached = {}
function default.player_get_animation(player)
local name = player:get_player_name()
@ -140,7 +92,16 @@ end
-- Update appearance when the player joins
minetest.register_on_joinplayer(function(player)
default.player_attached[player:get_player_name()] = false
default.player_set_model(player, "character.x")
player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30)
-- set GUI
if not minetest.setting_getbool("creative_mode") then
player:set_inventory_formspec(default.gui_survival_form)
end
player:hud_set_hotbar_image("gui_hotbar.png")
player:hud_set_hotbar_selected_image("gui_hotbar_selected.png")
end)
minetest.register_on_leaveplayer(function(player)
@ -152,6 +113,7 @@ end)
-- Localize for better performance.
local player_set_animation = default.player_set_animation
local player_attached = default.player_attached
-- Check each player and apply animations
minetest.register_globalstep(function(dtime)
@ -159,7 +121,7 @@ minetest.register_globalstep(function(dtime)
local name = player:get_player_name()
local model_name = player_model[name]
local model = model_name and models[model_name]
if model then
if model and not player_attached[name] then
local controls = player:get_player_control()
local walking = false
local animation_speed_mod = model.animation_speed or 30

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 B

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 B

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 639 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 B

After

Width:  |  Height:  |  Size: 596 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

After

Width:  |  Height:  |  Size: 232 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 649 B

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 B

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 761 B

After

Width:  |  Height:  |  Size: 630 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 864 B

After

Width:  |  Height:  |  Size: 670 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 B

After

Width:  |  Height:  |  Size: 576 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 B

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 251 B

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 585 B

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 608 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 233 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 B

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 670 B

After

Width:  |  Height:  |  Size: 647 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 367 B

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

After

Width:  |  Height:  |  Size: 516 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 397 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

After

Width:  |  Height:  |  Size: 659 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 913 B

After

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 482 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 B

After

Width:  |  Height:  |  Size: 289 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 803 B

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 628 B

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 826 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

After

Width:  |  Height:  |  Size: 578 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 978 B

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 B

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 B

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 794 B

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

After

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 B

After

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 313 B

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 B

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 B

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 278 B

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 490 B

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 253 B

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 758 B

After

Width:  |  Height:  |  Size: 736 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 834 B

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 254 B

After

Width:  |  Height:  |  Size: 297 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 355 B

After

Width:  |  Height:  |  Size: 703 B

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