aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium/util/virtualjar/protocol
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2023-02-09 20:58:39 +0100
committermakamys <makamys@outlook.com>2023-02-09 21:11:50 +0100
commitcd5305c6a383ebb8bf530d0f909c2d32c2ab6723 (patch)
tree49543a15ebf05d061d55fcb1016c1ec18146e032 /src/main/java/makamys/neodymium/util/virtualjar/protocol
parent3ab7b45318086b26b7e3b8b50be1adc6e1906e08 (diff)
downloadNeodymium-cd5305c6a383ebb8bf530d0f909c2d32c2ab6723.tar.gz
Neodymium-cd5305c6a383ebb8bf530d0f909c2d32c2ab6723.tar.bz2
Neodymium-cd5305c6a383ebb8bf530d0f909c2d32c2ab6723.zip
Add FastCraft compat by pretending to be OptiFine
Diffstat (limited to 'src/main/java/makamys/neodymium/util/virtualjar/protocol')
-rw-r--r--src/main/java/makamys/neodymium/util/virtualjar/protocol/neodymiumvirtualjar/Handler.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/makamys/neodymium/util/virtualjar/protocol/neodymiumvirtualjar/Handler.java b/src/main/java/makamys/neodymium/util/virtualjar/protocol/neodymiumvirtualjar/Handler.java
new file mode 100644
index 0000000..9f0fe66
--- /dev/null
+++ b/src/main/java/makamys/neodymium/util/virtualjar/protocol/neodymiumvirtualjar/Handler.java
@@ -0,0 +1,24 @@
+package makamys.neodymium.util.virtualjar.protocol.neodymiumvirtualjar;
+
+import static makamys.neodymium.Constants.MODID;
+import static makamys.neodymium.Constants.PROTOCOL;
+
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+import net.minecraft.launchwrapper.Launch;
+
+public class Handler extends URLStreamHandler {
+
+ private static final IURLStreamHandlerImpl impl = (IURLStreamHandlerImpl)Launch.blackboard.get(MODID + "." + PROTOCOL + ".impl");
+
+ @Override
+ protected URLConnection openConnection(URL url) {
+ return impl.openConnection(url);
+ }
+
+ public interface IURLStreamHandlerImpl {
+ URLConnection openConnection(URL url);
+ }
+}