Modèle:Arbre Nbt/doc

De Minecraft Wiki
Aller à : navigation, rechercher
Ceci est la page de documentation, elle devrait être incluse dans le page principale du modèle. Voir Modèle:Documentation pour plus d'informations

Cette page est à traduire en Français.

This template includes a section of NBT tags which is inherited into another set. This documentation will also document the usage of the {{Arbre Nbt/Modèle}} template.

Usage[modifier le wikicode]

This template requires creating a couple of pages for each inherited set of tags. The Template:Nbt inherit/<id> page will use this template, and is what will actually be used by editors. The Template:Nbt inherit/<id>/template page simple transcludes the actual content to be inherited which will be loaded when clicking on the show button (this page is for technical caching reasons for the page loader script), it should contain nothing but the {{Arbre Nbt/Modèle}} template.

  • {{{1}}} is the name of the template + /template
  • {{{2}}} is the title used in the header
Template:Nbt inherit/template usage
  • {{{1}}} is the page to be transcluded
  • {{{2}}} will be used for dpl later

Example[modifier le wikicode]

To inherit Chunk format/Entity:

Modèle:Arbre Nbt/Entité should contain
{{Arbre Nbt|Modèle:Arbre Nbt/Entité/Modèle|Tags common to all entities}}
Modèle:Arbre Nbt/Entité/Modèle should contain
{{Modèle:Arbre Nbt/Modèle|Format de tronçon/Entité|Entité}}

Then the usage in a tree which inherits it:

<div class="treeview">
* {{nbt|compound}} Entity tag
** {{Arbre Nbt/Entité}}
** Tag unique to this entity
** Another tag unique to this entity
*** {{Arbre Nbt/Objet|indent=***}}
</div>


Inherited sections can themselves inherit a section of NBT tags, simply include the inherited tags in the Template:Nbt inherit/<id> template, and pass along the {{{indent}}} parameter. Then include the #if statement on every line below the first (required because of phab:T14974). For example, the mob class inherited by mobs also inherits the tags from the entity class

Modèle:Arbre Nbt/Créature should contain
{{Arbre Nbt/entité|indent={{{indent|}}}}}
{{#if: {{{indent|}}} | {{{indent}}} | ** }}{{Nbt inherit|Template:Nbt inherit/mob/template|Tags common to all mobs}}

Then the usage in a tree which inherits it:

<div class="treeview">
* {{nbt|compound}} Entity tag
** {{Arbre Nbt/Créature}}
** Tag unique to this mob
** Another tag unique to this mob
</div>