User Tools

Site Tools


drafts:client_server_split

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
drafts:client_server_split [2023/09/13 19:13] – ↷ Page moved from client_server_split to drafts:client_server_split nebelnidasdrafts:client_server_split [2023/09/22 17:31] (current) modmuss50
Line 1: Line 1:
-[WIP] +~~REDIRECT>documentation:fabric_loom#split_client_and_common_code~~
- +
-**Make sure you are at least using Fabric Loader version 0.14, and Fabric Loom version 0.12.** +
- +
-To split split and common code, add the following to your build script. +
- +
-<code groovy> +
-loom { +
-    splitEnvironmentSourceSets() +
- +
-    mods { +
-        your_mod_id_goes_here { +
-            sourceSet sourceSets.main +
-            sourceSet sourceSets.client +
-        } +
-    } +
-     +
-    /* other stuff */ +
-+
-</code> +
- +
-Then all client-only code can go in ''src/client/java'', and the code that is both on the client and the server can go in ''src/main/java''. Client-only code will be able to reference code in ''main'' and code that is only available in client distributions of Minecraft, but ''main'' code will not be able to.+
drafts/client_server_split.1694632437.txt.gz · Last modified: 2023/09/13 19:13 by nebelnidas