diff --git a/.gitattributes b/.gitattributes index 7053094..756b5d9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1 @@ -# Set the default behavior, in case people don't have core.autocrlf set. -* text=auto \ No newline at end of file +* text=auto diff --git a/.gitignore b/.gitignore index 053ecd0..5c10f5c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,38 +1,24 @@ # eclipse -bin *.launch .settings .metadata .classpath .project +bin +eclipse # idea -out *.ipr *.iws *.iml .idea +out # gradle build .gradle - -# other -eclipse run -README.txt -Paulscode IBXM Library License.txt -Paulscode SoundSystem CodecIBXM License.txt -MinecraftForge-Credits.txt -MinecraftForge-License.txt -LICENSE-fml.txt -gradlew-setupDecompWorkspace.bat -gradlew-setupDecompWorkspace-refresh-deps.bat -gradlew-jar.bat -forge-1.9-12.16.0.1811-1.9-changelog.txt -gradlew-build.bat -gradlew-cleanCache.bat -gradlew-clean.bat -gradlew-eclipse.bat -CREDITS-fml.txt \ No newline at end of file +libs/*.jar +gradlew-*.bat +.DS_Store diff --git a/build.gradle b/build.gradle index c901e2e..82bb23d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,3 @@ -evaluationDependsOn(':version') - -// For those who want the bleeding edge buildscript { repositories { jcenter() @@ -15,74 +12,80 @@ buildscript { } apply plugin: 'net.minecraftforge.gradle.forge' -/* -// for people who want stable - not yet functional for MC 1.8.8 - we require the forgegradle 2.1 snapshot -plugins { - id "net.minecraftforge.gradle.forge" version "2.0.2" -} -*/ -version = "1.0" -group = "org.teamrtg.rtg" // http://maven.apache.org/guides/mini/guide-naming-conventions.html -archivesBaseName = "lonelybiome-" + project.mcversion - -sourceCompatibility = 1.8 -targetCompatibility = 1.8 +sourceCompatibility = targetCompatibility = 1.8 -minecraft { - version = "1.9.4-12.17.0.1976" - runDir = "run" - - replace '@VERSION@', project.version - - // the mappings can be changed at any time, and must be in the following format. - // snapshot_YYYYMMDD snapshot are built nightly. - // stable_# stables are built at the discretion of the MCP team. - // Use non-default mappings at your own risk. they may not allways work. - // simply re-run your setup task after changing the mappings to update your workspace. - mappings = "snapshot_20160518" - // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. +def parseprops(File cfg) { + cfg.withReader { + def prop = new Properties() + prop.load(it) + return (new ConfigSlurper().parse(prop)) + } } -dependencies { - // you may put jars on which you depend on in ./libs - // or you may define them like so.. - //compile "some.group:artifact:version:classifier" - //compile "some.group:artifact:version" - - // real examples - //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env - //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env - - // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. - //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' +ext.ref = parseprops(file('build.properties')) +ext.ref.mod_deps = parseprops(file('mod_deps.properties')) - // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, - // except that these dependencies get remapped to your current MCP mappings - //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' - //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' +group = ref.package_base + '.' + ref.mod_id +archivesBaseName = 'LonelyBiome-' + (ref.mc_version as String) +version = ref.mod_version - // for more info... - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html +//repositories { +// maven { url "http://files.minecraftforge.net/maven" } //BiomesOPlenty +// maven { url 'https://dl.bintray.com/shinoow/maven/' } //AbyssalCraft +//} +dependencies { + provided fileTree(dir: 'libs', include: '*.jar') } -processResources -{ - // this will ensure that this task is redone when the versions change. - inputs.property "version", project.version - inputs.property "mcversion", project.minecraft.version +minecraft { + version = (ref.mcf_suffix!='') ? ref.mcf_version + '-' + ref.mcf_suffix : ref.mcf_version + mappings = ref.mcp_mappings + runDir = ref.run_dir + makeObfSourceJar = false + replace '@MOD_VERSION@', project.version + replace '0.0-MCF+MINVER', ref.mcf_minver + replace '9001.0-MCF+MAXVER', ref.mcf_maxver + if (ref.mod_deps!="") replace ';after:MODDEPS', ";" + (ref.mod_deps.depstring as String) + else replace ';after:MODDEPS', '' + replaceIn 'ModInfo.java' +} - // replace stuff in mcmod.info, nothing else +processResources { from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' - - // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version - } - - // copy everything else, thats not the mcmod.info - from(sourceSets.main.resources.srcDirs) { - exclude 'mcmod.info' + expand ([ + 'modid':ref.mod_id, + 'name':ref.mod_name, + 'description':ref.mod_desc, + 'version':ref.mod_version, + 'mcversion':ref.mc_version, + 'url':ref.mod_url, + 'authorList':ref.mod_author, + 'credits':ref.mod_creds, + 'logoFile':ref.mod_logo, + ]) + } + from(sourceSets.main.resources.srcDirs) {exclude 'mcmod.info'} +} + +sourceJar {classifier = 'src'} + +// For a debugging session used 'gradle -DEBUG [runClient|runServer]' +allprojects { + tasks.withType(JavaExec) { +// disabled to possibly alleviate testing issues on cumputers with low memory +// jvmArgs '-Xms2G', '-Xmx4G' + if (System.getProperty("EBUG")!=null) + jvmArgs '-agentlib:jdwp=transport=dt_socket,address=localhost:5005,server=y,suspend=y' } } + +// use -Dwarn|-Dwarnall CLI arguement for verbose compiler warnings +// -Dwarn covers the 3 most common warnings only +tasks.withType(JavaCompile) { + if (System.getProperty("warn") != null) + options.compilerArgs << "-Xlint:unchecked" << "-Xlint:rawtypes" << "-Xlint:deprecation" + if (System.getProperty("warnall") != null) + options.compilerArgs << "-Xlint:all" +} diff --git a/build.properties b/build.properties new file mode 100644 index 0000000..13c5850 --- /dev/null +++ b/build.properties @@ -0,0 +1,20 @@ +# TODO: should maybe find a way to update mod_version automatically in the future (perhaps from git), but not neccessary. +# mod_author has to be in ""'s (and comma-separated, ie: "","",""), because array[] +mod_id=lonelybiome +mod_name=Lonely Biome +mod_desc=Minecraft mod that allows you generate single-biome worlds. +mod_version=1.0 +mc_version=1.10.2 +mod_url=https://github.com/Team-RTG/Lonely-Biome +mod_author="Team RTG" +mod_creds=Halloween graphic by Freepik +mod_logo=assets/lonelybiome/logo.png +mcf_version=12.18.2.2099 +mcf_minver=12.18.1.2011 +mcf_maxver= +# mcf_suffix is the branch suffix (without '-') on the Forge version when it's not the default branch in the Forge repo +# This may be the same as mc_version, eg Non-default: 1.9.4-12.18.2.2099-1.9.4, Default: 1.9.4-12.18.2.2099 +mcf_suffix= +mcp_mappings=snapshot_nodoc_20161027 +run_dir=run +package_base=org.teamrtg diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index b8a0591..0000000 --- a/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -mcversion=1.9.4 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 30d399d..3baa851 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9397848..6f0283c 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Sep 14 12:28:28 PDT 2015 +#Tue Aug 02 11:01:29 EDT 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip diff --git a/gradlew b/gradlew index 91a7e26..27309d9 100644 --- a/gradlew +++ b/gradlew @@ -6,12 +6,30 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" @@ -30,6 +48,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,31 +59,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- -APP_HOME="`pwd -P`" -cd "$SAVED" >&- - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -90,7 +89,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -114,6 +113,7 @@ fi if $cygwin ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` diff --git a/gradlew.bat b/gradlew.bat index 8a0b282..832fdb6 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -8,14 +8,14 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -46,7 +46,7 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args if "%@eval[2+2]" == "4" goto 4NT_args diff --git a/mod_deps.properties b/mod_deps.properties new file mode 100644 index 0000000..4a0e4d3 --- /dev/null +++ b/mod_deps.properties @@ -0,0 +1,2 @@ +# mod_deps should be 'after:<mod identifier>' (unquoted, semicolon-separated, \escaped for newline, see example below) +depstring=after:RTG@[4.1.1.2,) \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 32c66b9..d43539e 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include 'version' +rootProject.name = 'Lonely Biome' diff --git a/src/main/java/teamrtg/lonelybiome/reference/ModInfo.java b/src/main/java/teamrtg/lonelybiome/reference/ModInfo.java index 75287b7..2e3a3ca 100644 --- a/src/main/java/teamrtg/lonelybiome/reference/ModInfo.java +++ b/src/main/java/teamrtg/lonelybiome/reference/ModInfo.java @@ -1,11 +1,15 @@ package teamrtg.lonelybiome.reference; + public class ModInfo { public static final String MOD_ID = "lonelybiome"; public static final String MOD_NAME = "Lonely Biome"; - public static final String MOD_VERSION = "@VERSION@"; - - public static final String PROXY_COMMON = "teamrtg.lonelybiome.proxy.CommonProxy"; - public static final String PROXY_CLIENT = "teamrtg.lonelybiome.proxy.ClientProxy"; + public static final String MOD_VERSION = "@MOD_VERSION@"; + public static final String MCF_MINVER = "0.0-MCF+MINVER"; + public static final String MCF_MAXVER = "9001.0-MCF+MAXVER"; + public static final String MOD_DEPS = ";after:MODDEPS"; + public static final String CONFIG_DIRECTORY = MOD_ID; + public static final String PROXY_COMMON = "teamrtg.lonelybiome.proxy.CommonProxy"; + public static final String PROXY_CLIENT = "teamrtg.lonelybiome.proxy.ClientProxy"; } diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 924fd30..72502a4 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -1,30 +1,14 @@ -[ -{ - "modid": "lonelybiome", - "name": "Lonely Biome", - "description": "Minecraft mod that allows you generate single-biome worlds.", - "version": "${version}", - "mcversion": "${mcversion}", - "url": "https://github.com/Team-RTG/1.9-Lonely-Biome", - "updateUrl": "", - "authorList": [ "Zeno410", "WhichOnesPink" ], - "credits": "Halloween graphic by Freepik", - "logoFile": "assets/lonelybiome/logo.png", - "screenshots": [], - "parent": "", - "requiredMods": [], - "dependencies": [ - - ], - "dependants": [], - "useDependencyInformation": true -} -] - - - - - - - - +[{ + "modid": "${modid}", + "name": "${name}", + "description": "${description}", + "version": "${version}", + "mcversion": "${mcversion}", + "url": "${url}", + "updateUrl": "", + "authorList": [${authorList}], + "credits": "${credits}", + "logoFile": "${logoFile}", + "screenshots": [], + "dependencies": [] +}]