User Tools

Site Tools


tutorial:registry

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorial:registry [2022/12/09 04:52] – [Registry Types] solidblocktutorial:registry [2023/05/15 03:31] (current) – Fix missing period in code. phanabani
Line 1: Line 1:
--====== Registry System ======+====== Registry System ======
  
 You will need to register most content you add to the game. This helps with: You will need to register most content you add to the game. This helps with:
Line 15: Line 15:
 ===== Registry Types ===== ===== Registry Types =====
  
-When registering content, you need to specify which registry you are adding content to. The base game provides registries for all vanilla content, which can be found in ''%%Registries%%'' (for 1.19.3 and above) or ''Registry'' (for below 1.19.3). Two examples of registries you may use include ''<yarn class_2378>.<yarn field_11142>'' for items and ''<yarn class_2378>.<yarn field_11146>'' for blocks.+When registering content, you need to specify which registry you are adding content to. The base game provides registries for all vanilla content, which can be found in ''%%Registries%%'' (for 1.19.3 and above) or ''Registry'' (for below 1.19.3). Two examples of registries you may use include ''Registries.ITEM'' (for 1.19.3 above)/''Registry.ITEM'' (for 1.19.2 below) for items and ''Registries.BLOCK'' (for 1.19.3 above)/''Registry.BLOCK'' (for 1.19.2 below) for blocks.
  
 For a deeper overview and description of all available registries, read the [[tutorial:registry_types|registry types]] page. For a deeper overview and description of all available registries, read the [[tutorial:registry_types|registry types]] page.
Line 25: Line 25:
 <yarncode java> <yarncode java>
 public static <T> T method_10230(class_2378<? super T> registry, class_2960 id, T entry) { public static <T> T method_10230(class_2378<? super T> registry, class_2960 id, T entry) {
-    return ((class_2385)registry)method_10272(id, entry);+    return ((class_2385)registry).method_10272(id, entry);
 } }
 </yarncode> </yarncode>
tutorial/registry.1670561534.txt.gz · Last modified: 2022/12/09 04:52 by solidblock