634 Commits

Author SHA1 Message Date
Auke Kok
b37d266632 New timer design.
I could honestly not make much sense of the timer implementation
that was here. Instead I've implemented the type of timer algorithm
that I've used before, and tested it instead.

The concept is extremely simple: all timers are put in an ordered
list. We check every server tick if any of the timers have
elapsed, and execute the function associated with this timer.

We know that many timers by themselves cause new timers to be
added to this list, so we iterate *backwards* over the timer
list. This means that new timers being added while timers are
being executed, can never be executed in the same function pass,
as they are always appended to the table *after* the end of
the table, which we will never reach in the current pass over
all the table elements.

We switch time keeping to minetest.get_us_time(). dtime is
likely unreliable and we have our own high-res timer that we
can fix if it is indeed broken. This removes the need to do
any sort of time keeping.
2016-01-29 01:04:51 -05:00
Auke Kok
fcec96372d Clocksource: use a better clock if available.
clock_gettime() is a far better clock than gettimeofday().

Even better than clock_gettime() is that you can select either
CLOCK_MONOTONIC, or even CLOCK_MONOTONIC_RAW. These clocks offer
high precision time. And the _RAW variant will never roll back
due to NTP drift or daylight savings, or otherwise.

I've adjusted this code to select the right clock method auto-
matically based on what's available in the OS. This means that
if you're running a very old linux version, MacOS or other,
you will automatically get the best clocksource available.

I've tested all Linux clocksources by selectively compiling and
running a 10k+ timer test suite. In all cases I confirmed that
the 3 POSIX Linux clocksources worked properly, and were
selected properly.

I've modified the OS X compile path to use the high-res clock
source for all time functions, but I can't confirm it works or
that it compiles.

As for WIN32, I confirmed that the used clocksource is indeed
a Monotonic clocksource, so good news: that code section appears
to be exactly what it should be.
2016-01-29 00:58:08 -05:00
Auke Kok
7fa4045b59 Allow per-tiles culling.
Backface culling is enabled by default for all tiles, as this
is how the lua parser initializes each tiledef. We revert to
always using the value from the tiledef since it is always
read and serialized.

Mods that wish to enable culling for e.g. mesh nodes, now can
specify the following to enable backface culling:

    tiles = {{ name = "tex.png", backface_culling = true }},

Note the double '{' and use of 'name' key here! In the same
fashion, backface_culling can be disabled for any node now.

I've tested this against the new door models and this properly
allows me to disable culling per node. I've also tested this
against my crops mod which uses mesh nodes where culling needs
to be disabled, and tested also with plantlike drawtype nodes
where we want this to continue to be disabled.

