User Tools

Site Tools


wiki:syntax

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Last revisionBoth sides next revision
wiki:syntax [2023/04/19 20:16] – external edit 127.0.0.1wiki:syntax [2023/06/12 19:28] – Readd map2fabricyarn syntax daomephsta
Line 375: Line 375:
   </nowiki>   </nowiki>
   The same is true for %%//__this__ text// with a smiley ;-)%%.   The same is true for %%//__this__ text// with a smiley ;-)%%.
 +  
 +===== map2fabricyarn Syntax =====  
 +To avoid code becoming outdated due to mappings changes, it is possible to write code blocks in Intermediary. This wiki's map2fabricyarn plugin adds ''%%<yarncode>%%'' & ''%%<yarnfile>%%''. All intermediary names inside code blocks created using ''%%<yarncode>%%'' & ''%%<yarnfile>%%'' are remapped to Yarn. Otherwise their syntax and behaviour is identical to DokuWiki's ''%%<code>%%'' & ''%%<file>%%''.  
 +  
 +<code>
 +<yarncode java>  
 +public static class_2248 TEST;  
 +  
 +@Override  
 +public void onInitialize() {  
 +    TEST = class_2378.method_10230(class_2378.field_11146, new class_2960(MOD_ID, "test"), new class_2248(FabricBlockSettings.method_9630(class_2246.field_10340)));  
 +}  
 +</yarncode> 
 +</code>  
 +  
 +  
 +<yarncode java>  
 +public static class_2248 TEST;  
 +  
 +@Override  
 +public void onInitialize() {  
 +    TEST = class_2378.method_10230(class_7923.field_41175, new class_2960(MOD_ID, "test"), new class_2248(FabricBlockSettings.method_9630(class_2246.field_10340)));  
 +}  
 +</yarncode>  
 +The easiest way to create Intermediary code for ''%%<yarncode>%%'' blocks is to build your example mod, then unzip the sources-dev JAR.  
 +  
 +To remap without creating a code block, use the ''%%<yarn>%%'' tag. The content to remap should be inside the ''%%<>%%'', separated from ''%%<yarn%%'' by a single space.  
 +Example: %%<yarn class_2960>%% becomes <yarn class_2960>.\\  
 +This tag can have formatting applied by the standard tags.  
 +  
 +To output a fully qualified Yarn class name, input a fully qualified Intermediary name by prefixing it with ''net.minecraft.''.
  
 ===== Code Blocks ===== ===== Code Blocks =====
wiki/syntax.txt · Last modified: 2023/09/13 18:47 by nebelnidas