I have defined the version as a variable and reuse it on multiple lines. This makes it easier to always update to the newest Minecraft version.
However, the apiVersion takes a different input, so I have to manually change it or write some extra logic (which I don't want to have in the build.gradle, especially if I need to think of legacy versions).
My current build.gradle looks something like this:
I have defined the version as a variable and reuse it on multiple lines. This makes it easier to always update to the newest Minecraft version.
However, the
apiVersion
takes a different input, so I have to manually change it or write some extra logic (which I don't want to have in thebuild.gradle
, especially if I need to think of legacy versions).My current
build.gradle
looks something like this:With this change, I am able to remove the need for the extra variable
API_VERSION
and I can just writeapiVersionForMcVersion MC_VERSION
: