diff --git a/build.gradle.kts b/build.gradle.kts index 6d0b217..8a4a931 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ * defined by the Mozilla Public License, v. 2.0. */ plugins { - id("fabric-loom") version "1.6-SNAPSHOT" + id("fabric-loom") version "1.9-SNAPSHOT" `maven-publish` } @@ -24,6 +24,14 @@ repositories { mavenPom() } } + + maven(url = "https://maven.neoforged.net/releases") { + name = "NeoForge" + metadataSources { + ignoreGradleMetadataRedirection() + mavenPom() + } + } } val archives_base_name: String by project.ext @@ -33,6 +41,7 @@ val minecraft_version: String by project.ext val yarn_mappings: String by project.ext val loader_version: String by project.ext val forge_version: String by project.ext +val neofml_version: String by project.ext base.archivesName.set(archives_base_name) version = mod_version @@ -62,6 +71,9 @@ dependencies { compileOnly("net.minecraftforge:fmlloader:${forge_version}") { isTransitive = false } + compileOnly("net.neoforged.fancymodloader:loader:${neofml_version}") { + isTransitive = false + } compileOnly("org.apache.maven:maven-artifact:3.8.7") { isTransitive = false } @@ -119,7 +131,7 @@ tasks.jar { manifest { attributes( - "MixinConfigs" to "no-telemetry.mixins.json", + "MixinConfigs" to "no-telemetry-forge.mixins.json", "Implementation-Version" to project.version, ) } diff --git a/gradle.properties b/gradle.properties index 9ec7527..97a3189 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,6 +10,9 @@ loader_version=0.15.11 # Forge forge_version=1.21-51.0.8 +# NeoForge +neofml_version=4.0.34 + # Mod Properties mod_version=1.9.0 maven_group=de.kb1000 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd49..a4b76b9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..e2847c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a4..f5feea6 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/gradlew.bat b/gradlew.bat index 6689b85..9b42019 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -43,11 +45,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/reference/no-telemetry-hashed-refmap.json b/reference/no-telemetry-hashed-refmap.json new file mode 100644 index 0000000..c9efbda --- /dev/null +++ b/reference/no-telemetry-hashed-refmap.json @@ -0,0 +1,48 @@ +{ + "mappings": { + "de/kb1000/notelemetry/mixin/MinecraftClientMixin": { + "isTelemetryEnabledByApi()Z": "Lnet/minecraft/unmapped/C_ayfeobid;m_oussibsz()Z", + "net.minecraft.client.MinecraftClient": "net/minecraft/unmapped/C_ayfeobid" + }, + "de/kb1000/notelemetry/mixin/OptionsScreenMixin": { + "Lnet/minecraft/client/gui/screen/option/OptionsScreen;TELEMETRY_TEXT:Lnet/minecraft/text/Text;": "Lnet/minecraft/unmapped/C_agyxinfj;f_bfgxwwch:Lnet/minecraft/unmapped/C_rdaqiwdt;", + "Lnet/minecraft/client/gui/widget/GridWidget$Adder;add(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget;": "Lnet/minecraft/unmapped/C_qykucwmu$C_iamgoveg;m_xrbojlyf(Lnet/minecraft/unmapped/C_dpukplka;)Lnet/minecraft/unmapped/C_dpukplka;", + "init": "Lnet/minecraft/unmapped/C_agyxinfj;m_xaqeivsh()V", + "net.minecraft.client.gui.screen.option.OptionsScreen": "net/minecraft/unmapped/C_agyxinfj" + }, + "de/kb1000/notelemetry/mixin/Post1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/unmapped/C_otltijcb;f_kgpztkbc:Z", + "Lnet/minecraft/client/MinecraftClient;isTelemetryEnabledByApi()Z": "Lnet/minecraft/unmapped/C_ayfeobid;m_oussibsz()Z", + "Lnet/minecraft/client/session/telemetry/TelemetryManager;computeSender": "net/minecraft/unmapped/C_cgkxybww;m_qsixfwvb()Lnet/minecraft/unmapped/C_wzhvxvch;", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/unmapped/C_cgkxybww" + }, + "de/kb1000/notelemetry/mixin/Pre1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/unmapped/C_otltijcb;f_kgpztkbc:Z", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/unmapped/C_cgkxybww" + } + }, + "data": { + "named:intermediary": { + "de/kb1000/notelemetry/mixin/MinecraftClientMixin": { + "isTelemetryEnabledByApi()Z": "Lnet/minecraft/unmapped/C_ayfeobid;m_oussibsz()Z", + "net.minecraft.client.MinecraftClient": "net/minecraft/unmapped/C_ayfeobid" + }, + "de/kb1000/notelemetry/mixin/OptionsScreenMixin": { + "Lnet/minecraft/client/gui/screen/option/OptionsScreen;TELEMETRY_TEXT:Lnet/minecraft/text/Text;": "Lnet/minecraft/unmapped/C_agyxinfj;f_bfgxwwch:Lnet/minecraft/unmapped/C_rdaqiwdt;", + "Lnet/minecraft/client/gui/widget/GridWidget$Adder;add(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget;": "Lnet/minecraft/unmapped/C_qykucwmu$C_iamgoveg;m_xrbojlyf(Lnet/minecraft/unmapped/C_dpukplka;)Lnet/minecraft/unmapped/C_dpukplka;", + "init": "Lnet/minecraft/unmapped/C_agyxinfj;m_xaqeivsh()V", + "net.minecraft.client.gui.screen.option.OptionsScreen": "net/minecraft/unmapped/C_agyxinfj" + }, + "de/kb1000/notelemetry/mixin/Post1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/unmapped/C_otltijcb;f_kgpztkbc:Z", + "Lnet/minecraft/client/MinecraftClient;isTelemetryEnabledByApi()Z": "Lnet/minecraft/unmapped/C_ayfeobid;m_oussibsz()Z", + "Lnet/minecraft/client/session/telemetry/TelemetryManager;computeSender": "net/minecraft/unmapped/C_cgkxybww;m_qsixfwvb()Lnet/minecraft/unmapped/C_wzhvxvch;", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/unmapped/C_cgkxybww" + }, + "de/kb1000/notelemetry/mixin/Pre1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/unmapped/C_otltijcb;f_kgpztkbc:Z", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/unmapped/C_cgkxybww" + } + } + } +} \ No newline at end of file diff --git a/src/main/java/de/kb1000/notelemetry/CommonUtil.java b/src/main/java/de/kb1000/notelemetry/CommonUtil.java index 37fd2ae..4506d06 100644 --- a/src/main/java/de/kb1000/notelemetry/CommonUtil.java +++ b/src/main/java/de/kb1000/notelemetry/CommonUtil.java @@ -9,27 +9,15 @@ package de.kb1000.notelemetry; class CommonUtil { - static boolean isNeoForge() { - return false; // TODO - } - - static boolean isForge() { - return classExists("net.minecraftforge.fml.common.Mod") && !classExists("net.fabricmc.loader.api.FabricLoader"); - } - - static boolean isMojank() { - return isNeoForge() || (isForge() && minecraftNewerThan("1.20.5")); + static boolean isForgeNeo() { + return classExists("net.neoforged.fml.common.Mod"); } static boolean classExists(String name) { try { - return NoTelemetryMixinConfigPlugin.class.getClassLoader().loadClass(name) != null; + return NoTelemetryFabricMixinConfigPlugin.class.getClassLoader().loadClass(name) != null; } catch (Exception | LinkageError e) { return false; } } - - static boolean minecraftNewerThan(String version) { - return isForge() ? ForgeUtil.minecraftNewerThan(version) : FabricUtil.minecraftNewerThan(version); - } } diff --git a/src/main/java/de/kb1000/notelemetry/NeoForgeUtil.java b/src/main/java/de/kb1000/notelemetry/NeoForgeUtil.java new file mode 100644 index 0000000..1b67889 --- /dev/null +++ b/src/main/java/de/kb1000/notelemetry/NeoForgeUtil.java @@ -0,0 +1,24 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * This Source Code Form is "Incompatible With Secondary Licenses", as + * defined by the Mozilla Public License, v. 2.0. + */ +package de.kb1000.notelemetry; + +import net.neoforged.fml.loading.FMLLoader; +import org.apache.maven.artifact.versioning.DefaultArtifactVersion; +import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; +import org.apache.maven.artifact.versioning.VersionRange; + +public class NeoForgeUtil { + public static boolean minecraftNewerThan(String version) { + try { + return VersionRange.createFromVersionSpec("[" + version + ",)").containsVersion(new DefaultArtifactVersion(FMLLoader.versionInfo().mcVersion())); + } catch (InvalidVersionSpecificationException e) { + throw new RuntimeException(e); + } + } +} diff --git a/src/main/java/de/kb1000/notelemetry/NoTelemetryMixinConfigPlugin.java b/src/main/java/de/kb1000/notelemetry/NoTelemetryFabricMixinConfigPlugin.java similarity index 70% rename from src/main/java/de/kb1000/notelemetry/NoTelemetryMixinConfigPlugin.java rename to src/main/java/de/kb1000/notelemetry/NoTelemetryFabricMixinConfigPlugin.java index 8d3a1ad..34bd3a8 100644 --- a/src/main/java/de/kb1000/notelemetry/NoTelemetryMixinConfigPlugin.java +++ b/src/main/java/de/kb1000/notelemetry/NoTelemetryFabricMixinConfigPlugin.java @@ -15,32 +15,27 @@ import java.util.List; import java.util.Set; -public class NoTelemetryMixinConfigPlugin implements IMixinConfigPlugin { +public class NoTelemetryFabricMixinConfigPlugin implements IMixinConfigPlugin { @Override public void onLoad(String mixinPackage) { } @Override public String getRefMapperConfig() { - if (CommonUtil.isMojank() && CommonUtil.minecraftNewerThan("1.21")) { - return "no-telemetry-mojank-refmap.json"; - } else if (CommonUtil.isMojank()) { - return "no-telemetry-mojank-1.20-refmap.json"; - } else if (CommonUtil.isForge()) { - return "no-telemetry-forge-refmap.json"; - } - return "no-telemetry-refmap.json"; + return null; } @Override public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { return switch (mixinClassName) { + case "de.kb1000.notelemetry.mixin.YggdrasilUserApiServiceMixin" -> + !FabricUtil.minecraftNewerThan("1.18-beta.3"); case "de.kb1000.notelemetry.mixin.NewYggdrasilUserApiServiceMixin" -> - CommonUtil.classExists("com.mojang.authlib.yggdrasil.response.UserAttributesResponse$Privileges"); + FabricUtil.minecraftNewerThan("1.18-beta.3"); case "de.kb1000.notelemetry.mixin.Pre1193TelemetryManagerMixin" -> - !CommonUtil.minecraftNewerThan("1.19.3-alpha.22.46.a"); + !FabricUtil.minecraftNewerThan("1.19.3-alpha.22.46.a"); case "de.kb1000.notelemetry.mixin.MinecraftClientMixin", "de.kb1000.notelemetry.mixin.OptionsScreenMixin", - "de.kb1000.notelemetry.mixin.Post1193TelemetryManagerMixin" -> CommonUtil.minecraftNewerThan("1.19.3-alpha.22.46.a"); + "de.kb1000.notelemetry.mixin.Post1193TelemetryManagerMixin" -> FabricUtil.minecraftNewerThan("1.19.3-alpha.22.46.a"); default -> true; }; } @@ -56,11 +51,9 @@ public List getMixins() { @Override public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { - } @Override public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { - } } diff --git a/src/main/java/de/kb1000/notelemetry/NoTelemetryForgeMixinConfigPlugin.java b/src/main/java/de/kb1000/notelemetry/NoTelemetryForgeMixinConfigPlugin.java new file mode 100644 index 0000000..3947aba --- /dev/null +++ b/src/main/java/de/kb1000/notelemetry/NoTelemetryForgeMixinConfigPlugin.java @@ -0,0 +1,74 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * This Source Code Form is "Incompatible With Secondary Licenses", as + * defined by the Mozilla Public License, v. 2.0. + */ +package de.kb1000.notelemetry; + +import org.objectweb.asm.tree.ClassNode; +import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinInfo; + +import java.util.List; +import java.util.Set; + +public class NoTelemetryForgeMixinConfigPlugin implements IMixinConfigPlugin { + private boolean isForgeNeo = false; + + @Override + public void onLoad(String mixinPackage) { + isForgeNeo = CommonUtil.isForgeNeo(); + } + + @Override + public String getRefMapperConfig() { + if (isForgeNeo) { + return null; + } + + if (ForgeUtil.minecraftNewerThan("1.21")) { + return "no-telemetry-mojank-refmap.json"; + } else if (ForgeUtil.minecraftNewerThan("1.20.5")) { + return "no-telemetry-mojank-1.20-refmap.json"; + } + + return "no-telemetry-forge-refmap.json"; + } + + @Override + public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { + if (isForgeNeo) { + return false; + } + + return switch (mixinClassName) { + // You can't use snapshots on Forge! + case "de.kb1000.notelemetry.mixin.YggdrasilUserApiServiceMixin" -> false; + case "de.kb1000.notelemetry.mixin.Pre1193TelemetryManagerMixin" -> + !ForgeUtil.minecraftNewerThan("1.19.3-alpha.22.46.a"); + case "de.kb1000.notelemetry.mixin.MinecraftClientMixin", "de.kb1000.notelemetry.mixin.OptionsScreenMixin", + "de.kb1000.notelemetry.mixin.Post1193TelemetryManagerMixin" -> ForgeUtil.minecraftNewerThan("1.19.3-alpha.22.46.a"); + default -> true; + }; + } + + @Override + public void acceptTargets(Set myTargets, Set otherTargets) { + } + + @Override + public List getMixins() { + return null; + } + + @Override + public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } + + @Override + public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } +} diff --git a/src/main/java/de/kb1000/notelemetry/NoTelemetryNeoForgeMixinConfigPlugin.java b/src/main/java/de/kb1000/notelemetry/NoTelemetryNeoForgeMixinConfigPlugin.java new file mode 100644 index 0000000..d1dd112 --- /dev/null +++ b/src/main/java/de/kb1000/notelemetry/NoTelemetryNeoForgeMixinConfigPlugin.java @@ -0,0 +1,54 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * This Source Code Form is "Incompatible With Secondary Licenses", as + * defined by the Mozilla Public License, v. 2.0. + */ +package de.kb1000.notelemetry; + +import org.objectweb.asm.tree.ClassNode; +import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinInfo; + +import java.util.List; +import java.util.Set; + +public class NoTelemetryNeoForgeMixinConfigPlugin implements IMixinConfigPlugin { + @Override + public void onLoad(String mixinPackage) { + } + + @Override + public String getRefMapperConfig() { + if (NeoForgeUtil.minecraftNewerThan("1.21")) { + return "no-telemetry-mojank-refmap.json"; + } else { + return "no-telemetry-mojank-1.20-refmap.json"; + } + } + + @Override + public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { + // We can just use the mixin.json for this, for now! + return true; + } + + @Override + public void acceptTargets(Set myTargets, Set otherTargets) { + } + + @Override + public List getMixins() { + return null; + } + + @Override + public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } + + @Override + public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + } +} diff --git a/src/main/java/de/kb1000/notelemetry/NoTelemetryNeoForgeMod.java b/src/main/java/de/kb1000/notelemetry/NoTelemetryNeoForgeMod.java new file mode 100644 index 0000000..c01d6fb --- /dev/null +++ b/src/main/java/de/kb1000/notelemetry/NoTelemetryNeoForgeMod.java @@ -0,0 +1,15 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * This Source Code Form is "Incompatible With Secondary Licenses", as + * defined by the Mozilla Public License, v. 2.0. + */ +package de.kb1000.notelemetry; + +import net.neoforged.fml.common.Mod; + +@Mod("no_telemetry") +public class NoTelemetryNeoForgeMod { +} diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index aca0b43..0a7b833 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,8 +1,12 @@ modLoader = "javafml" -loaderVersion = "[38,)" +# We can't rely on loaderVersion thanks to early NeoForge using mods.toml +loaderVersion = "*" issueTrackerURL = "https://github.com/kb-1000/no-telemetry/issues" license = "MPL 2.0, https://mozilla.org/MPL/2.0/" +[[mixins]] +config = "no-telemetry-neoforge.mixins.json" + [[mods]] modId = "no_telemetry" version = "${file.jarVersion}" @@ -16,4 +20,4 @@ displayURL = "https://github.com/kb-1000/no-telemetry" [[no-telemetry.dependencies]] modId = "minecraft" mandatory = true -# no versionRange, let's rely on the loader version +versionRange = "[1.18,)" diff --git a/src/main/resources/META-INF/neoforge.mods.toml b/src/main/resources/META-INF/neoforge.mods.toml new file mode 100644 index 0000000..2827fe5 --- /dev/null +++ b/src/main/resources/META-INF/neoforge.mods.toml @@ -0,0 +1,22 @@ +modLoader = "javafml" +loaderVersion = "[1,)" +issueTrackerURL = "https://github.com/kb-1000/no-telemetry/issues" +license = "MPL 2.0, https://mozilla.org/MPL/2.0/" + +[[mixins]] +config = "no-telemetry-neoforge.mixins.json" + +[[mods]] +modId = "no_telemetry" +version = "${file.jarVersion}" +displayName = "No Telemetry" +description = "Disable the telemetry introduced in 21w38a" +logoFile = "no-telemetry-icon.png" +logoBlur = false +authors = "kb1000" +displayURL = "https://github.com/kb-1000/no-telemetry" + +[[no-telemetry.dependencies]] +modId = "minecraft" +mandatory = true +# no versionRange, let's rely on the loader version diff --git a/src/main/resources/no-telemetry-forge.mixins.json b/src/main/resources/no-telemetry-forge.mixins.json new file mode 100644 index 0000000..fb04f32 --- /dev/null +++ b/src/main/resources/no-telemetry-forge.mixins.json @@ -0,0 +1,19 @@ +{ + "required": true, + "minVersion": "0.8", + "package": "de.kb1000.notelemetry.mixin", + "compatibilityLevel": "JAVA_16", + "plugin": "de.kb1000.notelemetry.NoTelemetryForgeMixinConfigPlugin", + "client": [ + "MinecraftClientMixin", + "NewYggdrasilUserApiServiceMixin", + "OptionsScreenMixin", + "Post1193TelemetryManagerMixin", + "Pre1193TelemetryManagerMixin", + "YggdrasilUserApiServiceMixin" + ], + "injectors": { + "defaultRequire": 1 + }, + "refmap": null +} diff --git a/src/main/resources/no-telemetry-mojank-1.20-refmap.json b/src/main/resources/no-telemetry-mojank-1.20-refmap.json new file mode 100644 index 0000000..d178871 --- /dev/null +++ b/src/main/resources/no-telemetry-mojank-1.20-refmap.json @@ -0,0 +1,48 @@ +{ + "mappings": { + "de/kb1000/notelemetry/mixin/MinecraftClientMixin": { + "isTelemetryEnabledByApi()Z": "Lnet/minecraft/client/Minecraft;allowsTelemetry()Z", + "net.minecraft.client.MinecraftClient": "net/minecraft/client/Minecraft" + }, + "de/kb1000/notelemetry/mixin/OptionsScreenMixin": { + "Lnet/minecraft/client/gui/screen/option/OptionsScreen;TELEMETRY_TEXT:Lnet/minecraft/text/Text;": "Lnet/minecraft/client/gui/screens/OptionsScreen;TELEMETRY:Lnet/minecraft/network/chat/Component;", + "Lnet/minecraft/client/gui/widget/GridWidget$Adder;add(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget;": "Lnet/minecraft/client/gui/layouts/GridLayout$RowHelper;addChild(Lnet/minecraft/client/gui/layouts/LayoutElement;)Lnet/minecraft/client/gui/layouts/LayoutElement;", + "init": "Lnet/minecraft/client/gui/screens/OptionsScreen;init()V", + "net.minecraft.client.gui.screen.option.OptionsScreen": "net/minecraft/client/gui/screens/OptionsScreen" + }, + "de/kb1000/notelemetry/mixin/Post1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/SharedConstants;IS_RUNNING_IN_IDE:Z", + "Lnet/minecraft/client/MinecraftClient;isTelemetryEnabledByApi()Z": "Lnet/minecraft/client/Minecraft;allowsTelemetry()Z", + "Lnet/minecraft/client/session/telemetry/TelemetryManager;computeSender": "Lnet/minecraft/client/telemetry/ClientTelemetryManager;createEventSender()Lnet/minecraft/client/telemetry/TelemetryEventSender;", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/client/telemetry/ClientTelemetryManager" + }, + "de/kb1000/notelemetry/mixin/Pre1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/SharedConstants;IS_RUNNING_IN_IDE:Z", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/client/telemetry/ClientTelemetryManager" + } + }, + "data": { + "named": { + "de/kb1000/notelemetry/mixin/MinecraftClientMixin": { + "isTelemetryEnabledByApi()Z": "Lnet/minecraft/client/Minecraft;allowsTelemetry()Z", + "net.minecraft.client.MinecraftClient": "net/minecraft/client/Minecraft" + }, + "de/kb1000/notelemetry/mixin/OptionsScreenMixin": { + "Lnet/minecraft/client/gui/screen/option/OptionsScreen;TELEMETRY_TEXT:Lnet/minecraft/text/Text;": "Lnet/minecraft/client/gui/screens/OptionsScreen;TELEMETRY:Lnet/minecraft/network/chat/Component;", + "Lnet/minecraft/client/gui/widget/GridWidget$Adder;add(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget;": "Lnet/minecraft/client/gui/layouts/GridLayout$RowHelper;addChild(Lnet/minecraft/client/gui/layouts/LayoutElement;)Lnet/minecraft/client/gui/layouts/LayoutElement;", + "init": "Lnet/minecraft/client/gui/screens/OptionsScreen;init()V", + "net.minecraft.client.gui.screen.option.OptionsScreen": "net/minecraft/client/gui/screens/OptionsScreen" + }, + "de/kb1000/notelemetry/mixin/Post1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/SharedConstants;IS_RUNNING_IN_IDE:Z", + "Lnet/minecraft/client/MinecraftClient;isTelemetryEnabledByApi()Z": "Lnet/minecraft/client/Minecraft;allowsTelemetry()Z", + "Lnet/minecraft/client/session/telemetry/TelemetryManager;computeSender": "Lnet/minecraft/client/telemetry/ClientTelemetryManager;createEventSender()Lnet/minecraft/client/telemetry/TelemetryEventSender;", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/client/telemetry/ClientTelemetryManager" + }, + "de/kb1000/notelemetry/mixin/Pre1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/SharedConstants;IS_RUNNING_IN_IDE:Z", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/client/telemetry/ClientTelemetryManager" + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/no-telemetry-mojank-refmap.json b/src/main/resources/no-telemetry-mojank-refmap.json new file mode 100644 index 0000000..60b54f4 --- /dev/null +++ b/src/main/resources/no-telemetry-mojank-refmap.json @@ -0,0 +1,48 @@ +{ + "mappings": { + "de/kb1000/notelemetry/mixin/MinecraftClientMixin": { + "isTelemetryEnabledByApi()Z": "Lnet/minecraft/client/Minecraft;allowsTelemetry()Z", + "net.minecraft.client.MinecraftClient": "net/minecraft/client/Minecraft" + }, + "de/kb1000/notelemetry/mixin/OptionsScreenMixin": { + "Lnet/minecraft/client/gui/screen/option/OptionsScreen;TELEMETRY_TEXT:Lnet/minecraft/text/Text;": "Lnet/minecraft/client/gui/screens/options/OptionsScreen;TELEMETRY:Lnet/minecraft/network/chat/Component;", + "Lnet/minecraft/client/gui/widget/GridWidget$Adder;add(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget;": "Lnet/minecraft/client/gui/layouts/GridLayout$RowHelper;addChild(Lnet/minecraft/client/gui/layouts/LayoutElement;)Lnet/minecraft/client/gui/layouts/LayoutElement;", + "init": "Lnet/minecraft/client/gui/screens/options/OptionsScreen;init()V", + "net.minecraft.client.gui.screen.option.OptionsScreen": "net/minecraft/client/gui/screens/options/OptionsScreen" + }, + "de/kb1000/notelemetry/mixin/Post1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/SharedConstants;IS_RUNNING_IN_IDE:Z", + "Lnet/minecraft/client/MinecraftClient;isTelemetryEnabledByApi()Z": "Lnet/minecraft/client/Minecraft;allowsTelemetry()Z", + "Lnet/minecraft/client/session/telemetry/TelemetryManager;computeSender": "Lnet/minecraft/client/telemetry/ClientTelemetryManager;createEventSender()Lnet/minecraft/client/telemetry/TelemetryEventSender;", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/client/telemetry/ClientTelemetryManager" + }, + "de/kb1000/notelemetry/mixin/Pre1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/SharedConstants;IS_RUNNING_IN_IDE:Z", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/client/telemetry/ClientTelemetryManager" + } + }, + "data": { + "named": { + "de/kb1000/notelemetry/mixin/MinecraftClientMixin": { + "isTelemetryEnabledByApi()Z": "Lnet/minecraft/client/Minecraft;allowsTelemetry()Z", + "net.minecraft.client.MinecraftClient": "net/minecraft/client/Minecraft" + }, + "de/kb1000/notelemetry/mixin/OptionsScreenMixin": { + "Lnet/minecraft/client/gui/screen/option/OptionsScreen;TELEMETRY_TEXT:Lnet/minecraft/text/Text;": "Lnet/minecraft/client/gui/screens/options/OptionsScreen;TELEMETRY:Lnet/minecraft/network/chat/Component;", + "Lnet/minecraft/client/gui/widget/GridWidget$Adder;add(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget;": "Lnet/minecraft/client/gui/layouts/GridLayout$RowHelper;addChild(Lnet/minecraft/client/gui/layouts/LayoutElement;)Lnet/minecraft/client/gui/layouts/LayoutElement;", + "init": "Lnet/minecraft/client/gui/screens/options/OptionsScreen;init()V", + "net.minecraft.client.gui.screen.option.OptionsScreen": "net/minecraft/client/gui/screens/options/OptionsScreen" + }, + "de/kb1000/notelemetry/mixin/Post1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/SharedConstants;IS_RUNNING_IN_IDE:Z", + "Lnet/minecraft/client/MinecraftClient;isTelemetryEnabledByApi()Z": "Lnet/minecraft/client/Minecraft;allowsTelemetry()Z", + "Lnet/minecraft/client/session/telemetry/TelemetryManager;computeSender": "Lnet/minecraft/client/telemetry/ClientTelemetryManager;createEventSender()Lnet/minecraft/client/telemetry/TelemetryEventSender;", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/client/telemetry/ClientTelemetryManager" + }, + "de/kb1000/notelemetry/mixin/Pre1193TelemetryManagerMixin": { + "Lnet/minecraft/SharedConstants;isDevelopment:Z": "Lnet/minecraft/SharedConstants;IS_RUNNING_IN_IDE:Z", + "net.minecraft.client.session.telemetry.TelemetryManager": "net/minecraft/client/telemetry/ClientTelemetryManager" + } + } + } +} \ No newline at end of file diff --git a/src/main/resources/no-telemetry-neoforge.mixins.json b/src/main/resources/no-telemetry-neoforge.mixins.json new file mode 100644 index 0000000..4a6a948 --- /dev/null +++ b/src/main/resources/no-telemetry-neoforge.mixins.json @@ -0,0 +1,18 @@ +{ + "required": true, + "minVersion": "0.8", + "package": "de.kb1000.notelemetry.mixin", + "compatibilityLevel": "JAVA_16", + "plugin": "de.kb1000.notelemetry.NoTelemetryNeoForgeMixinConfigPlugin", + "client": [ + "MinecraftClientMixin", + "NewYggdrasilUserApiServiceMixin", + "OptionsScreenMixin", + "Post1193TelemetryManagerMixin", + "YggdrasilUserApiServiceMixin" + ], + "injectors": { + "defaultRequire": 1 + }, + "refmap": null +} diff --git a/src/main/resources/no-telemetry.mixins.json b/src/main/resources/no-telemetry.mixins.json index 4eaef57..222c43b 100644 --- a/src/main/resources/no-telemetry.mixins.json +++ b/src/main/resources/no-telemetry.mixins.json @@ -3,7 +3,7 @@ "minVersion": "0.8", "package": "de.kb1000.notelemetry.mixin", "compatibilityLevel": "JAVA_16", - "plugin": "de.kb1000.notelemetry.NoTelemetryMixinConfigPlugin", + "plugin": "de.kb1000.notelemetry.NoTelemetryFabricMixinConfigPlugin", "client": [ "MinecraftClientMixin", "NewYggdrasilUserApiServiceMixin", @@ -14,6 +14,5 @@ ], "injectors": { "defaultRequire": 1 - }, - "refmap": null + } }