Text replacement - "{{Colored box|title=Important|content=" to "{{Tip/Important|"
Line 42:
Line 42:
How do we resolve this? Forge provides the <code>DistExecutor</code> utility class, which provides various methods to run and call different code depending on the physical side.
How do we resolve this? Forge provides the <code>DistExecutor</code> utility class, which provides various methods to run and call different code depending on the physical side.
−
{{Colored box|title=Important|content=
+
{{Tip/Important|
It is important to understand that <code>DistExecutor</code> checks the '''physical''' side. A single player world (logical server + logical client within a physical client) will always use <code>Dist.CLIENT</code>!}}
It is important to understand that <code>DistExecutor</code> checks the '''physical''' side. A single player world (logical server + logical client within a physical client) will always use <code>Dist.CLIENT</code>!}}
Line 57:
Line 57:
Annotating a method or field with the <code>@OnlyIn(Dist)</code> annotation indicates to the loader that the respective member should be completely stripped out of the definition not on the specified '''physical''' side. Usually, these are only seen when browsing through the decompiled Minecraft code, indicating methods that the Mojang obfuscator stripped out.
Annotating a method or field with the <code>@OnlyIn(Dist)</code> annotation indicates to the loader that the respective member should be completely stripped out of the definition not on the specified '''physical''' side. Usually, these are only seen when browsing through the decompiled Minecraft code, indicating methods that the Mojang obfuscator stripped out.
−
{{Colored box|title=Important|content=There is little to no reason for using this annotation directly. The only valid reason to use this annotation is if you are extending a vanilla class that is already annotated with <code>@OnlyIn</code>. In all other cases where you need to dispatch behavior based on physical sides, use <code>DistExecutor</code> or a check on <code>FMLEnvironment.dist</code> instead.}}
+
{{Tip/Important|There is little to no reason for using this annotation directly. The only valid reason to use this annotation is if you are extending a vanilla class that is already annotated with <code>@OnlyIn</code>. In all other cases where you need to dispatch behavior based on physical sides, use <code>DistExecutor</code> or a check on <code>FMLEnvironment.dist</code> instead.}}