From 186627e8998e1ef2228233f178bffa6fff5c5ee0 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Sun, 7 Apr 2019 14:59:00 -0300 Subject: [PATCH] Fabric loader 0.4.0 --- build.gradle.kts | 4 ++-- .../viafabric/platform/VRPlatform.java | 10 ++++----- src/main/resources/fabric.mod.json | 22 +++++++++++-------- .../resources/mixins.viafabric.common.json | 12 ---------- ...bric.client.json => mixins.viafabric.json} | 2 ++ 5 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 src/main/resources/mixins.viafabric.common.json rename src/main/resources/{mixins.viafabric.client.json => mixins.viafabric.json} (81%) diff --git a/build.gradle.kts b/build.gradle.kts index 796dcb0..ebb18a6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,9 +51,9 @@ dependencies { minecraft("com.mojang:minecraft:19w14b") mappings("net.fabricmc:yarn:19w14b.1") - modCompile("net.fabricmc:fabric-loader:0.3.7.109") + modCompile("net.fabricmc:fabric-loader:0.4.0+build.113") - modCompile("net.fabricmc:fabric:0.2.6.119") + modCompile("net.fabricmc:fabric:0.2.6.121") } tasks.named("jar") { diff --git a/src/main/java/com/github/creeper123123321/viafabric/platform/VRPlatform.java b/src/main/java/com/github/creeper123123321/viafabric/platform/VRPlatform.java index 98d945f..be31254 100644 --- a/src/main/java/com/github/creeper123123321/viafabric/platform/VRPlatform.java +++ b/src/main/java/com/github/creeper123123321/viafabric/platform/VRPlatform.java @@ -32,8 +32,8 @@ import com.github.creeper123123321.viafabric.providers.VRVersionProvider; import com.github.creeper123123321.viafabric.util.FutureTaskId; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.fabricmc.loader.ModContainer; import net.fabricmc.loader.api.FabricLoader; +import net.fabricmc.loader.api.ModContainer; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.Entity; import net.minecraft.server.MinecraftServer; @@ -271,13 +271,13 @@ public class VRPlatform implements ViaPlatform { public JsonObject getDump() { JsonObject platformSpecific = new JsonObject(); List mods = new ArrayList<>(); - for (ModContainer mod : net.fabricmc.loader.FabricLoader.INSTANCE.getModContainers()) { + for (ModContainer mod : FabricLoader.getInstance().getAllMods()) { mods.add(new PluginInfo(true, mod.getMetadata().getName(), mod.getMetadata().getVersion().getFriendlyString(), - String.join(", ", mod.getInfo().getInitializers()), - mod.getInfo().getAuthors().stream() - .map(info -> info.getName() + " <" + info.getEmail() + "> (" + info.getWebsite() + ")") + null, + mod.getMetadata().getAuthors().stream() + .map(info -> info.getName() + "(" + info.getContact().asMap() + ")") .collect(Collectors.toList()) )); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 3e414d5..ef0e428 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,29 +1,33 @@ { + "schemaVersion": 1, "id": "viafabric", "name": "ViaFabric", - "side": "universal", "version": "@version@", "description": "@description@", "license": "MIT", - "links": { + "contact": { "homepage": "https://github.com/ViaVersion/ViaFabric", "issues": "https://github.com/ViaVersion/ViaFabric/issues", "sources": "https://github.com/ViaVersion/ViaFabric" }, + "icon": "assets/viaversion/textures/logo.png", + "environment": "*", "authors": [ "creeper123123321" ], - "initializers": [ - "com.github.creeper123123321.viafabric.ViaFabric" - ], + "entrypoints": { + "main": [ + "com.github.creeper123123321.viafabric.ViaFabric" + ] + }, "requires": { + "fabricloader": ">=0.4.0" }, "recommended": { "fabric": "*", "clientcommands": "*" }, - "mixins": { - "common": "mixins.viafabric.common.json", - "client": "mixins.viafabric.client.json" - } + "mixins": [ + "mixins.viafabric.json" + ] } diff --git a/src/main/resources/mixins.viafabric.common.json b/src/main/resources/mixins.viafabric.common.json deleted file mode 100644 index 8890986..0000000 --- a/src/main/resources/mixins.viafabric.common.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "required": true, - "compatibilityLevel": "JAVA_8", - "package": "com.github.creeper123123321.viafabric.mixin", - "mixins": [ - "MixinServerNetworkIOChInit", - "MixinClientConnection" - ], - "injectors": { - "defaultRequire": 1 - } -} diff --git a/src/main/resources/mixins.viafabric.client.json b/src/main/resources/mixins.viafabric.json similarity index 81% rename from src/main/resources/mixins.viafabric.client.json rename to src/main/resources/mixins.viafabric.json index a545c16..6c13530 100644 --- a/src/main/resources/mixins.viafabric.client.json +++ b/src/main/resources/mixins.viafabric.json @@ -3,6 +3,8 @@ "compatibilityLevel": "JAVA_8", "package": "com.github.creeper123123321.viafabric.mixin", "mixins": [ + "MixinServerNetworkIOChInit", + "MixinClientConnection" ], "client": [ "client.MixinClientConnectionChInit",