aboutsummaryrefslogtreecommitdiff
path: root/features/globalSettings
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-26 22:21:17 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-26 22:21:17 +0800
commit6dee22fcfe3e1c57045f7b8b07b197dbca121a83 (patch)
tree15166c8e437cd3e9a9fe6b17564c74bb3fba4331 /features/globalSettings
parenta0ae59e33748047377b5ae65df675759a10bff18 (diff)
downloadSoopyV2-6dee22fcfe3e1c57045f7b8b07b197dbca121a83.tar.gz
SoopyV2-6dee22fcfe3e1c57045f7b8b07b197dbca121a83.tar.bz2
SoopyV2-6dee22fcfe3e1c57045f7b8b07b197dbca121a83.zip
+ enable links from soopymc.my.to to be shown in patcher image preview
Diffstat (limited to 'features/globalSettings')
-rw-r--r--features/globalSettings/index.js25
1 files changed, 23 insertions, 2 deletions
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)