Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NowsGradlePlugin

Gradle plugin id:

space.nows

This project intentionally owns Minecraft/Gradle churn instead of nows-core.

It currently provides:

  • nowsPrepareMinecraft;
  • installMod;
  • Mojang version metadata/client download;
  • SHA-1 and size verification using Mojang metadata;
  • direct use of already Mojang-named modern client JARs;
  • legacy runtime-name -> official-Mojang-name remapping through Nows' own ProGuard-mapping parser and ASM remapper;
  • automatic development Minecraft compileOnly classpath;
  • Nows core API dependency;
  • matching nows-mc-<minecraft-version> adapter dependency;
  • default KDL, logging, GEB, network and Mixin compile-time wiring;
  • default Minecraft-owned compile libraries used by Nows APIs;
  • Java toolchain/release defaults matching the selected Minecraft version;
  • jar archive naming from mod_id;
  • nows.mod.kdl expansion for Minecraft, Nows and mod metadata properties.

Example:

plugins {
    id("space.nows.gradle") version "0.9.1"
}

group = "com.example.mymod"
version = providers.gradleProperty("mod_version").get()

Applying the Nows plugin also applies Gradle's Java plugin and sets Java compilation to UTF-8. The plugin reads these conventional Gradle properties automatically when present:

minecraft_version=26.2
nows_version=0.9.1

mod_id=my_mod
mod_name=My Mod
mod_version=1.0.0
mod_description=My Mod generated starter mod.
mod_author=
mod_license=Apache-2.0
mod_icon=
mod_homepage=
mod_sources=
mod_issues=

Override values directly when a build needs to be explicit:

nows {
    minecraftVersion.set("26.2")
    nowsVersion.set("0.9.1")
    modId.set("my_mod")
    javaRelease.set(25)
}

The defaults are intentionally batteries-included. Turn pieces off only when a mod does not use them:

nows {
    addKdl.set(false)
    addGeb.set(false)
    addLogging.set(false)
    addNetwork.set(false)
    addMixin.set(false)
    addMinecraftAdapter.set(false)
    addMinecraftLibraries.set(false)
    expandNowsModMetadata.set(false)
    officialMappings.set(false)
}

For a custom prepared Minecraft JAR:

nows {
    developmentClientJar.set(layout.projectDirectory.file(".nows/minecraft/26.2/client-dev.jar"))
}

The nowsPrepareMinecraft task writes to build/nows/minecraft by default and reuses prepared JARs when the Minecraft client, mappings and remapper fingerprint still match.

Install the built mod into the default Minecraft mods folder:

gradle installMod

Use -Pminecraft_mods_dir=/path/to/.minecraft/mods or set minecraftModsDirectory to target another folder.

About

NowsGradlePlugin

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages