NationCrest

Countries

countries.yml, the per country name, glyph and colour, and how to wire it to a resource pack font.

plugins/NationCrest/countries.yml holds one entry for every ISO 3166-1 alpha-2 country code. All 249 of them ship filled in, so there is nothing to add unless you want to change how a country looks.

An entry

countries:
  IN:
    name: 'India'
    code: IN
    custom: IN
    colour: ''
KeyWhat it is
nameThe full country name. This is what %nationcrest_name% returns
codeThe two letter code. What %nationcrest_code% returns, and what the code display mode shows
customWhat the custom display mode shows. Ships as the text code
colourA Prism colour for this country alone. Empty means use display.default-colour

The key itself is the country code, so IN: is India.

The unicode display mode is not listed here. It is worked out from the code at runtime, because the regional indicator pair is always the two letters shifted into the regional indicator block.

Colouring one country

Anything Prism understands works, so this is not limited to the sixteen legacy colours:

countries:
  IN:
    name: 'India'
    code: IN
    custom: IN
    colour: '&#FF9933'

  BR:
    name: 'Brazil'
    code: BR
    custom: BR
    colour: '<GRADIENT:009C3B>text</GRADIENT:FFDF00>'

Countries you leave with colour: '' fall back to display.default-colour in config.yml.

&a, hex and <SOLID:...> go in front of the flag. <GRADIENT:...> and <RAINBOW> wrap it instead, so NationCrest draws the flag inside the tags rather than after them. The text between the tags in the example above is only there so the syntax reads on its own, it is never shown. This works in every display mode, including unicode, where each regional indicator takes its own step of the gradient.

See Display modes for the full colour syntax.

Wiring it to a resource pack font

This is the point of the custom field.

Build the font in your pack

Map each flag image to a character in your resource pack's font. Which characters you use is up to you, private use area code points are the usual choice.

Put those characters into countries.yml

Replace the custom value for each country with the character your pack maps for it.

countries:
  IN:
    name: 'India'
    code: IN
    custom: ''

Switch the display mode

display:
  mode: custom

Reload

/flag reload.

You do not have to do all 249 in one sitting. Any country you have not touched still shows its text code, which is why the file ships that way.

Renaming a country

Change name. That is the value %nationcrest_name% returns and the one /flag info prints.

Country names are not translated in this version. They come from this file regardless of which language file you have loaded. Translating them is on the list for a later version.

Adding a code the plugin does not know

Every currently assigned ISO 3166-1 alpha-2 code is already in the file. If you want an entry for something outside that list, add it in the same shape and it will work. /flag set will accept it and the placeholders will return it.

On this page