Changes

No change in size ,  04:14, 27 July 2021
Copy Resources to MC1.16 archive
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. [[Registration|registries/1.16]]).
+
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/1.16|registries]]).
    
== Important Directories ==
 
== Important Directories ==
372

edits