1
0
mirror of https://github.com/chylex/Java-Checker.git synced 2025-06-06 07:34:11 +02:00
Minecraft mod that shows a friendly error message in case the user has an outdated version of Java. https://minecraft.curseforge.com/projects/java-version-checker
Go to file
2015-12-12 19:30:21 +01:00
gradle/wrapper WIP Forge & Gradle update 2015-12-12 19:05:00 +01:00
src/main Add a version of Java Checker for shading 2015-10-12 19:15:59 +02:00
.gitignore Update gitignore and build.gradle for 1.8.8 2015-12-12 19:30:21 +01:00
build.gradle Update gitignore and build.gradle for 1.8.8 2015-12-12 19:30:21 +01:00
gradlew Upload gradle wrapper 2015-10-13 02:30:20 +02:00
gradlew.bat Upload gradle wrapper 2015-10-13 02:30:20 +02:00
LICENSE Initial commit 2014-12-12 23:38:57 +01:00
README.md Update README.md 2015-10-13 03:15:43 +02:00

You can download latest versions of Java Checker on CurseForge:

http://minecraft.curseforge.com/projects/java-version-checker

The mod is in Public Domain, so do whatever you want with it! Hugs and mentions appreciated but not required. If you want to include Java Checker in your own mod, read the shading guide.

Shading Java Checker into your mod

Warning: this is experimental, if you find any issues, please report them immediately.

You can insert Java Checker into your mod, so that it will alert the user if they are using outdated Java. You will need to use a special version designed for shading, you can use tterrag's Maven repository in your build.gradle or download it manually.

This file will work fine for all Minecraft versions starting from 1.6.2. It can currently check for Java 7 or 8, based on how you configure it.

In order to shade and configure Java Checker, you need to update your build.gradle file. Use this as a guide, make sure to update everything in <> brackets.

configurations{
  shade
  compile.extendsFrom shade
}

<your buildscript info is somewhere here>

repositories{
  maven{
    name "tterrag Repo"
    url "http://maven.tterrag.com/"
  }
}

dependencies{
  shade "chylex.javacheck:JavaChecker:v1.2-b1"
}

<your mod info is somewhere here>

minecraft{
  srgExtra "PK: chylex/javacheck <yourmodname>/shade/javacheck"
}

jar{
  configurations.shade.each{ dep ->
    from(project.zipTree(dep)){
      exclude 'META-INF', 'META-INF/**', 'mcmod.info'
    }
  }
  
  manifest{
    attributes 'TweakClass': '<yourmodname>.shade.javacheck.Java<version>Checker'
  }
}

If you want download the file manually as a library, remove 'repositories' and replace the 'dependencies' block with:

dependencies{
  files('libs/JavaCheckerShade  MC-UNIVERSAL  v1.2.jar')
}

You can also use Hardcore Ender Expansion's build.gradle as a reference.

Now build the mod and run it to make sure nothing messed up. If you need help with something related to build.gradle, ask AbrarSyed because I have absolutely no idea what I'm doing :P.