No default setting has changed. The defaults are just migrated
from nodedef.cpp to c_content.cpp.
2016-01-20 00:36:48 +00:00
RealBadAngel
40ce082cfb Show infotext with description for item entities 2016-01-18 17:21:41 +00:00
Pinky Snow
c4a877903b corrected minetest.pos_to_string()
corrected this bit reflect the function properly.
2016-01-16 13:06:41 +00:00
paramat
a50cbcb7f6 Mapgen: Various fixes and improvements
Lua_api.txt: Document 'minetest.registered_biomes'
Minimal: Remove 'mapgen_air' alias
Cavegen: Add fallback node for 'mapgen_ice'
Dungeongen: Add fallback node for 'mapgen_river_water_source'
Mgv5: Remove unnecessary '#include util/directiontables.h'
Add missing 'this->'s in makeChunk()
Mgv6: Edit empty line formatting
Remove leading spaces in makeChunk()
Add missing spaces after 'for' and 'if'
Mgv7: Edit empty line formatting
2016-01-11 01:32:20 +00:00
Pinky Snow
d17619fb09 fixed spelling
Fixed spelling mistake!
2016-01-09 02:29:07 +00:00
Robert Zenz
931463a1f9 Clarified what get_node does. 2016-01-09 01:07:03 +00:00
slemonide
41b0bfff33 Update lua_api.txt
set_sky does work with on_joinplayer
2016-01-09 01:06:45 +00:00
paramat
ce609f9e68 Liquids: Flow into and destroy 'floodable' nodes
Add new node property 'floodable', default false
Define "air" as floodable = true in C++ and lua
2016-01-07 05:57:19 +00:00
Robert Zenz
33956c3d39 Made it more clear that "[combine" does accept a list of files. 2016-01-03 01:05:04 +01:00
Maksim Gamarnik
23614e9479 Merge
I have not tested this
2015-12-28 11:26:50 +02:00
Sapier
ff88067514 Add missing documentation of automatic_face_movement_max_rotation_per_sec entity parameter 2015-12-25 14:11:39 +01:00
BlockMen
8b2e696093 Add option to give every object a nametag
or change the nametag text of players
2015-12-15 23:32:19 +01:00
Maksim Gamarnik
ba2e36fd37 Merge 2015-12-09 12:56:21 +02:00
est31
32a68076a2 lua_api.txt: add blank lines before * lists
If rendered as markdown, lists need a blank line before them
so that they are recognized as such.
2015-12-07 07:27:51 +01:00
paramat
26728947bc Mapgen: Add propagate_shadow bool to calcLighting
To terminate unwanted shadows from floatlands or realms above
Also add to LuaVoxelManip calc_lighting for use in mapgen mods
Remove the 2 argument calcLighting, mapgens now use the 5
argument form to specify the volumes for propagateSunlight and
spreadLight
In mgsinglenode replace calcLighting with setLighting and
clean-up use of tabs and spaces
2015-12-07 03:18:24 +00:00
Maksim Gamarnik
1797862bf9 Merge 2015-12-06 15:00:12 +02:00
Jun Zhang
3c28fc24a8 Fix spelling of noise_threshold 2015-12-06 11:38:03 +01:00
est31
ee0564abf5 Document limitations of minetest.get_password_hash 2015-12-02 18:32:14 +01:00
Alex Ford
3d8a7bc124 Add on_secondary_use when right clicking an item in the air 2015-12-02 02:18:44 +00:00
paramat
6daea5adfc Lua_api.txt: Add documentation for biome definition 2015-11-29 21:55:58 +00:00
Maksim Gamarnik
bcf249297c Merge last Minetest commits 2015-11-10 20:29:00 +02:00
Maksim Gamarnik
919be490f9 Update
Sync all Minetest commits
2015-11-10 13:49:24 +02:00
est31
a61208d92d Add LuaSecureRandom 2015-11-08 15:57:15 -05:00
kwolekr
897caf3178 Improve LuaVoxelManip documentation 2015-11-07 11:59:24 -05:00
BlockMen
7477ba044c Add support for audio feedback if placing node failed 2015-11-07 13:23:38 +01:00
kwolekr
d93a706ccb Schematics: Add core.place_schematic_on_vmanip API
Fix memory leak in minetest.place_schematic
Slightly refactor Schematic code
2015-11-05 01:18:32 -05:00
kwolekr
4072700558 Add callback parameter for core.emerge_area() 2015-11-02 18:43:09 -05:00
BlockMen
0e8e40eaa9 Add option to disable backface culling for models
- Disabled by default (except players)
- Fixes #2984
2015-10-25 12:06:08 +01:00
PilzAdam
2fb30ef4d3 Improve Lua settings menu
* Add key settings to setting table and ignore them later
  This way they are added to the auto-generated minetest.conf.example
