]> git.lizzy.rs Git - BoundingBoxOutlineReloaded.git/commitdiff
Setup for 1.12.2 LiteLoader 1.0.13-1.12.2-liteloader
authorIrtimaled <irtimaled@gmail.com>
Sun, 11 Aug 2019 06:38:25 +0000 (23:38 -0700)
committerIrtimaled <irtimaled@gmail.com>
Sun, 11 Aug 2019 06:39:26 +0000 (23:39 -0700)
build.gradle
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
src/main/java/com/irtimaled/bbor/Main.java [deleted file]
src/main/java/com/irtimaled/bbor/install/Installer.java [deleted file]
src/main/java/com/irtimaled/bbor/launch/ClientTweaker.java [deleted file]
src/main/java/com/irtimaled/bbor/launch/ServerTweaker.java [deleted file]
src/main/java/com/irtimaled/bbor/launch/Tweaker.java [deleted file]
src/main/java/com/irtimaled/bbor/litemod/LiteMod.java [new file with mode: 0644]
src/main/resources/mixins.bbor.json
src/main/resources/profile.json [deleted file]

index 17578867c21782b5e0721df2955445fdaaf2fbaa..24a9437ec2f04865b975d25b5210a4dd668239ed 100644 (file)
@@ -1,90 +1,72 @@
 buildscript {
     repositories {
-        jcenter()
-        maven { url 'https://repo.spongepowered.org/maven' }
-        maven { url 'https://jitpack.io' }
-        maven { url 'https://files.minecraftforge.net/maven' }
+        mavenLocal()
+        mavenCentral()
+        maven {
+            name = "sonatype"
+            url = "https://oss.sonatype.org/content/repositories/snapshots/"
+        }
+        maven {
+            name = "forge"
+            url = "http://files.minecraftforge.net/maven"
+        }
+        maven {
+            name = 'sponge'
+            url = 'http://repo.spongepowered.org/maven'
+        }
     }
     dependencies {
         classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
-        classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
+        classpath 'org.spongepowered:mixingradle:0.5-SNAPSHOT'
     }
 }
 
-apply plugin: 'net.minecraftforge.gradle.tweaker-client'
-apply plugin: 'java'
+apply plugin: 'net.minecraftforge.gradle.liteloader'
 apply plugin: 'org.spongepowered.mixin'
 
 group 'com.irtimaled'
 version project.buildVersion + '-' + project.mcVersion
 archivesBaseName = 'BBOutlineReloaded'
 
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
-
-repositories {
-    mavenCentral()
-    maven { url 'https://libraries.minecraft.net/' }
-    maven { url 'https://repo.spongepowered.org/maven/' }
-    maven { url 'https://jitpack.io' }
-}
-
-dependencies {
-    implementation('org.spongepowered:mixin:0.7.11-SNAPSHOT') { transitive = false }
-    implementation('net.minecraft:launchwrapper:1.12') { transitive = false }
-    implementation 'org.ow2.asm:asm:6.2'
-    implementation 'org.ow2.asm:asm-commons:6.2'
-}
-
 minecraft {
-    version = project.mcVersion
-    mappings = 'snapshot_20171003'
-    runDir = 'run'
-    tweakClass = 'com.irtimaled.bbor.launch.ClientTweaker'
-    makeObfSourceJar = false
+    version project.mcVersion
+    mappings 'snapshot_20171003'
+    runDir 'run'
 
     replace "@VERSION@", project.version
-    replaceIn "com/irtimaled/bbor/Main.java"
+    replaceIn "com/irtimaled/bbor/litemod/LiteMod.java"
+}
 
-    replace "@MC_VERSION@", project.mcVersion
-    replaceIn "com/irtimaled/bbor/Main.java"
+sourceSets {
+    main {
+        ext.refMap = "mixins.bbor.refmap.json"
+    }
 }
 
 mixin {
     defaultObfuscationEnv notch
-    add sourceSets.main, 'mixins.bbor.refmap.json'
 }
 
