minetest-australopithecus-s.../doc/index.html

595 lines
12 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>Reference</title>
<link rel="stylesheet" href="ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>ldoc</h1>
<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><strong>spawnusher</strong></li>
</ul>
</div>
<div id="content">
<h1>Module <code>spawnusher</code></h1>
<p>Spawn usher is a system that allows to correct the spawn position of players
without knowing anything about the mapgen.</p>
<p>
<p> The system will register callbacks for newplayer and respawnplayer and will
try to find an air bubble, either upwards or downwards, which the player can
fit into. If an air bubble is found, the player will be moved there. If
the block is not loaded, it will be tried again after a certain amount of
time.
<p> The only function that should be called from clients is activate.</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#activate">activate ()</a></td>
<td class="summary">Activates the spawn usher system, if it has not been deactivated by
a seeting in the configuration.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#activate_internal">activate_internal ()</a></td>
<td class="summary">Activates the system, without checking the configuration.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#is_air_bubble">is_air_bubble (start_pos)</a></td>
<td class="summary">Tests if the given position is an air bubble big enough.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#move_later">move_later (player, current_pos)</a></td>
<td class="summary">Schedules the player to be moved later.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#move_random">move_random (player)</a></td>
<td class="summary">Moves the player randomly on the x and z plane.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#move_player">move_player (player)</a></td>
<td class="summary">Moves the player to a safe location.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#move_players">move_players ()</a></td>
<td class="summary">Move all players that could not be placed so far.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#on_spawn_player">on_spawn_player (player)</a></td>
<td class="summary">Callback for if a player spawns.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#register_after_spawn_callback">register_after_spawn_callback (callback)</a></td>
<td class="summary">Allows to register callbacks after a player has been spawned by spawn usher.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#register_spawnpoint_provider">register_spawnpoint_provider (provider)</a></td>
<td class="summary">Allows to register providers that are called after the final position of
the player has been determined.</td>
</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#physics_override">physics_override</a></td>
<td class="summary">The physics override that is set to make the player inmovable.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#player_physics">player_physics</a></td>
<td class="summary">The original physics of the payers.</td>
</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#activate_automatically">activate_automatically</a></td>
<td class="summary">If the system should be activated automatically.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#active">active</a></td>
<td class="summary">If the system is active/has been activated.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#after_spawn_callbacks">after_spawn_callbacks</a></td>
<td class="summary">The list of callbacks that are invoked after the player has been placed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#players">players</a></td>
<td class="summary">The list of players that need to be placed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#random_direction">random_direction</a></td>
<td class="summary">If the player should be facing a random direction after spawning.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#random_placement_radius">random_placement_radius</a></td>
<td class="summary">The placement radius around the spawn.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#required_bubble_size">required_bubble_size</a></td>
<td class="summary">The required air bubble size.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#retry_time">retry_time</a></td>
<td class="summary">The retry time.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#scheduled">scheduled</a></td>
<td class="summary">If the system is currently scheduled for execution.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#spawnpoint">spawnpoint</a></td>
<td class="summary">The spawnpoint that is configured.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#spawnpoint_providers">spawnpoint_providers</a></td>
<td class="summary">The registered spawnpoint providers.</td>
</tr>
</table>
<br/>
<br/>
<h2><a name="Functions"></a>Functions</h2>
<dl class="function">
<dt>
<a name = "activate"></a>
<strong>activate ()</strong>
</dt>
<dd>
Activates the spawn usher system, if it has not been deactivated by
a seeting in the configuration.
</dd>
<dt>
<a name = "activate_internal"></a>
<strong>activate_internal ()</strong>
</dt>
<dd>
Activates the system, without checking the configuration. Multiple
invokations have no effect.
</dd>
<dt>
<a name = "is_air_bubble"></a>
<strong>is_air_bubble (start_pos)</strong>
</dt>
<dd>
Tests if the given position is an air bubble big enough.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">start_pos</span>
The position at which to check.
</li>
</ul>
<h3>Returns:</h3>
<ol>
true if at the given position is an air bubble big enough.
</ol>
</dd>
<dt>
<a name = "move_later"></a>
<strong>move_later (player, current_pos)</strong>
</dt>
<dd>
Schedules the player to be moved later. Also moves the player to the given
position.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
The player object.
</li>
<li><span class="parameter">current_pos</span>
The current position to which the player will be moved.
</li>
</ul>
</dd>
<dt>
<a name = "move_random"></a>
<strong>move_random (player)</strong>
</dt>
<dd>
Moves the player randomly on the x and z plane.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
The Player object to move.
</li>
</ul>
</dd>
<dt>
<a name = "move_player"></a>
<strong>move_player (player)</strong>
</dt>
<dd>
Moves the player to a safe location.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
The player object.
</li>
</ul>
</dd>
<dt>
<a name = "move_players"></a>
<strong>move_players ()</strong>
</dt>
<dd>
Move all players that could not be placed so far.
</dd>
<dt>
<a name = "on_spawn_player"></a>
<strong>on_spawn_player (player)</strong>
</dt>
<dd>
Callback for if a player spawns.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">player</span>
The Player that spawned.
</li>
</ul>
<h3>Returns:</h3>
<ol>
true, to disable default placement.
</ol>
</dd>
<dt>
<a name = "register_after_spawn_callback"></a>
<strong>register_after_spawn_callback (callback)</strong>
</dt>
<dd>
Allows to register callbacks after a player has been spawned by spawn usher.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">callback</span>
The callback to invoke, a function that accepts the player
object as first parameter and the spawn point as second.
</li>
</ul>
</dd>
<dt>
<a name = "register_spawnpoint_provider"></a>
<strong>register_spawnpoint_provider (provider)</strong>
</dt>
<dd>
Allows to register providers that are called after the final position of
the player has been determined. The provider can return a different position,
or nil if it is happy with the given position, and if it is is the exact
position or not.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">provider</span>
The provider. A function that accepts two parameters,
the Player object and the spawn position that the system
calculated. It can return a new position, a table with
x y z values, or nil if the position should not be changed.
The second return value can be true to make the system use
the provided position without looking for an air bubble.
</li>
</ul>
</dd>
</dl>
<h2><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "physics_override"></a>
<strong>physics_override</strong>
</dt>
<dd>
The physics override that is set to make the player inmovable.
<h3>Fields:</h3>
<ul>
<li><span class="parameter">speed</span>
</li>
<li><span class="parameter">jump</span>
</li>
<li><span class="parameter">gravity</span>
</li>
<li><span class="parameter">sneak</span>
</li>
<li><span class="parameter">sneak_glitch</span>
</li>
</ul>
</dd>
<dt>
<a name = "player_physics"></a>
<strong>player_physics</strong>
</dt>
<dd>
The original physics of the payers.
</dd>
</dl>
<h2><a name="Fields"></a>Fields</h2>
<dl class="function">
<dt>
<a name = "activate_automatically"></a>
<strong>activate_automatically</strong>
</dt>
<dd>
If the system should be activated automatically.
</dd>
<dt>
<a name = "active"></a>
<strong>active</strong>
</dt>
<dd>
If the system is active/has been activated.
</dd>
<dt>
<a name = "after_spawn_callbacks"></a>
<strong>after_spawn_callbacks</strong>
</dt>
<dd>
The list of callbacks that are invoked after the player has been placed.
</dd>
<dt>
<a name = "players"></a>
<strong>players</strong>
</dt>
<dd>
The list of players that need to be placed.
</dd>
<dt>
<a name = "random_direction"></a>
<strong>random_direction</strong>
</dt>
<dd>
If the player should be facing a random direction after spawning.
</dd>
<dt>
<a name = "random_placement_radius"></a>
<strong>random_placement_radius</strong>
</dt>
<dd>
The placement radius around the spawn.
</dd>
<dt>
<a name = "required_bubble_size"></a>
<strong>required_bubble_size</strong>
</dt>
<dd>
The required air bubble size.
</dd>
<dt>
<a name = "retry_time"></a>
<strong>retry_time</strong>
</dt>
<dd>
The retry time.
</dd>
<dt>
<a name = "scheduled"></a>
<strong>scheduled</strong>
</dt>
<dd>
If the system is currently scheduled for execution.
</dd>
<dt>
<a name = "spawnpoint"></a>
<strong>spawnpoint</strong>
</dt>
<dd>
The spawnpoint that is configured.
</dd>
<dt>
<a name = "spawnpoint_providers"></a>
<strong>spawnpoint_providers</strong>
</dt>
<dd>
The registered spawnpoint providers.
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>