Skip to content

Commit ad219d9

Browse files
committed
sync 2024/7/2
1 parent 0a09428 commit ad219d9

File tree

57 files changed

+433
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+433
-244
lines changed

patches/client/0001-SO-Early-release-Anuken-9065.patch patches/client/0001-SC-Early-release-Anuken-9065.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Sun, 17 Sep 2023 11:55:29 +0800
4-
Subject: [PATCH] SO: Early release #Anuken:9065
4+
Subject: [PATCH] SC: Early release #Anuken:9065
55

66
---
77
core/src/mindustry/game/SpawnGroup.java | 2 +-

patches/client/0005-API-Hooks.patch

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: way-zer <[email protected]>
3+
Date: Wed, 3 Apr 2024 21:57:24 +0800
4+
Subject: [PATCH] API: Hooks
5+
6+
---
7+
core/src/mindustry/ClientLauncher.java | 1 +
8+
core/src/mindustry/Vars.java | 1 +
9+
core/src/mindustryX/Hooks.java | 17 +++++++++++++++++
10+
3 files changed, 19 insertions(+)
11+
create mode 100644 core/src/mindustryX/Hooks.java
12+
13+
diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java
14+
index 7e0757047006ed5d6e8b1165124b7de90a8e037d..87c1dfce278bdc123ee761d8e1e16c2b883d2c8a 100644
15+
--- a/core/src/mindustry/ClientLauncher.java
16+
+++ b/core/src/mindustry/ClientLauncher.java
17+
@@ -170,6 +170,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
18+
add(ui = new UI());
19+
add(netServer = new NetServer());
20+
add(netClient = new NetClient());
21+
+ add(new mindustryX.Hooks());
22+
23+
assets.load(schematics);
24+
25+
diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java
26+
index ec34503e16c87ab34dcdba33e7e89d8f644048c6..ae716151e019fa61af85b99583d3bc8dba9a3e18 100644
27+
--- a/core/src/mindustry/Vars.java
28+
+++ b/core/src/mindustry/Vars.java
29+
@@ -259,6 +259,7 @@ public class Vars implements Loadable{
30+
}
31+
32+
public static void init(){
33+
+ mindustryX.Hooks.beforeInit();
34+
Groups.init();
35+
36+
if(loadLocales){
37+
diff --git a/core/src/mindustryX/Hooks.java b/core/src/mindustryX/Hooks.java
38+
new file mode 100644
39+
index 0000000000000000000000000000000000000000..499a9f3403c6769288ad44e7fb4a68ffb36bc591
40+
--- /dev/null
41+
+++ b/core/src/mindustryX/Hooks.java
42+
@@ -0,0 +1,17 @@
43+
+package mindustryX;
44+
+
45+
+import arc.*;
46+
+import arc.util.*;
47+
+
48+
+public class Hooks implements ApplicationListener{
49+
+ /** invoke before `Vars.init`. Note that may be executed from `Vars.loadAsync` */
50+
+ public static void beforeInit(){
51+
+ Log.infoTag("MindustryX", "Hooks.beforeInit");
52+
+ }
53+
+
54+
+ /** invoke after loading, just before `Mod::init` */
55+
+ @Override
56+
+ public void init(){
57+
+ Log.infoTag("MindustryX", "Hooks.init");
58+
+ }
59+
+}

patches/client/0006-CS-Bundle-Extend.patch

+34-16
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,54 @@ Subject: [PATCH] CS: Bundle Extend
55

66
---
77
core/assets/bundles/bundle-mdtx.properties | 0
8-
core/src/mindustry/Vars.java | 16 ++++++++++++++++
9-
2 files changed, 16 insertions(+)
8+
core/src/mindustryX/Hooks.java | 22 ++++++++++++++++++++++
9+
2 files changed, 22 insertions(+)
1010
create mode 100644 core/assets/bundles/bundle-mdtx.properties
1111

1212
diff --git a/core/assets/bundles/bundle-mdtx.properties b/core/assets/bundles/bundle-mdtx.properties
1313
new file mode 100644
1414
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
15-
diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java
16-
index ec34503e16c87ab34dcdba33e7e89d8f644048c6..498e222893f7e224cf87ba4d983df99efd181ae1 100644
17-
--- a/core/src/mindustry/Vars.java
18-
+++ b/core/src/mindustry/Vars.java
19-
@@ -482,5 +482,21 @@ public class Vars implements Loadable{
20-
bundle.debug("router");
21-
}
22-
}
15+
diff --git a/core/src/mindustryX/Hooks.java b/core/src/mindustryX/Hooks.java
16+
index 499a9f3403c6769288ad44e7fb4a68ffb36bc591..ca6144798666f96ee074838e489b51df1a10d19d 100644
17+
--- a/core/src/mindustryX/Hooks.java
18+
+++ b/core/src/mindustryX/Hooks.java
19+
@@ -1,12 +1,16 @@
20+
package mindustryX;
21+
22+
import arc.*;
23+
+import arc.files.*;
24+
import arc.util.*;
25+
26+
+import java.util.*;
2327
+
28+
public class Hooks implements ApplicationListener{
29+
/** invoke before `Vars.init`. Note that may be executed from `Vars.loadAsync` */
30+
public static void beforeInit(){
31+
Log.infoTag("MindustryX", "Hooks.beforeInit");
32+
+ registerBundle();
33+
}
34+
35+
/** invoke after loading, just before `Mod::init` */
36+
@@ -14,4 +18,22 @@ public class Hooks implements ApplicationListener{
37+
public void init(){
38+
Log.infoTag("MindustryX", "Hooks.init");
39+
}
40+
+
41+
+ private static void registerBundle(){
2442
+ //MDTX: bundle overwrite
2543
+ try{
26-
+ I18NBundle originBundle = bundle;
44+
+ I18NBundle originBundle = Core.bundle;
2745
+ Fi handle = Core.files.internal("bundles/bundle-mdtx");
2846
+ Core.bundle = I18NBundle.createBundle(handle, Locale.getDefault());
29-
+ Reflect.set(bundle, "locale", originBundle.getLocale());
47+
+ Reflect.set(Core.bundle, "locale", originBundle.getLocale());
3048
+ Log.info("MDTX: bundle has been loaded.");
31-
+ var rootBundle = bundle;
32-
+ while(rootBundle.getParent()!=null){
49+
+ var rootBundle = Core.bundle;
50+
+ while(rootBundle.getParent() != null){
3351
+ rootBundle = rootBundle.getParent();
3452
+ }
3553
+ Reflect.set(rootBundle, "parent", originBundle);
3654
+ }catch(Throwable e){
37-
+ e.printStackTrace();
55+
+ Log.err(e);
3856
+ }
39-
}
57+
+ }
4058
}

patches/client/0011-SO-improve-ControlPathfinder.java-limit-memory-use.patch patches/client/0012-SC-improve-ControlPathfinder.java-limit-memory-use.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Fri, 23 Jun 2023 16:21:59 +0800
4-
Subject: [PATCH] SO: improve ControlPathfinder.java (limit memory use)
4+
Subject: [PATCH] SC: improve ControlPathfinder.java (limit memory use)
55

66
---
77
core/src/mindustry/ai/ControlPathfinder.java | 21 +++++++++++++++++---

patches/client/0012-SO-Fix-6.patch patches/client/0013-SC-Fix-6.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Mon, 26 Dec 2022 15:29:10 +0800
4-
Subject: [PATCH] SO: Fix #6
4+
Subject: [PATCH] SC: Fix #6
55

66
---
77
.../mindustry/world/blocks/payloads/PayloadConveyor.java | 7 ++++++-

patches/client/0014-C.patch patches/client/0015-C.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Content-Transfer-Encoding: 8bit
1212
1 file changed, 14 insertions(+)
1313

1414
diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientLauncher.java
15-
index 7e0757047006ed5d6e8b1165124b7de90a8e037d..f195945461e87f5a3353ef0d5e8d229d163c8f2e 100644
15+
index 87c1dfce278bdc123ee761d8e1e16c2b883d2c8a..91e7514c34ce5748998b14b98b799cf1bf572f0d 100644
1616
--- a/core/src/mindustry/ClientLauncher.java
1717
+++ b/core/src/mindustry/ClientLauncher.java
18-
@@ -236,6 +236,8 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
18+
@@ -237,6 +237,8 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
1919
}))));
2020
}
2121
}else{
@@ -24,7 +24,7 @@ index 7e0757047006ed5d6e8b1165124b7de90a8e037d..f195945461e87f5a3353ef0d5e8d229d
2424
asyncCore.begin();
2525

2626
super.update();
27-
@@ -252,6 +254,18 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
27+
@@ -253,6 +255,18 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
2828
}
2929
}
3030

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: way-zer <[email protected]>
3+
Date: Tue, 9 Apr 2024 18:23:19 +0800
4+
Subject: [PATCH] API(Hooks) onHttp
5+
6+
---
7+
core/src/mindustryX/Hooks.java | 17 +++++++++++++++++
8+
1 file changed, 17 insertions(+)
9+
10+
diff --git a/core/src/mindustryX/Hooks.java b/core/src/mindustryX/Hooks.java
11+
index ca6144798666f96ee074838e489b51df1a10d19d..7cace088409de5b701577465f38ae01eb8b87a1c 100644
12+
--- a/core/src/mindustryX/Hooks.java
13+
+++ b/core/src/mindustryX/Hooks.java
14+
@@ -4,6 +4,7 @@ import arc.*;
15+
import arc.files.*;
16+
import arc.util.*;
17+
18+
+import java.net.*;
19+
import java.util.*;
20+
21+
public class Hooks implements ApplicationListener{
22+
@@ -19,6 +20,22 @@ public class Hooks implements ApplicationListener{
23+
Log.infoTag("MindustryX", "Hooks.init");
24+
}
25+
26+
+ @SuppressWarnings("unused")//call before arc.util.Http$HttpRequest.block
27+
+ public static void onHttp(Http.HttpRequest req){
28+
+ if(Core.settings.getBool("githubMirror")){
29+
+ try{
30+
+ String url = req.url;
31+
+ String host = new URL(url).getHost();
32+
+ if(host.contains("github.com") || host.contains("raw.githubusercontent.com")){
33+
+ url = "https://gh.tinylake.tech/" + url;
34+
+ req.url = url;
35+
+ }
36+
+ }catch(Exception e){
37+
+ //ignore
38+
+ }
39+
+ }
40+
+ }
41+
+
42+
private static void registerBundle(){
43+
//MDTX: bundle overwrite
44+
try{

patches/client/0016-API-Hooks.onHttp.patch

-58
This file was deleted.

patches/client/0016-API-RenderExt.patch patches/client/0017-API-RenderExt.patch

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@ index aec39b666137666976321336b698e80177b05f84..5c57b1309660e500c38099d362b46a62
5454
Draw.z(Layer.block);
5555

5656
diff --git a/core/src/mindustryX/Hooks.java b/core/src/mindustryX/Hooks.java
57-
index ddb597d4389659c823a28f965434ed5be233215b..c399832fd28e50e3f6464380fca916cf5539d213 100644
57+
index 7cace088409de5b701577465f38ae01eb8b87a1c..1548f3d6ae0d362575a05ef38ea1575af65f5afc 100644
5858
--- a/core/src/mindustryX/Hooks.java
5959
+++ b/core/src/mindustryX/Hooks.java
60-
@@ -2,6 +2,8 @@ package mindustryX;
61-
60+
@@ -3,6 +3,8 @@ package mindustryX;
6261
import arc.*;
62+
import arc.files.*;
6363
import arc.util.*;
6464
+import mindustry.*;
6565
+import mindustryX.features.*;
6666

6767
import java.net.*;
68-
69-
@@ -9,6 +11,9 @@ public class Hooks implements ApplicationListener{
68+
import java.util.*;
69+
@@ -18,6 +20,9 @@ public class Hooks implements ApplicationListener{
7070
@Override
7171
public void init(){
7272
Log.infoTag("MindustryX", "Hooks.init");
File renamed without changes.
File renamed without changes.

patches/client/0025-API-Hooks.onHandleSendMessage.patch patches/client/0026-API-Hooks-onHandleSendMessage.patch

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Fri, 23 Feb 2024 01:05:54 +0800
4-
Subject: [PATCH] API: Hooks.onHandleSendMessage
4+
Subject: [PATCH] API(Hooks) onHandleSendMessage
55

66
---
77
core/src/mindustry/core/NetClient.java | 4 ++++
@@ -31,24 +31,26 @@ index 6eaa704296d197c2bcd722c78e2c770a543aec27..dcca3b910e100d508955cf96681a793f
3131
Vars.ui.chatfrag.addMessage(message);
3232
Sounds.chatMessage.play();
3333
diff --git a/core/src/mindustryX/Hooks.java b/core/src/mindustryX/Hooks.java
34-
index c399832fd28e50e3f6464380fca916cf5539d213..8e17b92678d8f8a844dc0395af6cbefbc20ca70e 100644
34+
index 1548f3d6ae0d362575a05ef38ea1575af65f5afc..b4687306b3fe782e096db1943e72cecc566e5e46 100644
3535
--- a/core/src/mindustryX/Hooks.java
3636
+++ b/core/src/mindustryX/Hooks.java
37-
@@ -3,6 +3,7 @@ package mindustryX;
38-
import arc.*;
37+
@@ -4,6 +4,7 @@ import arc.*;
38+
import arc.files.*;
3939
import arc.util.*;
4040
import mindustry.*;
4141
+import mindustry.gen.*;
4242
import mindustryX.features.*;
4343

4444
import java.net.*;
45-
@@ -31,4 +32,9 @@ public class Hooks implements ApplicationListener{
46-
}
45+
@@ -41,6 +42,11 @@ public class Hooks implements ApplicationListener{
4746
}
4847
}
49-
+
48+
5049
+ public static @Nullable String onHandleSendMessage(String message, @Nullable Player sender){
5150
+ if(message == null) return null;
5251
+ return message;
5352
+ }
54-
}
53+
+
54+
private static void registerBundle(){
55+
//MDTX: bundle overwrite
56+
try{

patches/client/0026-API-InternalMods.patch patches/client/0027-F-InternalMods.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Fri, 23 Feb 2024 16:37:59 +0800
4-
Subject: [PATCH] API: InternalMods
4+
Subject: [PATCH] F: InternalMods
55

66
---
77
core/src/mindustry/mod/Mods.java | 2 +-

patches/client/0027-C-claj.patch patches/client/0028-C-InternalMods-claj.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Fri, 23 Feb 2024 21:31:47 +0800
4-
Subject: [PATCH] =?UTF-8?q?C:=20claj=E5=8A=9F=E8=83=BD?=
4+
Subject: [PATCH] =?UTF-8?q?C(InternalMods):=20claj=E5=8A=9F=E8=83=BD?=
55
MIME-Version: 1.0
66
Content-Type: text/plain; charset=UTF-8
77
Content-Transfer-Encoding: 8bit

patches/client/0029-C-TimeControl.patch patches/client/0030-FC-TimeControl.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: way-zer <[email protected]>
33
Date: Thu, 29 Feb 2024 18:48:33 +0800
4-
Subject: [PATCH] C: TimeControl
4+
Subject: [PATCH] FC: TimeControl
55

66
---
77
core/src/mindustryX/Hooks.java | 1 +
@@ -10,10 +10,10 @@ Subject: [PATCH] C: TimeControl
1010
create mode 100644 core/src/mindustryX/features/TimeControl.java
1111

1212
diff --git a/core/src/mindustryX/Hooks.java b/core/src/mindustryX/Hooks.java
13-
index 8e17b92678d8f8a844dc0395af6cbefbc20ca70e..5f15cc3b9f470523c214adfdd8d1f5f6e332cc55 100644
13+
index b4687306b3fe782e096db1943e72cecc566e5e46..9b7e280fb96aa4e5ffd26f432ecf938df542880e 100644
1414
--- a/core/src/mindustryX/Hooks.java
1515
+++ b/core/src/mindustryX/Hooks.java
16-
@@ -14,6 +14,7 @@ public class Hooks implements ApplicationListener{
16+
@@ -23,6 +23,7 @@ public class Hooks implements ApplicationListener{
1717
Log.infoTag("MindustryX", "Hooks.init");
1818
if(!Vars.headless){
1919
RenderExt.init();

0 commit comments

Comments
 (0)