Browse Source

Update to 1.15.1 and update dependencies

Uses and includes the NotEnoughCrashes API
Mitchell Skaggs 5 years ago
parent
commit
46f21084fb

+ 23 - 8
build.gradle

@@ -1,7 +1,7 @@
 import java.text.SimpleDateFormat
 
 plugins {
-    id 'fabric-loom' version '0.2.5-SNAPSHOT'
+    id 'fabric-loom' version '0.2.6-SNAPSHOT'
     id 'maven-publish'
     id 'maven'
     id 'signing'
@@ -9,12 +9,21 @@ plugins {
     id 'com.matthewprenger.cursegradle' version '1.4.0'
 }
 
+repositories {
+    maven {
+        name = 'Fabric'
+        url = 'https://maven.fabricmc.net/'
+    }
+    jcenter()
+    maven { url "https://jitpack.io" }
+}
+
 sourceCompatibility = 1.8
 targetCompatibility = 1.8
 
 group = "me.shedaniel.cloth"
 archivesBaseName = "config-2"
-version = ((String) project.mod_version).contains("unstable") ? (project.mod_version + "." + buildTime()) : project.mod_version
+version = (project.mod_version as String).contains("unstable") ? (project.mod_version + "." + buildTime()) : project.mod_version as String
 
 minecraft {
 }
@@ -33,14 +42,19 @@ static def buildTime() {
 }
 
 dependencies {
+    compileOnly "com.google.code.findbugs:jsr305:3.0.2"
+
     minecraft "com.mojang:minecraft:${project.minecraft_version}"
-    mappings "net.fabricmc:yarn:${project.yarn_version}"
-    modApi "net.fabricmc:fabric-loader:${project.fabric_loader_version}"
+    mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
+
+    modApi "net.fabricmc:fabric-loader:${project.loader_version}"
     modApi "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
+
     modImplementation "io.github.prospector:modmenu:${modmenu_version}"
-    compileOnly "com.google.code.findbugs:jsr305:3.0.2"
-    //https://github.com/natanfudge/Not-Enough-Crashes/blob/master/README.md
-    modCompileOnly "com.lettuce.fudge:notenoughcrashes:$nec_version"
+
+    modImplementation "com.lettuce.fudge:notenoughcrashes-api:1.0.0"
+    include "com.lettuce.fudge:notenoughcrashes-api:1.0.0"
+    modRuntime "com.lettuce.fudge:notenoughcrashes:$nec_version"
 }
 
 bintray {
@@ -145,7 +159,8 @@ curseforge {
         project {
             id = '319057'
             releaseType = 'release'
-            addGameVersion '1.15-Snapshot'
+            addGameVersion '1.15.1'
+            addGameVersion 'Fabric'
             addGameVersion 'Java 8'
             relations {
                 requiredDependency 'fabric-api'

+ 6 - 6
gradle.properties

@@ -1,7 +1,7 @@
-minecraft_version=1.15
-yarn_version=1.15+build.1
-fabric_loader_version=0.7.2+build.174
-fabric_version=0.4.20+build.273-1.15
+minecraft_version=1.15.1
+yarn_mappings=1.15.1+build.37
+loader_version=0.7.4+build.177
+fabric_version=0.4.28+build.288-1.15
 mod_version=2.8.0
-modmenu_version=1.7.14-unstable.19w42a+build.10
-nec_version=1.1.5+1.15.1
+modmenu_version=1.8.4+build.20
+nec_version=1.2.3+1.15.1

+ 9 - 11
src/main/java/me/shedaniel/clothconfig2/impl/ScissorsHandlerImpl.java

@@ -1,11 +1,10 @@
 package me.shedaniel.clothconfig2.impl;
 
 import com.google.common.collect.Lists;
+import fudge.notenoughcrashes.api.MinecraftCrashes;
 import me.shedaniel.clothconfig2.ClothConfigInitializer;
 import me.shedaniel.clothconfig2.api.ScissorsHandler;
-import me.shedaniel.math.api.Executor;
 import me.shedaniel.math.api.Rectangle;
-import net.fabricmc.loader.api.FabricLoader;
 import net.minecraft.client.MinecraftClient;
 import net.minecraft.client.util.Window;
 import org.lwjgl.opengl.GL11;
@@ -15,17 +14,16 @@ import java.util.List;
 
 public final class ScissorsHandlerImpl implements ScissorsHandler {
 
-    @Deprecated public static final ScissorsHandler INSTANCE = new ScissorsHandlerImpl();
+    @Deprecated
+    public static final ScissorsHandler INSTANCE = new ScissorsHandlerImpl();
 
     static {
-        Executor.runIf(() -> FabricLoader.getInstance().isModLoaded("notenoughcrashes"), () -> () -> {
-            fudge.notenoughcrashes.api.NotEnoughCrashesApi.onEveryCrash(() -> {
-                try {
-                    ScissorsHandler.INSTANCE.clearScissors();
-                } catch (Throwable t) {
-                    ClothConfigInitializer.LOGGER.error("[ClothConfig] Failed clear scissors on game crash!", t);
-                }
-            });
+        MinecraftCrashes.onEveryCrash(() -> {
+            try {
+                ScissorsHandler.INSTANCE.clearScissors();
+            } catch (Throwable t) {
+                ClothConfigInitializer.LOGGER.error("[ClothConfig] Failed clear scissors on game crash!", t);
+            }
         });
     }