From 3192dc81accb82037ac0129f98f928e626ecc77b Mon Sep 17 00:00:00 2001 From: SquidDev Date: Tue, 14 May 2019 16:35:40 +0100 Subject: [PATCH] Bump to 1.14.1 --- build.gradle | 45 +++++++++---------- gradle.properties | 4 +- .../shared/computer/core/ComputerState.java | 6 +-- .../peripheral/diskdrive/DiskDriveState.java | 6 +-- .../modem/wired/CableModemVariant.java | 6 +-- .../peripheral/monitor/MonitorEdgeState.java | 6 +-- .../peripheral/speaker/SpeakerPeripheral.java | 2 +- .../shared/util/NamedBlockEntityType.java | 2 +- src/main/resources/fabric.mod.json | 4 ++ 9 files changed, 41 insertions(+), 40 deletions(-) diff --git a/build.gradle b/build.gradle index 3b2478d43..edd773112 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } plugins { - id 'fabric-loom' version '0.2.2-SNAPSHOT' + id 'fabric-loom' version '0.2.3-SNAPSHOT' id 'com.matthewprenger.cursegradle' version '1.2.0' id "com.github.breadmoirai.github-release" version "2.2.4" } @@ -53,22 +53,9 @@ configurations { dependencies { minecraft "com.mojang:minecraft:${mc_version}" mappings "net.fabricmc:yarn:${mc_version}+build.${mappings_version}" + // modCompile "net.fabricmc:fabric-loader:0.4.6+build.143" modCompile "net.fabricmc:fabric-loader:0.4.6+build.141" - modCompile "net.fabricmc:fabric:0.2.7+build.126" - - /* - modCompile "net.fabricmc:fabric-lib:0.1.0" - modCompile "net.fabricmc:fabric-networking:0.1.0" - modCompile "net.fabricmc:fabric-networking-blockentity:0.1.0" - modCompile "net.fabricmc:fabric-object-builders:0.1.0" - modCompile "net.fabricmc:fabric-containers:0.1.0" - modCompile "net.fabricmc:fabric-item-groups:0.1.0" - modCompile "net.fabricmc:fabric-client-registries:0.1.0" - modCompile "net.fabricmc:fabric-commands:0.1.0" - modCompile "net.fabricmc:fabric-events-lifecycle:0.1.0" - modCompile "net.fabricmc:fabric-events-interaction:0.1.0" - modCompile "net.fabricmc:fabric-resource-loader:0.1.0" - */ + modCompile "net.fabricmc.fabric-api:fabric-api:0.3.0-pre+build.156" implementation 'com.google.code.findbugs:jsr305:3.0.2' @@ -126,8 +113,11 @@ task proguard(type: ProGuardTask, dependsOn: jar) { description "Removes unused shadowed classes from the jar" group "compact" - injars jar.archivePath - outjars "${jar.archivePath.absolutePath.replace(".jar", "")}-min.jar" + afterEvaluate { + // Fabric changes the jar's classifier so we to do this after evaluating! + injars jar.archivePath + outjars "${jar.archivePath.absolutePath.replace(".jar", "")}-min.jar" + } // Add the main runtime jar and all non-shadowed dependencies libraryjars "${System.getProperty('java.home')}/lib/rt.jar" @@ -167,7 +157,7 @@ task proguardMove(dependsOn: proguard) { } } - +remapJar.dependsOn proguardMove processResources { inputs.property "version", mod_version @@ -203,7 +193,7 @@ processResources { } } -task compressJson(dependsOn: jar) { +task compressJson(dependsOn: remapJar) { group "compact" description "Minifies all JSON files, stripping whitespace" @@ -249,13 +239,22 @@ curseforge { apiKey = project.hasProperty('curseForgeApiKey') ? project.curseForgeApiKey : '' project { id = '282001' - addGameVersion '1.14-Snapshot' + addGameVersion '1.14.1' releaseType = 'beta' changelog = "Release notes can be found on the GitHub repository (https://github.com/SquidDev-CC/CC-Tweaked/releases/tag/v${mc_version}-${mod_version})." relations { incompatible "computercraft" + requiredDependency "fabric" } + afterEvaluate { + mainArtifact(remapJar.output) + uploadTask.dependsOn(remapJar) + } + } + + options { + forgeGradleIntegration = false } } @@ -326,7 +325,7 @@ githubRelease { releaseAssets.from(jar.archivePath) } -task uploadAll(dependsOn: [uploadArchives, "curseforge", "githubRelease"]) { +task uploadAll(dependsOn: [remapJar, uploadArchives, "curseforge", "githubRelease"]) { group "upload" description "Uploads to all repositories (Maven, Curse, GitHub release)" } @@ -339,8 +338,6 @@ test { } gradle.projectsEvaluated { - remapJar.dependsOn proguardMove - tasks.withType(JavaCompile) { options.compilerArgs << "-Xlint" << "-Xlint:-processing" // Causes Forge build to fail << "-Werror" } diff --git a/gradle.properties b/gradle.properties index 043f788b3..41d0e6bf7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,5 +2,5 @@ mod_version=1.82.4 # Minecraft properties -mc_version=1.14.1 Pre-Release 1 -mappings_version=1 +mc_version=1.14.1 +mappings_version=5 diff --git a/src/main/java/dan200/computercraft/shared/computer/core/ComputerState.java b/src/main/java/dan200/computercraft/shared/computer/core/ComputerState.java index a5800094e..73c67a15b 100644 --- a/src/main/java/dan200/computercraft/shared/computer/core/ComputerState.java +++ b/src/main/java/dan200/computercraft/shared/computer/core/ComputerState.java @@ -6,11 +6,11 @@ package dan200.computercraft.shared.computer.core; -import net.minecraft.util.SnakeCaseIdentifiable; +import net.minecraft.util.StringIdentifiable; import javax.annotation.Nonnull; -public enum ComputerState implements SnakeCaseIdentifiable +public enum ComputerState implements StringIdentifiable { OFF( "off" ), ON( "on" ), @@ -25,7 +25,7 @@ public enum ComputerState implements SnakeCaseIdentifiable @Nonnull @Override - public String toSnakeCase() + public String asString() { return name; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDriveState.java b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDriveState.java index 38c170d38..1ad092171 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDriveState.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/diskdrive/DiskDriveState.java @@ -6,9 +6,9 @@ package dan200.computercraft.shared.peripheral.diskdrive; -import net.minecraft.util.SnakeCaseIdentifiable; +import net.minecraft.util.StringIdentifiable; -public enum DiskDriveState implements SnakeCaseIdentifiable +public enum DiskDriveState implements StringIdentifiable { EMPTY( "empty" ), FULL( "full" ), @@ -23,7 +23,7 @@ public enum DiskDriveState implements SnakeCaseIdentifiable @Override - public String toSnakeCase() + public String asString() { return name; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/CableModemVariant.java b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/CableModemVariant.java index e320a605a..70f9eab22 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/CableModemVariant.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/modem/wired/CableModemVariant.java @@ -6,12 +6,12 @@ package dan200.computercraft.shared.peripheral.modem.wired; -import net.minecraft.util.SnakeCaseIdentifiable; +import net.minecraft.util.StringIdentifiable; import net.minecraft.util.math.Direction; import javax.annotation.Nonnull; -public enum CableModemVariant implements SnakeCaseIdentifiable +public enum CableModemVariant implements StringIdentifiable { None( "none", null ), DownOff( "down_off", Direction.DOWN ), @@ -65,7 +65,7 @@ public enum CableModemVariant implements SnakeCaseIdentifiable @Nonnull @Override - public String toSnakeCase() + public String asString() { return name; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorEdgeState.java b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorEdgeState.java index d71ee72e5..c03c2106a 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorEdgeState.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/monitor/MonitorEdgeState.java @@ -6,13 +6,13 @@ package dan200.computercraft.shared.peripheral.monitor; -import net.minecraft.util.SnakeCaseIdentifiable; +import net.minecraft.util.StringIdentifiable; import javax.annotation.Nonnull; import static dan200.computercraft.shared.peripheral.monitor.MonitorEdgeState.Flags.*; -public enum MonitorEdgeState implements SnakeCaseIdentifiable +public enum MonitorEdgeState implements StringIdentifiable { NONE( "none", 0 ), @@ -60,7 +60,7 @@ public enum MonitorEdgeState implements SnakeCaseIdentifiable @Nonnull @Override - public String toSnakeCase() + public String asString() { return name; } diff --git a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java index f85e6188f..38c6d16a6 100644 --- a/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java +++ b/src/main/java/dan200/computercraft/shared/peripheral/speaker/SpeakerPeripheral.java @@ -106,7 +106,7 @@ public abstract class SpeakerPeripheral implements IPeripheral Instrument instrument = null; for( Instrument testInstrument : Instrument.values() ) { - if( testInstrument.toSnakeCase().equalsIgnoreCase( name ) ) + if( testInstrument.asString().equalsIgnoreCase( name ) ) { instrument = testInstrument; break; diff --git a/src/main/java/dan200/computercraft/shared/util/NamedBlockEntityType.java b/src/main/java/dan200/computercraft/shared/util/NamedBlockEntityType.java index f2d7dadeb..2add3de37 100644 --- a/src/main/java/dan200/computercraft/shared/util/NamedBlockEntityType.java +++ b/src/main/java/dan200/computercraft/shared/util/NamedBlockEntityType.java @@ -51,7 +51,7 @@ public final class NamedBlockEntityType extends BlockEnti } @Override - public boolean method_20526( Block block ) + public boolean supports( Block block ) { return block == this.block; } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index bbd58ce51..4b30c7476 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -16,6 +16,10 @@ "Aaron Mills", "SquidDev" ], + "requires": { + "fabricloader": ">=0.4.0", + "fabric": "*" + }, "environment": "*", "entrypoints": {