|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Denery <dorofeevij@gmail.com> |
| 3 | +Date: Mon, 1 May 2023 13:11:24 +0300 |
| 4 | +Subject: [PATCH] Toki branding |
| 5 | + |
| 6 | + |
| 7 | +diff --git a/build.gradle b/build.gradle |
| 8 | +index d3b1e2208dc7c5202ec09b9e43349f91855fabb6..451fc2e0f404cfe84b9621224132a41baf6ed804 100644 |
| 9 | +--- a/build.gradle |
| 10 | ++++ b/build.gradle |
| 11 | +@@ -93,7 +93,7 @@ dependencies { |
| 12 | + processResources { |
| 13 | + inputs.property "version", project.version |
| 14 | + |
| 15 | +- filesMatching("fabric.mod.json") { |
| 16 | ++ filesMatching("toki.mod.json") { // Toki |
| 17 | + expand "version": project.version |
| 18 | + } |
| 19 | + } |
| 20 | +diff --git a/src/main/java/net/fabricmc/loader/impl/discovery/ArgumentModCandidateFinder.java b/src/main/java/net/fabricmc/loader/impl/discovery/ArgumentModCandidateFinder.java |
| 21 | +index 5705d5b3b951e422a11c99bf41544cbf8b653dd6..62ee03c60e77877d484e429263aa0406569db57c 100644 |
| 22 | +--- a/src/main/java/net/fabricmc/loader/impl/discovery/ArgumentModCandidateFinder.java |
| 23 | ++++ b/src/main/java/net/fabricmc/loader/impl/discovery/ArgumentModCandidateFinder.java |
| 24 | +@@ -93,7 +93,7 @@ public class ArgumentModCandidateFinder implements ModCandidateFinder { |
| 25 | + return; |
| 26 | + } |
| 27 | + |
| 28 | +- if (Files.exists(path.resolve("fabric.mod.json"))) { // extracted mod |
| 29 | ++ if (Files.exists(path.resolve("toki.mod.json"))) { // extracted mod // Toki |
| 30 | + out.accept(path, requiresRemap); |
| 31 | + } else { // dir containing jars |
| 32 | + try { |
| 33 | +diff --git a/src/main/java/net/fabricmc/loader/impl/discovery/ClasspathModCandidateFinder.java b/src/main/java/net/fabricmc/loader/impl/discovery/ClasspathModCandidateFinder.java |
| 34 | +index 55caa1b1c94bac01b1d74cf1e77f06426c745c5a..e86e256e60291693f810dd9b77d3e645667d57f4 100644 |
| 35 | +--- a/src/main/java/net/fabricmc/loader/impl/discovery/ClasspathModCandidateFinder.java |
| 36 | ++++ b/src/main/java/net/fabricmc/loader/impl/discovery/ClasspathModCandidateFinder.java |
| 37 | +@@ -48,13 +48,13 @@ public class ClasspathModCandidateFinder implements ModCandidateFinder { |
| 38 | + |
| 39 | + // Search for URLs which point to 'fabric.mod.json' entries, to be considered as mods. |
| 40 | + try { |
| 41 | +- Enumeration<URL> mods = FabricLauncherBase.getLauncher().getTargetClassLoader().getResources("fabric.mod.json"); |
| 42 | ++ Enumeration<URL> mods = FabricLauncherBase.getLauncher().getTargetClassLoader().getResources("toki.mod.json"); // Toki |
| 43 | + |
| 44 | + while (mods.hasMoreElements()) { |
| 45 | + URL url = mods.nextElement(); |
| 46 | + |
| 47 | + try { |
| 48 | +- Path path = LoaderUtil.normalizeExistingPath(UrlUtil.getCodeSource(url, "fabric.mod.json")); |
| 49 | ++ Path path = LoaderUtil.normalizeExistingPath(UrlUtil.getCodeSource(url, "toki.mod.json")); // Toki |
| 50 | + List<Path> paths = pathGroups.get(path); |
| 51 | + |
| 52 | + if (paths == null) { |
| 53 | +@@ -63,7 +63,7 @@ public class ClasspathModCandidateFinder implements ModCandidateFinder { |
| 54 | + out.accept(paths, false); |
| 55 | + } |
| 56 | + } catch (UrlConversionException e) { |
| 57 | +- Log.debug(LogCategory.DISCOVERY, "Error determining location for fabric.mod.json from %s", url, e); |
| 58 | ++ Log.debug(LogCategory.DISCOVERY, "Error determining location for toki.mod.json from %s", url, e); // Toki |
| 59 | + } |
| 60 | + } |
| 61 | + } catch (IOException e) { |
| 62 | +diff --git a/src/main/java/net/fabricmc/loader/impl/discovery/ModDiscoverer.java b/src/main/java/net/fabricmc/loader/impl/discovery/ModDiscoverer.java |
| 63 | +index 9d786e0a5c4deef81efac7432bbbe8fe45a81af1..fe6e7942c5405e2fef92231f934010b2032ded99 100644 |
| 64 | +--- a/src/main/java/net/fabricmc/loader/impl/discovery/ModDiscoverer.java |
| 65 | ++++ b/src/main/java/net/fabricmc/loader/impl/discovery/ModDiscoverer.java |
| 66 | +@@ -268,7 +268,7 @@ public final class ModDiscoverer { |
| 67 | + } |
| 68 | + |
| 69 | + private ModCandidate computeDir(Path path) throws IOException, ParseMetadataException { |
| 70 | +- Path modJson = path.resolve("fabric.mod.json"); |
| 71 | ++ Path modJson = path.resolve("toki.mod.json"); |
| 72 | + if (!Files.exists(modJson)) return null; |
| 73 | + |
| 74 | + LoaderModMetadata metadata; |
| 75 | +@@ -282,7 +282,7 @@ public final class ModDiscoverer { |
| 76 | + |
| 77 | + private ModCandidate computeJarFile(Path path) throws IOException, ParseMetadataException { |
| 78 | + try (ZipFile zf = new ZipFile(path.toFile())) { |
| 79 | +- ZipEntry entry = zf.getEntry("fabric.mod.json"); |
| 80 | ++ ZipEntry entry = zf.getEntry("toki.mod.json"); // Toki |
| 81 | + if (entry == null) return null; |
| 82 | + |
| 83 | + LoaderModMetadata metadata; |
| 84 | +@@ -355,7 +355,7 @@ public final class ModDiscoverer { |
| 85 | + |
| 86 | + try (ZipInputStream zis = new ZipInputStream(is)) { |
| 87 | + while ((entry = zis.getNextEntry()) != null) { |
| 88 | +- if (entry.getName().equals("fabric.mod.json")) { |
| 89 | ++ if (entry.getName().equals("toki.mod.json")) { // Toki |
| 90 | + metadata = parseMetadata(zis, localPath); |
| 91 | + break; |
| 92 | + } |
| 93 | +diff --git a/src/main/java/net/fabricmc/loader/impl/metadata/ModMetadataParser.java b/src/main/java/net/fabricmc/loader/impl/metadata/ModMetadataParser.java |
| 94 | +index 875c2a104207f6063f7a3abfa0b55b9ce765e3d5..04f88da151ffe280319d568bc907b1f958b82f0a 100644 |
| 95 | +--- a/src/main/java/net/fabricmc/loader/impl/metadata/ModMetadataParser.java |
| 96 | ++++ b/src/main/java/net/fabricmc/loader/impl/metadata/ModMetadataParser.java |
| 97 | +@@ -80,7 +80,7 @@ public final class ModMetadataParser { |
| 98 | + reader.setRewindEnabled(true); |
| 99 | + |
| 100 | + if (reader.peek() != JsonToken.BEGIN_OBJECT) { |
| 101 | +- throw new ParseMetadataException("Root of \"fabric.mod.json\" must be an object", reader); |
| 102 | ++ throw new ParseMetadataException("Root of \"toki.mod.json\" must be an object", reader); // Toki |
| 103 | + } |
| 104 | + |
| 105 | + reader.beginObject(); |
| 106 | +@@ -128,7 +128,7 @@ public final class ModMetadataParser { |
| 107 | + reader.endObject(); |
| 108 | + |
| 109 | + if (isDevelopment) { |
| 110 | +- Log.warn(LogCategory.METADATA, "\"fabric.mod.json\" from mod %s did not have \"schemaVersion\" as first field.", ret.getId()); |
| 111 | ++ Log.warn(LogCategory.METADATA, "\"toki.mod.json\" from mod %s did not have \"schemaVersion\" as first field.", ret.getId()); // Toki |
| 112 | + } |
| 113 | + |
| 114 | + return ret; |
| 115 | +diff --git a/src/main/java/net/fabricmc/loader/impl/metadata/ParseMetadataException.java b/src/main/java/net/fabricmc/loader/impl/metadata/ParseMetadataException.java |
| 116 | +index e4d114abb1fbae64b24327326d26ace4b464b88f..32bdf559ffdf4a9ac27fae273797f76c69ef6861 100644 |
| 117 | +--- a/src/main/java/net/fabricmc/loader/impl/metadata/ParseMetadataException.java |
| 118 | ++++ b/src/main/java/net/fabricmc/loader/impl/metadata/ParseMetadataException.java |
| 119 | +@@ -48,7 +48,7 @@ public class ParseMetadataException extends Exception { |
| 120 | + |
| 121 | + @Override |
| 122 | + public String getMessage() { |
| 123 | +- String ret = "Error reading fabric.mod.json file for mod at "; |
| 124 | ++ String ret = "Error reading toki.mod.json file for mod at "; // Toki |
| 125 | + |
| 126 | + if (modPaths == null) { |
| 127 | + ret += "unknown location"; |
| 128 | +diff --git a/src/main/java/net/fabricmc/loader/impl/metadata/V1ModMetadata.java b/src/main/java/net/fabricmc/loader/impl/metadata/V1ModMetadata.java |
| 129 | +index d369064dbf8ddf6bdf99a0fb2f6d75dcf234a608..dc5fe1feb432f433987c6b84d477c65af1428e8e 100644 |
| 130 | +--- a/src/main/java/net/fabricmc/loader/impl/metadata/V1ModMetadata.java |
| 131 | ++++ b/src/main/java/net/fabricmc/loader/impl/metadata/V1ModMetadata.java |
| 132 | +@@ -276,7 +276,7 @@ final class V1ModMetadata extends AbstractModMetadata implements LoaderModMetada |
| 133 | + @Override |
| 134 | + public void emitFormatWarnings() { |
| 135 | + if (hasRequires) { |
| 136 | +- Log.warn(LogCategory.METADATA, "Mod `%s` (%s) uses 'requires' key in fabric.mod.json, which is not supported - use 'depends'", this.id, this.version); |
| 137 | ++ Log.warn(LogCategory.METADATA, "Mod `%s` (%s) uses 'requires' key in toki.mod.json, which is not supported - use 'depends'", this.id, this.version); // Toki |
| 138 | + } |
| 139 | + } |
| 140 | + |
| 141 | +diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/toki.mod.json |
| 142 | +similarity index 100% |
| 143 | +rename from src/main/resources/fabric.mod.json |
| 144 | +rename to src/main/resources/toki.mod.json |
0 commit comments