From 6dee22fcfe3e1c57045f7b8b07b197dbca121a83 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Thu, 26 May 2022 22:21:17 +0800 Subject: + enable links from soopymc.my.to to be shown in patcher image preview --- features/globalSettings/index.js | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'features/globalSettings') diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js index 39a2714..92132d8 100644 --- a/features/globalSettings/index.js +++ b/features/globalSettings/index.js @@ -73,9 +73,30 @@ class GlobalSettings extends Feature { this.registerEvent("tick", this.fixNEU) } - if (net.minecraftforge.fml.common.Loader.isModLoaded("SoopyV2")) { + // if (net.minecraftforge.fml.common.Loader.isModLoaded("SoopyV2")) { + //TODO: stuff here + // } - } + try { //This enables links from soopymc.my.to to be shown in patcher image preview + let hasHost = false + + for (let host of Java.type("gg.essential.util.TrustedHostsUtil").INSTANCE.getTrustedHosts()) { + if (host.getName() === "soopymc") { + hasHost = true + } + } + + if (!hasHost) { + let TrustedHost = Java.type("gg.essential.api.utils.TrustedHostsUtil").TrustedHost + let TreeSet = Java.type("java.util.TreeSet") + let hosts = new TreeSet() + hosts.add("soopymc.my.to") + + let host = new TrustedHost(124123, "soopymc", hosts) + + Java.type("gg.essential.util.TrustedHostsUtil").INSTANCE.addTrustedHost(host) + } + } catch (e) { } this.registerCommand("soopyweight", (user = Player.getName()) => { this.soopyWeight(user) -- cgit