-sourceSets {
-    main
-    debug {
-        compileClasspath += main.compileClasspath
-    }
-}
-
-processResources {
-    filesMatching('profile.json') {
-        expand([
-                'version'      : project.version,
-                'mcVersion'    : project.mcVersion,
-                'tweakClass'   : project.minecraft.tweakClass,
-                'formattedTime': new Date().format("yyyy-MM-dd'T'HH:mm:ss'-08:00'")
-        ])
+litemod {
+    json {
+        name = "bbor"
+        displayName = "BoundingBoxOutlineReloaded"
+        description = "Shows the bounding boxes of structures and features."
+        version = project.version
+        author = "irtimaled"
+        mcversion = project.mcVersion
+        mixinConfigs += "mixins.bbor.json"
     }
-
-    inputs.property "version", project.version
-    inputs.property "mcVersion", project.mcVersion
 }
 
 jar {
-    finalizedBy reobfJar
-    manifest.attributes(
-            'Main-Class': 'com.irtimaled.bbor.Main'
-    )
-
-    classifier = 'vanilla'
+    from litemod.outputs
 }
 
-artifacts {
-    archives jar
-}
+sourceJar.enabled = false
+
+afterEvaluate {
+    jar.baseName = project.archivesBaseName
+    jar.classifier = 'litemod'
+    jar.extension = 'jar'
+}
\ No newline at end of file
index 7a3265ee94c0ab25cf079ac8ccdf87f41d455d42..fa0bd3392aadbdd66e71db18e9e52980fb104331 100644 (file)
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
index 949819d28a0b73ca5f2b07127f8bfc6c9efc2eb4..293fd09bfd925cc944cf1759c7e5b74f062e56de 100644 (file)
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
diff --git a/src/main/java/com/irtimaled/bbor/Main.java b/src/main/java/com/irtimaled/bbor/Main.java
deleted file mode 100644 (file)
index 1f34b1d..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.irtimaled.bbor;
-
-import com.irtimaled.bbor.install.Installer;
-
-public class Main {
-    public static void main(String... args) {
-        Installer.install("@VERSION@", "@MC_VERSION@");
-    }
-}
diff --git a/src/main/java/com/irtimaled/bbor/install/Installer.java b/src/main/java/com/irtimaled/bbor/install/Installer.java
deleted file mode 100644 (file)
index d0f6a21..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-package com.irtimaled.bbor.install;
-
-import javax.swing.*;
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-import java.nio.file.StandardCopyOption;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Locale;
-
-public class Installer {
-    public static void install(final String version, final String mcVersion) {
-        try {
-            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (Throwable t) {
-            t.printStackTrace();
-        }
-
-        try {
-            String osName = getOsName();
-            File minecraftFolder = getMinecraftFolder(osName);
-            File versionFolder = new File(minecraftFolder, "versions/BBOR-" + version + "/");
-            versionFolder.mkdirs();
-
-            File versionJson = new File(versionFolder, "BBOR-" + version + ".json");
-            Files.copy(Installer.class.getResourceAsStream("/profile.json"), versionJson.toPath(), StandardCopyOption.REPLACE_EXISTING);
-
-            try {
-                File profilesJson = new File(minecraftFolder, "launcher_profiles.json");
-                if (profilesJson.exists()) { // TODO: use gson instead
-                    String identifier = "\"bbor-" + mcVersion + "\"";
-                    String contents = new String(Files.readAllBytes(profilesJson.toPath()));
-                    if (contents.contains(identifier)) {
-                        contents = contents.replaceAll(",\n *" + identifier + ": \\{[^}]*},", ",");
-                        contents = contents.replaceAll(",?\n *" + identifier + ": \\{[^}]*},?", "");
-                    }
-
-                    String date = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
-
-                    contents = contents.replaceAll("(\n\\s*\"profiles\"\\s*:\\s*\\{)", "$1\n" +
-                            "    " + identifier + ": {\n" +
-                            "      \"name\": \"Bounding Box Outline Reloaded\",\n" +
-                            "      \"type\": \"custom\",\n" +
-                            "      \"created\": \"" + date + "T00:00:00.000Z\",\n" +
-                            "      \"lastUsed\": \"2100-01-01T00:00:00.000Z\",\n" +
-                            "      \"lastVersionId\": \"BBOR-" + version + "\"\n" +
-                            "    },");
-
-                    Files.write(profilesJson.toPath(), contents.getBytes());
-                }
-            } catch (Throwable t) {
-                t.printStackTrace();
-            }
-
-            try {
-                String source = Installer.class.getProtectionDomain().getCodeSource().getLocation().getPath();
-                if (source.startsWith("/") && osName.contains("win")) {
-                    source = source.substring(1);
-                }
-                File mainJar = new File(minecraftFolder, "libraries/com/irtimaled/bbor/" + version + "/bbor-" + version + ".jar");
-                mainJar.getParentFile().mkdirs();
-                Files.copy(Paths.get(source), mainJar.toPath(), StandardCopyOption.REPLACE_EXISTING);
-            } catch (Throwable t) {
-                t.printStackTrace();
-            }
-
-            JOptionPane.showMessageDialog(null,
-                    "Bounding Box Outline Reloaded " + version + " has been successfully installed!\n" +
-                            "\n" +
-                            "Re-open the Minecraft Launcher to see it in the dropdown.",
-                    "Bounding Box Outline Reloaded Installer", JOptionPane.INFORMATION_MESSAGE);
-        } catch (Throwable t) {
-            StringWriter w = new StringWriter();
-            t.printStackTrace(new PrintWriter(w));
-            JOptionPane.showMessageDialog(null,
-                    "An error occured while installing Bounding Box Outline Reloaded, please report this to the issue\n" +
-                            "tracker (https://github.com/irtimaled/BoundingBoxOutlineReloaded/issues):\n" +
-                            "\n" +
-                            w.toString().replace("\t", "    "), "Bounding Box Outline Reloaded Installer", JOptionPane.ERROR_MESSAGE);
-        }
-    }
-
-    private static File getMinecraftFolder(String osName) {
-        File minecraftFolder;
-        if (osName.contains("win")) {
-            minecraftFolder = new File(System.getenv("APPDATA") + "/.minecraft");
-        } else if (osName.contains("mac")) {
-            minecraftFolder = new File(System.getProperty("user.home") + "/Library/Application Support/minecraft");
-        } else {
-            minecraftFolder = new File(System.getProperty("user.home") + "/.minecraft");
-        }
-        return minecraftFolder;
-    }
-
-    private static String getOsName() {
-        return System.getProperty("os.name").toLowerCase(Locale.ROOT);
-    }
-}
diff --git a/src/main/java/com/irtimaled/bbor/launch/ClientTweaker.java b/src/main/java/com/irtimaled/bbor/launch/ClientTweaker.java
deleted file mode 100644 (file)
index 2da11f3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.irtimaled.bbor.launch;
-
-import java.io.File;
-import java.util.List;
-
-public class ClientTweaker extends Tweaker {
-    @Override
-    protected void addOptions(List<String> args, File gameDir, File assetsDir, String profile) {
-        addArg("--assetsDir", assetsDir.getPath());
-    }
-
-    @Override
-    public String getLaunchTarget() {
-        return "net.minecraft.client.main.Main";
-    }
-
-    @Override
-    protected boolean isClient() {
-        return true;
-    }
-}
diff --git a/src/main/java/com/irtimaled/bbor/launch/ServerTweaker.java b/src/main/java/com/irtimaled/bbor/launch/ServerTweaker.java
deleted file mode 100644 (file)
index f214d0d..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package com.irtimaled.bbor.launch;
-
-public class ServerTweaker extends Tweaker {
-    @Override
-    protected boolean isClient() {
-        return false;
-    }
-
-    @Override
-    public String getLaunchTarget() {
-        return "net.minecraft.server.MinecraftServer";
-    }
-}
diff --git a/src/main/java/com/irtimaled/bbor/launch/Tweaker.java b/src/main/java/com/irtimaled/bbor/launch/Tweaker.java
deleted file mode 100644 (file)
index 4659d9e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-package com.irtimaled.bbor.launch;
-
-import net.minecraft.launchwrapper.ITweaker;
-import net.minecraft.launchwrapper.LaunchClassLoader;
-import org.spongepowered.asm.launch.MixinBootstrap;
-import org.spongepowered.asm.mixin.MixinEnvironment;
-import org.spongepowered.asm.mixin.Mixins;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-public abstract class Tweaker implements ITweaker {
-    public List<String> args;
-
-    @Override
-    public void acceptOptions(List<String> args, File gameDir, File assetsDir, String profile) {
-        this.args = new ArrayList<>(args);
-        addArg("--version", profile);
-        addOptions(args, gameDir, assetsDir, profile);
-    }
-
-    protected void addArg(String name, String value) {
-        args.add(name);
-        if (value != null) {
-            args.add(value);
-        }
-    }
-
-    protected void addOptions(List<String> args, File gameDir, File assetsDir, String profile) {
-    }
-
-    @Override
-    public void injectIntoClassLoader(LaunchClassLoader classLoader) {
-        MixinBootstrap.init();
-        Mixins.addConfiguration("mixins.bbor.json");
-        MixinEnvironment.getDefaultEnvironment().setSide(isClient() ? MixinEnvironment.Side.CLIENT : MixinEnvironment.Side.SERVER);
-
-    }
-
-    protected abstract boolean isClient();
-
-    @Override
-    public String[] getLaunchArguments() {
-        return args.toArray(new String[0]);
-    }
-}
diff --git a/src/main/java/com/irtimaled/bbor/litemod/LiteMod.java b/src/main/java/com/irtimaled/bbor/litemod/LiteMod.java
new file mode 100644 (file)
index 0000000..3be732e
--- /dev/null
@@ -0,0 +1,28 @@
+package com.irtimaled.bbor.litemod;
+
+import com.irtimaled.bbor.client.ClientProxy;
+import com.irtimaled.bbor.common.interop.CommonInterop;
+
+import java.io.File;
+
+public class LiteMod implements com.mumfrey.liteloader.LiteMod {
+    @Override
+    public String getName() {
+        return "BoundingBoxOutlineReloaded";
+    }
+
+    @Override
+    public String getVersion() {
+        return "@VERSION@";
+    }
+
+    @Override
+    public void init(File configPath) {
+        CommonInterop.init();
+        new ClientProxy().init();
+    }
+
+    @Override
+    public void upgradeSettings(String version, File configPath, File oldConfigPath) {
+    }
+}
index 4b6b316bbb79e87333154659739da358c61ce721..93ccfcbb4745c49def2ae470a51c0b74ff70b43b 100644 (file)
@@ -1,6 +1,6 @@
 {
   "required": true,
-  "minVersion": "0.7.11",
+  "minVersion": "0.7.4",
   "compatibilityLevel": "JAVA_8",
   "target": "@env(DEFAULT)",
   "package": "com.irtimaled.bbor.mixin",
diff --git a/src/main/resources/profile.json b/src/main/resources/profile.json
deleted file mode 100644 (file)
index aa4252d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-{
-  "inheritsFrom": "${mcVersion}",
-  "id": "BBOR-${version}",
-  "jar": "${mcVersion}",
-  "time": "${formattedTime}",
-  "type": "release",
-  "arguments": {
-    "game": [
-      "--tweakClass",
-      "${tweakClass}"
-    ]
-  },
-  "mainClass": "net.minecraft.launchwrapper.Launch",
-  "libraries": [
-    {
-      "name": "com.irtimaled:bbor:${version}",
-      "url": "https://github.com/irtimaled/maven/releases/download/"
-    },
-    {
-      "name": "org.spongepowered:mixin:0.7.11-SNAPSHOT",
-      "url": "https://github.com/irtimaled/maven/releases/download/"
-    },
-    {
-      "name": "org.ow2.asm:asm:6.2",
-      "url": "http://repo1.maven.org/maven2/"
-    },
-    {
-      "name": "org.ow2.asm:asm-commons:6.2",
-      "url": "http://repo1.maven.org/maven2/"
-    },
-    {
-      "name": "net.minecraft:launchwrapper:1.12"
-    }
-  ]
-}
\ No newline at end of file