As part of the Unified Community Platform project, your wiki will be migrated to the new platform in the next few weeks. Read more here.

Πρότυπο:Nbt inherit

Από Minecraft Wiki
Μετάβαση σε: πλοήγηση, αναζήτηση
[view | edit | history | purge]Documentation

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

Usage[επεξεργασία κώδικα]

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 {{Nbt inherit/template}} 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[επεξεργασία κώδικα]

To inherit Chunk format/Entity:

Template:Nbt inherit/entity should contain
{{Nbt inherit|Template:Nbt inherit/entity/template|Tags common to all entities}}
Template:Nbt inherit/entity/template should contain
{{Nbt inherit/template|Chunk format/Entity|entity}}

Then the usage in a tree which inherits it:

<div class="treeview">
* {{nbt|compound}} Entity tag
** {{nbt inherit/entity}}
** Tag unique to this entity
** Another tag unique to this entity
*** {{nbt inherit/item|indent=***}}

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

Template:Nbt inherit/mob should contain
{{Nbt inherit/entity|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
** {{nbt inherit/mob}}
** Tag unique to this mob
** Another tag unique to this mob
[view | edit | history | purge]The above documentation is transcluded from Πρότυπο:Nbt inherit/doc.