Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Commit 9e907a4

Browse files
Merge pull request #2 from SirXThe/master
2 parents 938e701 + 8f4ca24 commit 9e907a4

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

src/main/java/com/github/microcontrollersdev/mixmetica/mixin/CapeUtilsMixin.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
package com.github.microcontrollersdev.mixmetica.mixin;
22

3+
import org.spongepowered.asm.mixin.Dynamic;
34
import org.spongepowered.asm.mixin.Mixin;
45
import org.spongepowered.asm.mixin.Pseudo;
56
import org.spongepowered.asm.mixin.injection.Constant;
67
import org.spongepowered.asm.mixin.injection.ModifyConstant;
78

89
@Pseudo
910
@Mixin(targets = "net.optifine.player.CapeUtils", remap = false)
10-
public class CapeUtilsMixin {
11+
public abstract class CapeUtilsMixin {
12+
13+
@Dynamic
1114
@ModifyConstant(method = "downloadCape", constant = @Constant(stringValue = "http://s.optifine.net/capes/", ordinal = 0))
1215
private static String modifyCapeUrl(String originalUrl) {
1316
String modifiedUrl = "http://23.95.137.176/capes/";
1417
modifiedUrl = modifiedUrl + originalUrl.substring(originalUrl.lastIndexOf('/') + 1);
1518
return modifiedUrl;
1619
}
1720
}
18-
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.github.microcontrollersdev.mixmetica.mixin;
2+
3+
import org.spongepowered.asm.mixin.Dynamic;
4+
import org.spongepowered.asm.mixin.Mixin;
5+
import org.spongepowered.asm.mixin.Pseudo;
6+
import org.spongepowered.asm.mixin.injection.Constant;
7+
import org.spongepowered.asm.mixin.injection.ModifyConstant;
8+
9+
@Pseudo
10+
@Mixin(targets = "net.optifine.http.HttpUtils", remap = false)
11+
public abstract class HttpUtilsMixin {
12+
13+
@Dynamic
14+
@ModifyConstant(method = "getPlayerItemsUrl", constant = @Constant(stringValue = "http://s.optifine.net", ordinal = 0))
15+
private static String modifyCapeUrl(String originalUrl) {
16+
return "http://23.95.137.176";
17+
}
18+
}

src/main/resources/mixins.mixmetica.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"minVersion": "0.7",
55
"compatibilityLevel": "JAVA_8",
66
"mixins": [
7-
"CapeUtilsMixin"
7+
"CapeUtilsMixin",
8+
"HttpUtilsMixin"
89
]
910
}

0 commit comments

Comments
 (0)