342 lines
8.9 KiB
HTML
342 lines
8.9 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>utils</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>utils</h1>
|
|
|
|
<ul>
|
|
<li><a href="../index.html">Index</a></li>
|
|
</ul>
|
|
|
|
<h2>Contents</h2>
|
|
<ul>
|
|
<li><a href="#Functions">Functions</a></li>
|
|
<li><a href="#Fields">Fields</a></li>
|
|
</ul>
|
|
|
|
|
|
<h2>Modules</h2>
|
|
<ul class="$(kind=='Topics' and '' or 'nowrap'">
|
|
<li><a href="../modules/stringutil.html">stringutil</a></li>
|
|
<li><a href="../modules/random.html">random</a></li>
|
|
<li><a href="../modules/noisemanager.html">noisemanager</a></li>
|
|
<li><a href="../modules/nodeutil.html">nodeutil</a></li>
|
|
<li><a href="../modules/posutil.html">posutil</a></li>
|
|
<li><a href="../modules/objectrefutil.html">objectrefutil</a></li>
|
|
<li><a href="../modules/nodeboxutil.html">nodeboxutil</a></li>
|
|
<li><a href="../modules/mapmanipulator.html">mapmanipulator</a></li>
|
|
<li><a href="../modules/fisheryates.html">fisheryates</a></li>
|
|
<li><a href="../modules/textureutil.html">textureutil</a></li>
|
|
<li><a href="../modules/blockutil.html">blockutil</a></li>
|
|
<li><a href="../modules/tango.html">tango</a></li>
|
|
<li><a href="../modules/arraymanipulator.html">arraymanipulator</a></li>
|
|
<li><a href="../modules/inventoryutil.html">inventoryutil</a></li>
|
|
<li><a href="../modules/entityutil.html">entityutil</a></li>
|
|
<li><a href="../modules/scheduler.html">scheduler</a></li>
|
|
<li><a href="../modules/blockedcache.html">blockedcache</a></li>
|
|
<li><a href="../modules/mathutil.html">mathutil</a></li>
|
|
<li><a href="../modules/log.html">log</a></li>
|
|
<li><a href="../modules/arrayutil.html">arrayutil</a></li>
|
|
<li><a href="../modules/directmapmanipulator.html">directmapmanipulator</a></li>
|
|
<li><a href="../modules/rotationutil.html">rotationutil</a></li>
|
|
<li><a href="../modules/settings.html">settings</a></li>
|
|
<li><a href="../modules/pathutil.html">pathutil</a></li>
|
|
<li><a href="../modules/wallmountedutil.html">wallmountedutil</a></li>
|
|
<li><a href="../modules/interpolate.html">interpolate</a></li>
|
|
<li><a href="../modules/transform.html">transform</a></li>
|
|
<li><a href="../modules/numberutil.html">numberutil</a></li>
|
|
<li><a href="../modules/test.html">test</a></li>
|
|
<li><a href="../modules/facedirutil.html">facedirutil</a></li>
|
|
<li><a href="../modules/constants.html">constants</a></li>
|
|
<li><a href="../modules/minetestex.html">minetestex</a></li>
|
|
<li><a href="../modules/list.html">list</a></li>
|
|
<li><a href="../modules/stopwatch.html">stopwatch</a></li>
|
|
<li><strong>itemutil</strong></li>
|
|
<li><a href="../modules/color.html">color</a></li>
|
|
<li><a href="../modules/tableutil.html">tableutil</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="content">
|
|
|
|
<h1>Module <code>itemutil</code></h1>
|
|
<p>Provides various utility functions for working with items.</p>
|
|
<p></p>
|
|
|
|
|
|
<h2><a href="#Functions">Functions</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#blop">blop (position_or_object, itemstrings_or_stacks, x_strength, y_strength, z_strength, split_mode)</a></td>
|
|
<td class="summary">"Blops" the item into existence at the given position and assigns it
|
|
a random velocity/acceleration.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#get_itemstring">get_itemstring (item)</a></td>
|
|
<td class="summary">Gets the item string from the given item.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#split">split (itemstring_or_itemstack, split_mode)</a></td>
|
|
<td class="summary">Splits the given item stack according to the provided method.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#split_random">split_random (itemstring_or_itemstack)</a></td>
|
|
<td class="summary">Splits the given item stack randomly.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#split_single">split_single (itemstring_or_itemstack)</a></td>
|
|
<td class="summary">Splits the given item stack into single items.</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a href="#Fields">Fields</a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap><a href="#SPLIT_MODE_RANDOM">SPLIT_MODE_RANDOM</a></td>
|
|
<td class="summary">The split mode for randomly splitting the stack.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#SPLIT_MODE_SINGLE">SPLIT_MODE_SINGLE</a></td>
|
|
<td class="summary">The split mode for splitting the stack into single items.</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap><a href="#SPLIT_MODE_STACK">SPLIT_MODE_STACK</a></td>
|
|
<td class="summary">The split mode for preserving the complete stack.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<br/>
|
|
<br/>
|
|
|
|
|
|
<h2><a name="Functions"></a>Functions</h2>
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "blop"></a>
|
|
<strong>blop (position_or_object, itemstrings_or_stacks, x_strength, y_strength, z_strength, split_mode)</strong>
|
|
</dt>
|
|
<dd>
|
|
"Blops" the item into existence at the given position and assigns it
|
|
a random velocity/acceleration.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">position_or_object</span>
|
|
The position, a pos value or an ObjectRef.
|
|
</li>
|
|
<li><span class="parameter">itemstrings_or_stacks</span>
|
|
The item string or an ItemStack.
|
|
</li>
|
|
<li><span class="parameter">x_strength</span>
|
|
Optional. The strength of the random movement in
|
|
the x direction, defaults to 5.
|
|
</li>
|
|
<li><span class="parameter">y_strength</span>
|
|
Optional. The strength o the random movement in
|
|
the y direction, defaults to 5, minimum is 1.
|
|
</li>
|
|
<li><span class="parameter">z_strength</span>
|
|
Optional. The strength of the random movement in
|
|
the z direction, defaults to 5.
|
|
</li>
|
|
<li><span class="parameter">split_mode</span>
|
|
Optional. The mode for splitting the items, defaults
|
|
to SPLIT_MODE_STACK.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
The spawned items in a List.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "get_itemstring"></a>
|
|
<strong>get_itemstring (item)</strong>
|
|
</dt>
|
|
<dd>
|
|
Gets the item string from the given item.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">item</span>
|
|
The item for which to get the item string.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
The item string, or nil.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "split"></a>
|
|
<strong>split (itemstring_or_itemstack, split_mode)</strong>
|
|
</dt>
|
|
<dd>
|
|
Splits the given item stack according to the provided method.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">itemstring_or_itemstack</span>
|
|
The item string or ItemStack to split.
|
|
</li>
|
|
<li><span class="parameter">split_mode</span>
|
|
The split mode.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
A List of item strings, an empty List it could not be split.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "split_random"></a>
|
|
<strong>split_random (itemstring_or_itemstack)</strong>
|
|
</dt>
|
|
<dd>
|
|
Splits the given item stack randomly.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">itemstring_or_itemstack</span>
|
|
The item string or ItemStack to split
|
|
randomly.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
The List of item strings.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "split_single"></a>
|
|
<strong>split_single (itemstring_or_itemstack)</strong>
|
|
</dt>
|
|
<dd>
|
|
Splits the given item stack into single items.
|
|
|
|
|
|
<h3>Parameters:</h3>
|
|
<ul>
|
|
<li><span class="parameter">itemstring_or_itemstack</span>
|
|
The item string or ItemStack to split
|
|
into single items.
|
|
</li>
|
|
</ul>
|
|
|
|
<h3>Returns:</h3>
|
|
<ol>
|
|
|
|
The List of item strings.
|
|
</ol>
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2><a name="Fields"></a>Fields</h2>
|
|
<dl class="function">
|
|
<dt>
|
|
<a name = "SPLIT_MODE_RANDOM"></a>
|
|
<strong>SPLIT_MODE_RANDOM</strong>
|
|
</dt>
|
|
<dd>
|
|
The split mode for randomly splitting the stack.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SPLIT_MODE_SINGLE"></a>
|
|
<strong>SPLIT_MODE_SINGLE</strong>
|
|
</dt>
|
|
<dd>
|
|
The split mode for splitting the stack into single items.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</dd>
|
|
<dt>
|
|
<a name = "SPLIT_MODE_STACK"></a>
|
|
<strong>SPLIT_MODE_STACK</strong>
|
|
</dt>
|
|
<dd>
|
|
The split mode for preserving the complete stack.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</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>
|