Skip to content

NamedResourceLocation

Ferdinand Calo edited this page Aug 8, 2019 · 1 revision
# Feature Overview
Kind: Named ResourceLocation
Extendable: no
JSON based: no
JSON config: definex through string in a vehicle/part/container/etc config

NamedResourceLocation is a class/util from FCL! It was added due to a need of it in FVTM.

You may know already ResourceLocations, knowingly or not,
if you did any content for FVTM or modding or even a ResourcePack,
you most probably used them.

In FVTM (also in MC/Forge) they are used for at least 2 things:

  • registry entries - e.g. minecraft:stone, fvtm:gep, gep:diesel and so on
  • resource locations - as the name of the class itself says, it is used to locate resources
    e.g. fvtm:textures/blocks/constructor.png

It consists of 2 strings, the first string domain and the second path, in case of
registry entries, the path is the ID of the to be registered object.
As you may have noticed they are separated with a : (colon).

Now, what is special in NamedResourceLocations? You can name them!
That is so that you can - in theory if you want - call alternative or default
textures of your vehicle/part/container/etc a nice name, like paintjob names.

Usage? Like you know, domain and path is separated with a : (colon), to give a
texture a name in FVTM, add before the domain:path a name for it and end it with
a ; (semi-colon), upon parsing that piece will be separated and saved as name for it.

Example (taken from FVP!):

{
    "__comment": "Vehicle Config JSON file.",
    "Textures": [
        "Default;fvp:textures/cars/c9.png",
        "Noise;fvp:textures/cars/c9_alt0.png",
        "Rand00;fvp:textures/cars/c9_alt1.png",
        "Rand01;fvp:textures/cars/c9_alt2.png"
    ]
}
Clone this wiki locally