Changes

23 bytes removed ,  00:56, 8 February 2021
m
Ravenbuilder934 moved page Resources to Resources: Remove "using" from the title
Line 7: Line 7:  
== ResourceLocation ==
 
== ResourceLocation ==
   −
Minecraft identifies resources using <code><nowiki>ResourceLocation</nowiki></code>s. A <code><nowiki>ResourceLocation</nowiki></code> contains two parts: a namespace and a path. It generally points to the resource at <code><nowiki><assets|data>/<namespace>/<ctx>/<path></nowiki></code>, where <code><nowiki>ctx</nowiki></code> is a context-specific path fragment that depends on how the ResourceLocation is being used. When a <code><nowiki>ResourceLocation</nowiki></code> is written from/read as a string, it is seen as <code><nowiki><namespace>:<path></nowiki></code>. If the namespace and the colon are left out, then when the string is read into an ResourceLocation the namespace will almost always default to <code><nowiki>minecraft</nowiki></code>. A mod should put its resources into a namespace with the same name as its modid (E.g. a mod with id <code><nowiki>examplemod</nowiki></code> should place its resources in <code><nowiki><assets|data>/examplemod</nowiki></code>, and <code><nowiki>ResourceLocation</nowiki></code>s pointing to those files would look like <code><nowiki>examplemod:<path></nowiki></code>). This is not a requirement, and in some cases it can be desirable to use a different (or even more than one) namespace. <code><nowiki>ResourceLocation</nowiki></code>s are used outside the resource system, too, as they happen to be a great way to uniquely identify objects (e.g. [[latest:basics:concepts:registries|registries]]).
+
Minecraft identifies resources using <code><nowiki>ResourceLocation</nowiki></code>s. A <code><nowiki>ResourceLocation</nowiki></code> contains two parts: a namespace and a path. It generally points to the resource at <code><nowiki><assets|data>/<namespace>/<ctx>/<path></nowiki></code>, where <code><nowiki>ctx</nowiki></code> is a context-specific path fragment that depends on how the ResourceLocation is being used. When a <code><nowiki>ResourceLocation</nowiki></code> is written from/read as a string, it is seen as <code><nowiki><namespace>:<path></nowiki></code>. If the namespace and the colon are left out, then when the string is read into an ResourceLocation the namespace will almost always default to <code><nowiki>minecraft</nowiki></code>. A mod should put its resources into a namespace with the same name as its modid (E.g. a mod with id <code><nowiki>examplemod</nowiki></code> should place its resources in <code><nowiki><assets|data>/examplemod</nowiki></code>, and <code><nowiki>ResourceLocation</nowiki></code>s pointing to those files would look like <code><nowiki>examplemod:<path></nowiki></code>). This is not a requirement, and in some cases it can be desirable to use a different (or even more than one) namespace. <code><nowiki>ResourceLocation</nowiki></code>s are used outside the resource system, too, as they happen to be a great way to uniquely identify objects (e.g. [[Registration|registries]]).
    
== Important Directories ==
 
== Important Directories ==
Line 35: Line 35:  
=== Localizations ===
 
=== Localizations ===
   −
Localizations are plain-text files with the file extension <code><nowiki>.json</nowiki></code> and the name being their [[https:''docs.microsoft.com/en-us/previous-versions/commerce-server/ee825488(v=cs.20)?redirectedfrom=MSDN|language code]] in lowercase such as <code><nowiki>en_us</nowiki></code>.
+
Localizations are plain-text files with the file extension <code><nowiki>.json</nowiki></code> and the name being their [https://docs.microsoft.com/en-us/previous-versions/commerce-server/ee825488(v=cs.20)?redirectedfrom=MSDN language code] in lowercase such as <code><nowiki>en_us</nowiki></code>.
    
They are located in the <code><nowiki>./assets/<modid>/lang/</nowiki></code> folder.
 
They are located in the <code><nowiki>./assets/<modid>/lang/</nowiki></code> folder.