From 3d38f7eb9d284a13b17e9ad2668c352d5e943de0 Mon Sep 17 00:00:00 2001 From: Szum123321 Date: Sat, 11 Apr 2020 12:33:41 +0200 Subject: [PATCH] Finally works! Shadowed Jankson --- build.gradle | 56 ++++++------------- .../textile_backup/core/BackupHelper.java | 2 +- src/main/resources/META-INF/mods.toml | 2 +- 3 files changed, 20 insertions(+), 40 deletions(-) diff --git a/build.gradle b/build.gradle index dec4991..7d6e259 100644 --- a/build.gradle +++ b/build.gradle @@ -19,19 +19,14 @@ archivesBaseName = 'textile_backup[FORGE]' sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. -minecraft { - // 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 always work. - // Simply re-run your setup task after changing the mappings to update your workspace. - mappings channel: 'snapshot', version: '20190719-1.14.3' - // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. - - // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') +configurations { + shade + compile.extendsFrom shade +} + +minecraft { + mappings channel: 'snapshot', version: '20190719-1.14.3' - // Default run configurations. - // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') @@ -85,32 +80,15 @@ minecraft { } } +repositories { + mavenCentral() +} + dependencies { - // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed - // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. - // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.14.4-28.2.0' compile "blue.endless:jankson:1.2.0" - - // 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' - - // These dependencies get remapped to your current MCP mappings - // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' - - // For more info... - // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html - // http://www.gradle.org/docs/current/userguide/dependency_management.html - + shade "blue.endless:jankson:1.2.0" } // Example for how to get properties into the manifest for reading by the runtime.. @@ -126,12 +104,14 @@ jar { "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } + + configurations.shade.each { dep -> + from(project.zipTree(dep)){ + exclude 'META-INF', 'META-INF/**' + } + } } -// Example configuration to allow publishing using the maven-publish task -// we define a custom artifact that is sourced from the reobfJar output task -// and then declare that to be published -// Note you'll need to add a repository here def reobfFile = file("$buildDir/reobfJar/output.jar") def reobfArtifact = artifacts.add('default', reobfFile) { type 'jar' diff --git a/src/main/java/szum123321/textile_backup/core/BackupHelper.java b/src/main/java/szum123321/textile_backup/core/BackupHelper.java index fbb6c93..75a64ca 100644 --- a/src/main/java/szum123321/textile_backup/core/BackupHelper.java +++ b/src/main/java/szum123321/textile_backup/core/BackupHelper.java @@ -50,7 +50,7 @@ public class BackupHelper { Utilities.log("Saving server...", ctx); if(save) - server.save(true, false, false); + server.save(false, true, false); Thread thread = new Thread(new MakeBackupThread(server, ctx, comment)); diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index d12f239..f9d535e 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -6,7 +6,7 @@ issueTrackerURL="https://github.com/Szum123321/textile_backup/issues" #optional modId="textile_backup" #mandatory version="[Forge]1.1.1-1.14.4" #mandatory displayName="Textile Backup" #mandatory -updateJSONURL="http://myurl.me/" #optional +updateJSONURL="https://github.com/Szum123321/textile_backup/blob/Forge-1.14.4/update.json" #optional displayURL="https://www.curseforge.com/minecraft/mc-mods/textile-backup" #optional logoFile="textile_backup.png" #optional credits="Made on request of one of curseforge users" #optional