From d9535643fcc7551cc6d7f9df562e21d36108bd75 Mon Sep 17 00:00:00 2001 From: samolego <34912839+samolego@users.noreply.github.com> Date: Sat, 6 Feb 2021 22:35:00 +0100 Subject: [PATCH] Fabric works! --- build.gradle | 26 ++++++++++++++++--- common/build.gradle | 2 -- .../mixin/MixinServerLoginNetworkHandler.java | 2 -- .../simpleauth/utils/PlatformSpecific.java | 2 +- fabric/build.gradle | 2 -- forge/build.gradle | 2 -- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index c928b97..32c8880 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,20 @@ -plugins { - id "architectury-plugin" version "2.0.65" - id "forgified-fabric-loom" version "0.6.54" apply false +buildscript { + repositories { + maven { url "https://maven.shedaniel.me/" } + } + + dependencies { + classpath 'com.netflix.nebula:gradle-aggregate-javadocs-plugin:2.2.+' + } } + +plugins { + id "architectury-plugin" version "2.0.68" + id "forgified-fabric-loom" version "0.6.64" apply false +} + + architectury { minecraft = rootProject.minecraft_version } @@ -13,7 +25,13 @@ subprojects { loom { silentMojangMappingsLicense() } + + dependencies { + minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" + mappings("net.fabricmc:yarn:${rootProject.yarn_mappings}:v2") + } } +apply plugin: 'nebula-aggregate-javadocs' allprojects { apply plugin: "java" @@ -31,7 +49,7 @@ allprojects { // We'll use that if it's available, but otherwise we'll use the older option. def targetVersion = 8 if (JavaVersion.current().isJava9Compatible()) { - options.release = 8 + options.release = targetVersion } } diff --git a/common/build.gradle b/common/build.gradle index e043178..2a1e071 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -9,8 +9,6 @@ loom { } dependencies { - minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" - mappings("net.fabricmc:yarn:${rootProject.yarn_mappings}:v2") // We depend on fabric loader here to use the fabric @Environment annotations // Do NOT use other classes from fabric loader modCompile "net.fabricmc:fabric-loader:${rootProject.loader_version}" diff --git a/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerLoginNetworkHandler.java b/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerLoginNetworkHandler.java index ede0dfb..353155b 100644 --- a/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerLoginNetworkHandler.java +++ b/common/src/main/java/org/samo_lego/simpleauth/mixin/MixinServerLoginNetworkHandler.java @@ -4,10 +4,8 @@ import com.mojang.authlib.GameProfile; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.network.packet.c2s.login.LoginHelloC2SPacket; import net.minecraft.server.network.ServerLoginNetworkHandler; -import net.minecraft.text.TranslatableText; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; diff --git a/common/src/main/java/org/samo_lego/simpleauth/utils/PlatformSpecific.java b/common/src/main/java/org/samo_lego/simpleauth/utils/PlatformSpecific.java index 86c8c9b..e2804bf 100644 --- a/common/src/main/java/org/samo_lego/simpleauth/utils/PlatformSpecific.java +++ b/common/src/main/java/org/samo_lego/simpleauth/utils/PlatformSpecific.java @@ -7,6 +7,6 @@ public class PlatformSpecific { @ExpectPlatform public static boolean isPlayerFake(PlayerEntity player) { // Replaced by Architectury - return false; + throw new AssertionError(); } } diff --git a/fabric/build.gradle b/fabric/build.gradle index c58aec5..8a4d6de 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -21,8 +21,6 @@ architectury { } dependencies { - minecraft("com.mojang:minecraft:${rootProject.minecraft_version}") - mappings("net.fabricmc:yarn:${rootProject.yarn_mappings}:v2") modImplementation("net.fabricmc:fabric-loader:${rootProject.loader_version}") modImplementation("net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_version}") diff --git a/forge/build.gradle b/forge/build.gradle index cf590f8..a1aff29 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -18,8 +18,6 @@ loom { } dependencies { - minecraft("com.mojang:minecraft:${rootProject.minecraft_version}") - mappings("net.fabricmc:yarn:${rootProject.yarn_mappings}:v2") forge("net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}") modCompile("me.shedaniel:architectury:${rootProject.architectury_version}:forge")