-
Notifications
You must be signed in to change notification settings - Fork 0
Building
Requires JDK 25.
git clone https://github.com/the-real-ltcg/afk-chat-spammer.git
cd afk-chat-spammer
./gradlew buildThis builds all six platform/version combinations:
fabric-26.2/build/libs/afk-chat-spammer-fabric-26.2-<version>.jarfabric-26.1/build/libs/afk-chat-spammer-fabric-26.1-<version>.jarneoforge-26.2/build/libs/afk-chat-spammer-neoforge-26.2-<version>.jarneoforge-26.1/build/libs/afk-chat-spammer-neoforge-26.1-<version>.jarforge-26.2/build/libs/afk-chat-spammer-forge-26.2-<version>.jarforge-26.1/build/libs/afk-chat-spammer-forge-26.1-<version>.jar
Build just one with, e.g., ./gradlew :fabric-26.2:build or ./gradlew :forge-26.1:build.
-
common/— shared platform-agnostic logic (config, spam timer). Not a Gradle module; its sources are compiled directly into every platform jar. -
fabric/— shared Fabric source +fabric.mod.jsontemplate, identical across both MC versions. Not a Gradle module. -
neoforge/— shared NeoForge source +neoforge.mods.tomltemplate, identical across both MC versions. Not a Gradle module. -
forge/— shared Forge source +mods.tomltemplate, identical across both MC versions except one spot where MC 26.2 renamedMinecraft.setScreentosetScreenAndShow(26.1.2 has both, so the shared code uses that name). Includes its own minimal vanilla-widget config screen, since Cloth Config dropped Forge support in late 2024. Not a Gradle module. -
fabric-26.2/,fabric-26.1/,neoforge-26.2/,neoforge-26.1/,forge-26.2/,forge-26.1/— the actual buildable Gradle modules. Each is just abuild.gradlepointing its source sets at the shared folders above, with that version's dependency coordinates. Adding a new Minecraft version means adding one more small build.gradle per loader — no source duplication needed, since the API surface used by this mod barely changes between 26.1.2 and 26.2 (one rename, see above).
Forge uses a different, newer build plugin than Fabric/NeoForge: net.minecraftforge.gradle
version [7.0.17,8) (ForgeGradle 7), paired with the new record-based EventBus 7 API. This is a
different event style than NeoForge's: instead of a shared NeoForge.EVENT_BUS.addListener(Class, handler), each event class now exposes its own static BUS field, e.g.
TickEvent.ClientTickEvent.Post.BUS.addListener(handler) or
RegisterClientCommandsEvent.BUS.addListener(handler). Mod entry points also changed shape:
@Mod classes take a FMLJavaModLoadingContext constructor parameter, and
context.getContainer().registerExtensionPoint(...) replaces the deprecated
ModLoadingContext.get().
- Add a
mcXXX_*block of dependency coordinates to the rootgradle.properties(Minecraft version, Fabric API version, NeoForge version, Forge version, Cloth Config version, Mod Menu version — check each directly rather than trusting a search summary: Modrinth's API for Fabric/NeoForge/Cloth Config/Mod Menu, e.g.api.modrinth.com/v2/project/fabric-api/version?game_versions=["26.x"]; Forge's ownfiles.minecraftforge.net/net/minecraftforge/forge/promotions_slim.jsonfor the Forge build number). - Copy
fabric-26.2/build.gradle,neoforge-26.2/build.gradle, andforge-26.2/build.gradleinto newfabric-XX.X/,neoforge-XX.X/, andforge-XX.X/folders, swapping the property prefix. - Add all three to
settings.gradle. - Build and fix whatever actually breaks — don't assume API parity. Between 26.1.2 and 26.2 alone,
one vanilla method (
Minecraft.setScreen) was already renamed; verify anything uncertain by extracting the real dependency jar and runningjavapagainst it, rather than guessing from docs or examples that may be stale.