diff --git a/Fabric/build.gradle b/Fabric/build.gradle new file mode 100644 index 0000000..6e00136 --- /dev/null +++ b/Fabric/build.gradle @@ -0,0 +1,47 @@ +plugins{ + id 'fabric-loom' version '0.2.6-SNAPSHOT' + id 'maven-publish' +} + +sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 + +archivesBaseName = project.archives_base_name + '-' + project.minecraft_version +version = project.mod_version +group = project.maven_group + +minecraft{} + +dependencies{ + minecraft "com.mojang:minecraft:${project.minecraft_version}" + mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" + modCompile "net.fabricmc:fabric-loader:${project.loader_version}" + modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" +} + +processResources{ + inputs.property "version", project.version + + from(sourceSets.main.resources.srcDirs){ + include "fabric.mod.json" + expand "version": project.version + } + + from(sourceSets.main.resources.srcDirs){ + exclude "fabric.mod.json" + } +} + +// fix jar file name +version = 'v' + version + +// ensure that the encoding is set to UTF-8, no matter what the system default is +// this fixes some edge cases with special characters not displaying correctly +// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html +tasks.withType(JavaCompile){ + options.encoding = "UTF-8" +} + +jar{ + from "../LICENSE" +} diff --git a/Fabric/gradle.properties b/Fabric/gradle.properties index ebb789a..ce12ec5 100644 --- a/Fabric/gradle.properties +++ b/Fabric/gradle.properties @@ -1,3 +1,17 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G +# Fabric Properties + # check these on https://fabricmc.net/use + minecraft_version=1.15.2 + yarn_mappings=1.15.2+build.1 + loader_version=0.7.5+build.178 + +# Mod Properties + mod_version = 1.0.0 + maven_group = chylex.customwindowtitle.forge + archives_base_name = CustomWindowTitle + +# Dependencies + # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api + fabric_version=0.4.29+build.290-1.15 diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..7cb4c8d --- /dev/null +++ b/Fabric/src/main/resources/fabric.mod.json @@ -0,0 +1,32 @@ +{ + "schemaVersion": 1, + "id": "customwindowtitle", + "version": "${version}", + + "name": "Custom Window Title", + "authors": [ + "chylex" + ], + "contact": { + "homepage": "https://chylex.com", + "sources": "https://github.com/chylex/Minecraft-Window-Title", + "issues": "https://github.com/chylex/Minecraft-Window-Title/issues" + }, + + "license": "Unlicense", + + "environment": "client", + "entrypoints": { + "client": [ + "chylex.customwindowtitle.fabric.CustomWindowTitle" + ] + }, + "mixins": [ + "mixins.json" + ], + + "depends": { + "fabricloader": ">=0.7.2", + "minecraft": "1.15.x" + } +} diff --git a/Forge/build.gradle b/Forge/build.gradle new file mode 100644 index 0000000..80fec02 --- /dev/null +++ b/Forge/build.gradle @@ -0,0 +1,82 @@ +buildscript{ + repositories{ + maven{ url = 'https://files.minecraftforge.net/maven' } + jcenter() + mavenCentral() + } + + dependencies{ + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true + } +} + +apply plugin: 'net.minecraftforge.gradle' +apply plugin: 'eclipse' + +def mcversion = "1.15.2" +def forgeversion = "31.0.14" + +def prefixName = 'displayName = ' +def prefixVersion = 'version = ' + +def metaLines = file('src/main/resources/META-INF/mods.toml').readLines() +def metaName = metaLines.find { line -> line.startsWith(prefixName) }.substring(prefixName.length())[1..-2] +def metaVersion = metaLines.find { line -> line.startsWith(prefixVersion) }.substring(prefixVersion.length())[1..-2] + +group = 'chylex.customwindowtitle.forge' +version = metaVersion +archivesBaseName = metaName.replaceAll('\\s', '') + +sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' + +minecraft{ + mappings channel: 'snapshot', version: '20200130-1.15.1' + + runs{ + client{ + workingDirectory file('run') + + mods{ + customwindowtitle{ + source sourceSets.main + } + } + } + + server{ + workingDirectory file('run') + + mods{ + customwindowtitle{ + source sourceSets.main + } + } + } + } +} + +dependencies{ + minecraft 'net.minecraftforge:forge:' + mcversion + '-' + forgeversion +} + +jar{ + archiveName = archivesBaseName + '-' + mcversion + '-v' + version + '.jar' + + from('../'){ + include 'LICENSE' + } + + manifest{ + attributes([ + 'Specification-Title' : 'customwindowtitle', + 'Specification-Version': '1', + 'Specification-Vendor' : 'chylex', + + 'Implementation-Title' : metaName, + 'Implementation-Version': metaVersion, + 'Implementation-Vendor' : 'chylex', + + 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) + } +} diff --git a/Forge/src/main/resources/META-INF/mods.toml b/Forge/src/main/resources/META-INF/mods.toml new file mode 100644 index 0000000..6df1653 --- /dev/null +++ b/Forge/src/main/resources/META-INF/mods.toml @@ -0,0 +1,25 @@ +modLoader = "javafml" +loaderVersion = "[31,)" + +authors = "chylex" +issueTrackerURL = "https://github.com/chylex/Minecraft-Window-Title/issues" + +[[mods]] +modId = "customwindowtitle" +version = "1.0.0" +displayName = "Custom Window Title" +displayURL = "https://github.com/chylex/Minecraft-Window-Title" + +[[dependencies.customwindowtitle]] + modId = "minecraft" + mandatory = true + versionRange = "[1.15.2,)" + ordering = "NONE" + side = "CLIENT" + +[[dependencies.customwindowtitle]] + modId = "forge" + mandatory = true + versionRange = "[31,)" + ordering = "NONE" + side = "CLIENT" diff --git a/Forge/src/main/resources/pack.mcmeta b/Forge/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..93e31d2 --- /dev/null +++ b/Forge/src/main/resources/pack.mcmeta @@ -0,0 +1,7 @@ +{ + "pack": { + "description": "Custom Window Title", + "pack_format": 5, + "_comment": "" + } +}