forked from Anuken/Mindustry
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git filter-repo --path core/src/mindustryX --invert-paths --prune-empty=never --force
- Loading branch information
Showing
61 changed files
with
117 additions
and
11,488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,29 +3,3 @@ From: way-zer <[email protected]> | |
Date: Sun, 17 Sep 2023 11:51:44 +0800 | ||
Subject: [PATCH] API: @MindustryXApi | ||
|
||
--- | ||
core/src/mindustryX/MindustryXApi.java | 15 +++++++++++++++ | ||
1 file changed, 15 insertions(+) | ||
create mode 100644 core/src/mindustryX/MindustryXApi.java | ||
|
||
diff --git a/core/src/mindustryX/MindustryXApi.java b/core/src/mindustryX/MindustryXApi.java | ||
new file mode 100644 | ||
index 0000000000000000000000000000000000000000..04318b009a90b632bf7947910ca24055c3f7e7bb | ||
--- /dev/null | ||
+++ b/core/src/mindustryX/MindustryXApi.java | ||
@@ -0,0 +1,15 @@ | ||
+package mindustryX; | ||
+ | ||
+import java.lang.annotation.*; | ||
+ | ||
+@Documented | ||
+@Retention(RetentionPolicy.SOURCE) | ||
+@Target({ElementType.TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD}) | ||
+public @interface MindustryXApi{ | ||
+ /** Need Keep for compatibility with vanilla */ | ||
+ @Documented | ||
+ @Retention(RetentionPolicy.SOURCE) | ||
+ @Target({ElementType.TYPE, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.METHOD}) | ||
+ public @interface Keep{ | ||
+ } | ||
+} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,42 +3,3 @@ From: way-zer <[email protected]> | |
Date: Tue, 9 Apr 2024 18:23:19 +0800 | ||
Subject: [PATCH] API(Hooks) onHttp | ||
|
||
--- | ||
core/src/mindustryX/Hooks.java | 17 +++++++++++++++++ | ||
1 file changed, 17 insertions(+) | ||
|
||
diff --git a/core/src/mindustryX/Hooks.java b/core/src/mindustryX/Hooks.java | ||
index ca6144798666f96ee074838e489b51df1a10d19d..7cace088409de5b701577465f38ae01eb8b87a1c 100644 | ||
--- a/core/src/mindustryX/Hooks.java | ||
+++ b/core/src/mindustryX/Hooks.java | ||
@@ -4,6 +4,7 @@ import arc.*; | ||
import arc.files.*; | ||
import arc.util.*; | ||
|
||
+import java.net.*; | ||
import java.util.*; | ||
|
||
public class Hooks implements ApplicationListener{ | ||
@@ -19,6 +20,22 @@ public class Hooks implements ApplicationListener{ | ||
Log.infoTag("MindustryX", "Hooks.init"); | ||
} | ||
|
||
+ @SuppressWarnings("unused")//call before arc.util.Http$HttpRequest.block | ||
+ public static void onHttp(Http.HttpRequest req){ | ||
+ if(Core.settings.getBool("githubMirror")){ | ||
+ try{ | ||
+ String url = req.url; | ||
+ String host = new URL(url).getHost(); | ||
+ if(host.contains("github.com") || host.contains("raw.githubusercontent.com")){ | ||
+ url = "https://gh.tinylake.tech/" + url; | ||
+ req.url = url; | ||
+ } | ||
+ }catch(Exception e){ | ||
+ //ignore | ||
+ } | ||
+ } | ||
+ } | ||
+ | ||
private static void registerBundle(){ | ||
//MDTX: bundle overwrite | ||
try{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.