* Add flags type
* Add input validation for int, float and flags
* Break in-game graphic settings into multiple sections
* Parse settingtpes.txt in mods and games
* Improve description for a lot of settings
* Fix typos and wording in settingtypes.txt
* Convert language setting to an enum
2015-10-24 19:39:15 +02:00
paramat
ae975d7c91 Decoration API: Add flag for placement on liquid surface
Add findLiquidSurface() function to mapgen.cpp
Update lua_api.txt
2015-10-23 21:30:20 +01:00
Robert Zenz
b52fd16e28 Add more ways to pass data to check_player_privs
The callback can now be invoked with either the player object or name as
the first parameter, and with either a table or a list of strings, like
this:

    minetest.check_player_privs(player_name, { shout = true, fly = true })
    minetest.check_player_privs(player_name, "shout", "fly")
    minetest.check_player_privs(player, { shout = true, fly = true })
    minetest.check_player_privs(player, "shout", "fly")
2015-10-22 19:55:48 +02:00
paramat
d21809ec2e ABMs: Make catch-up behaviour optional
Default is true for backwards compatibility
Update lua_api.txt
2015-10-18 16:42:59 +01:00
ShadowNinja
677ab7463d Refactor logging
- Add warning log level
- Change debug_log_level setting to enumeration string
- Map Irrlicht log events to MT log events
- Encapsulate log_* functions and global variables into a class, Logger
- Unify dstream with standard logging mechanism
- Unify core.debug() with standard core.log() script API
2015-10-14 01:03:54 -04:00
est31
e2613ec422 Add new ContentParamType2 "CPT2_DEGROTATE"
This might break some mods, but it is important for all uses of the param2 to
be documented.

This doesn't need a serialisation version or network protocol version change,
as old clients will still work on new servers, and it is bearable to have
new clients getting non rotated plants on old servers.
2015-10-04 23:59:41 +02:00
kwolekr
726f62097c doc: Update node callback documentation 2015-10-04 15:34:56 -04:00
Duane Robertson
3416bf155f Add get_biome_id(biome_name) callback
It returns the index used in mg->biomemap for a given biome name.
The biomemap is useless without this unless you re-register all existing biomes,
which could cause problems for anyone else trying to use biomemap.
With this, you can quickly create a lookup table of ids and names.
2015-10-02 22:49:31 +02:00
Tim
0b892a0499 Clarify radii and distance types in documentation
Because not all circles are round:
* circles using an euclidean metric are what we usually call "round"
* circles using a maximum metric look like euclidean rectangles with equal adjacent sides (squares)
* circles using a manhattan metric look like an euclidean right angled rhombus (squares, but 45° rotated to the former one)

[ci skip]
2015-09-26 21:28:50 +02:00
kwolekr
23316c9f92 Add /emergeblocks command and core.emerge_area() Lua API 2015-09-23 15:56:24 -04:00
est31
3b175acadd lua_api.txt: fix typo
Thanks to @kaadmy (NeD) for pointing this out.
2015-09-21 18:10:05 +02:00
kwolekr
6831884d5c Ore: Add puff ore type 2015-09-17 03:04:50 -04:00
kwolekr
f24947f903 Ore: Add ore sheet column height range selection
Modders are now able to select the range of ore column height,
and the midpoint at which they 'grow' starting from.
This commit adds three new parameters for the 'sheet' ore type:
column_height_min, column_height_max, and column_midpoint_factor.
clust_size is now deprecated for this ore type.
2015-09-13 00:11:50 -04:00
Robert Zenz
cd033fc5f4 Add more information about how get_node_light works. 2015-09-08 21:14:56 +02:00
est31
9721b4cf60 Bump version to 0.4.13 2015-08-20 04:02:00 +02:00
kwolekr
925187a32b minimap: Add ability to disable from server 2015-08-13 15:05:48 -04:00
rubenwardy
3a5596ccc8 Fix segfaults caused by the Environment not being initialized yet 2015-08-09 23:36:55 +02:00
est31
2bebf6466b Actually document what minetest.is_protected should do 2015-08-02 19:09:55 +02:00
est31
d4a7cfcd71 Add AreaStore data structure 2015-07-27 06:42:56 +02:00
est31
713002778f Optional reconnect functionality
Enable the server to request the client to reconnect.

This can be done with the now extended minetest.request_shutdown([reason], [reconnect]) setting.
2015-07-23 07:38:13 +02:00