Merge branch minetest_modding_book:master into master
This commit is contained in:
commit
4d3a39f6e4
@ -147,7 +147,7 @@ minetest.register_node("myair:air", {
|
||||
walkable = false, -- Would make the player collide with the air node
|
||||
pointable = false, -- You can't select the node
|
||||
diggable = false, -- You can't dig the node
|
||||
buildable_to = true, -- Nodes can be replace this node.
|
||||
buildable_to = true, -- Nodes can replace this node.
|
||||
-- (you can place a node and remove the air node
|
||||
-- that used to be there)
|
||||
|
||||
|
@ -37,9 +37,10 @@ positions are usually air nodes.
|
||||
A craftitem can't be placed and is only found in inventories or as a dropped item
|
||||
in the world.
|
||||
|
||||
A tool has the ability to wear and typically has non-default digging
|
||||
capabilities. In the future, it's likely that craftitems and tools will merge
|
||||
into one type of item, as the distinction between them is rather artificial.
|
||||
A tool is like a craftitem but has the ability to wear. As you use the tool, the
|
||||
wear bar goes down until the tool breaks. Tools can also never be stacked. In
|
||||
the future, it's likely that craftitems and tools will merge into one type of
|
||||
item, as the distinction between them is rather artificial.
|
||||
|
||||
## Registering Items
|
||||
|
||||
|
@ -268,14 +268,15 @@ these groups can take any name and do not need to be registered. However, it's
|
||||
common to use the same group names as with node digging.
|
||||
|
||||
How vulnerable an object is to particular types of damage depends on its
|
||||
`armor_groups` [object property](#object-properties). Despite its misleading
|
||||
name, `armor_groups` specify the percentage damage taken from particular damage
|
||||
groups, not the resistance. If a damage group is not listed in an object's armor
|
||||
groups, that object is completely invulnerable to it.
|
||||
`armor_groups`. Despite its misleading name, `armor_groups` specify the
|
||||
percentage damage taken from particular damage groups, not the resistance. If a
|
||||
damage group is not listed in an object's armor groups, that object is
|
||||
completely invulnerable to it.
|
||||
|
||||
```lua
|
||||
target:set_properties({
|
||||
armor_groups = { fleshy = 90, crumbly = 50 },
|
||||
target:set_armor_groups({
|
||||
fleshy = 90,
|
||||
crumbly = 50,
|
||||
})
|
||||
```
|
||||
|
||||
|
@ -137,7 +137,7 @@ from text using rules. They're best suited for when there are arguments that can
|
||||
contain spaces or more control is needed on how parameters are captured.
|
||||
|
||||
```lua
|
||||
local to, msg = param:match("^([%a%d_-]+) (*+)$")
|
||||
local to, msg = param:match("^([%a%d_-]+) (.+)$")
|
||||
```
|
||||
|
||||
The above code implements `/msg <to> <message>`. Let's go through left to right:
|
||||
@ -149,7 +149,7 @@ The above code implements `/msg <to> <message>`. Let's go through left to right:
|
||||
* `%a` means accept any letter and `%d` means accept any digit.
|
||||
* `[%a%d_-]` means accept any letter or digit or `_` or `-`.
|
||||
* `+` means match the thing before one or more times.
|
||||
* `*` means match any character in this context.
|
||||
* `.` means match any character in this context.
|
||||
* `$` means match the end of the string.
|
||||
|
||||
Put simply, the pattern matches the name (a word with only letters/numbers/-/_),
|
||||
|
@ -132,8 +132,6 @@ their code.
|
||||
Using git can be difficult at first. If you need help with this please see:
|
||||
|
||||
* [Pro Git book](http://git-scm.com/book/en/v1/Getting-Started) - Free to read online.
|
||||
* [GitHub for Windows app](https://help.github.com/articles/getting-started-with-github-for-windows/) -
|
||||
Using a graphical interface on Windows to upload your code.
|
||||
|
||||
## Releasing on ContentDB
|
||||
|
||||
|
@ -238,8 +238,9 @@ Al contrario di quello che potrebbe far intendere il nome, `armor_groups` specif
|
||||
Se un Gruppo Danno non è elencato nei Gruppi Armatura di un oggetto, quest'ultimo ne sarà completamente immune.
|
||||
|
||||
```lua
|
||||
obiettivo:set_properties({
|
||||
armor_groups = { fleshy = 90, crumbly = 50 },
|
||||
obiettivo:set_armor_groups({
|
||||
fleshy = 90,
|
||||
crumbly = 50,
|
||||
})
|
||||
```
|
||||
|
||||
|
@ -128,7 +128,7 @@ end
|
||||
Sono perfetti in caso di argomenti che contengono spazi, o comunque quando è richiesto un controllo più meticoloso dei parametri catturati.
|
||||
|
||||
```lua
|
||||
local a, msg = string.match(param, "^([%a%d_-]+) (*+)$")
|
||||
local a, msg = string.match(param, "^([%a%d_-]+) (.+)$")
|
||||
```
|
||||
|
||||
Il codice sovrastante implementa `/msg <a> <messaggio>`. Vediamo cos'è successo partendo da sinistra:
|
||||
@ -139,7 +139,7 @@ Il codice sovrastante implementa `/msg <a> <messaggio>`. Vediamo cos'è successo
|
||||
* `%a` significa che accetta ogni lettera e `%d` ogni cifra.
|
||||
* `[%a%d_-]` significa che accetta ogni lettera, cifra, `_` e `-`.
|
||||
* `+` dice di combaciare ciò che lo precede una o più volte.
|
||||
* `*` dice di combaciare qualsiasi tipo di carattere.
|
||||
* `.` dice di combaciare qualsiasi tipo di carattere.
|
||||
* `$` dice di combaciare la fine della stringa.
|
||||
|
||||
Detto semplicemente, il pattern cerca un nome (una parola fatta di lettere, numeri, trattini o trattini bassi), poi uno spazio e poi il messaggio (uno o più caratteri, qualsiasi essi siano).
|
||||
|
@ -66,41 +66,6 @@ layout: base
|
||||
<li>{% if next %}<a href="{{ page.root }}{{ next.url}}">{{ next.title }} ></a>{% endif %}</li>
|
||||
</ul>
|
||||
|
||||
{% if language == "en" %}
|
||||
<aside class="feedback">
|
||||
<h2>
|
||||
{% unless page.homepage %}Confused?{% endunless %}
|
||||
Have an idea to make the book better?
|
||||
</h2>
|
||||
<p>
|
||||
Please let me know using the form below.
|
||||
</p>
|
||||
<form method="POST" action="https://api.rubenwardy.com/comment/">
|
||||
<input type="hidden" name="url" value="{{ page.url | absolute_url }}">
|
||||
<input type="hidden" name="redirect_to" value="https://rubenwardy.com/minetest_modding_book/comment_received.html">
|
||||
<input type="hidden" name="name" value="Anonymous">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" id="username" name="username">
|
||||
<div class="form-group">
|
||||
<label for="message" class="form-label">Message</label>
|
||||
<textarea class="form-control" id="message" name="message" rows="3" required="" minlength="5" maxlength="1800"></textarea>
|
||||
<small id="messageHelp" class="form-text text-muted">
|
||||
Max 1800 characters. What is missing? What confused you?
|
||||
What did you find unclear? What other feedback do you have?
|
||||
</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email" class="form-label">Email address (optional)</label>
|
||||
<input type="email" class="form-control" id="email" name="email" aria-describedby="emailHelp" maxlength="320">
|
||||
<small id="emailHelp" class="form-text text-muted">
|
||||
Optional, if you'd like to receive a response.
|
||||
</small>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Send Feedback</button>
|
||||
</form>
|
||||
</aside>
|
||||
{% endif %}
|
||||
|
||||
<footer>
|
||||
© 2014-{{ site.time | date: '%Y' }}
|
||||
{% if language == "en" %}
|
||||
|
@ -1,3 +1,3 @@
|
||||
---
|
||||
redirect_to: https://minetest.gitlab.io/minetest/
|
||||
redirect_to: https://api.minetest.net/
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user