Skip to content

Commit e859bec

Browse files
committed
SCRIPTS 简化patch文件
1 parent 61637a1 commit e859bec

File tree

83 files changed

+1212
-6497
lines changed

Some content is hidden

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

83 files changed

+1212
-6497
lines changed

patches/client/0001-BUILD-build.gradle.kts-and-clear.patch

+91-398
Large diffs are not rendered by default.

patches/client/0003-CS-Version.patch

+16-100
Original file line numberDiff line numberDiff line change
@@ -21,142 +21,75 @@ diff --git a/.gitignore b/.gitignore
2121
index 7d91d3191096c431b739d2d5ecd951a764feead3..ba271e6bd0dd06971fff6fa2314254149cc90087 100644
2222
--- a/.gitignore
2323
+++ b/.gitignore
24-
@@ -4,6 +4,7 @@ logs/
25-
/core/assets/mindustry-maps/
26-
/core/assets/bundles/output/
27-
/core/assets/.gifimages/
24+
@@ -6,0 +7 @@ logs/
2825
+/core/assets/MindustryX.hjson
29-
/deploy/
30-
/out/
31-
ios/libs/
3226
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml
3327
index 8cae20eee7a480cef6a14576fc72b096d38271e1..25602c4ab4070b7db9b31803c88281c7e4aa449e 100644
3428
--- a/android/AndroidManifest.xml
3529
+++ b/android/AndroidManifest.xml
36-
@@ -1,6 +1,5 @@
37-
<?xml version="1.0" encoding="utf-8"?>
30+
@@ -2,2 +2 @@
3831
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3932
- package="io.anuke.mindustry">
4033
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
41-
42-
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
43-
<uses-feature android:name="android.hardware.type.pc" android:required="false" />
4434
diff --git a/android/build.gradle b/android/build.gradle
4535
index 8b9676e3f124728d59ee80367d14f433853c0c40..c39484bf6b00b8031b7ae8862cc172f8946f12cc 100644
4636
--- a/android/build.gradle
4737
+++ b/android/build.gradle
48-
@@ -18,7 +18,7 @@ configurations{ natives }
49-
50-
repositories{
51-
mavenCentral()
38+
@@ -21 +21 @@ repositories{
5239
- maven{ url "https://maven.google.com" }
5340
+ maven{ url "https://dl.google.com/dl/android/maven2/" }
54-
}
55-
56-
android{
57-
@@ -46,7 +46,7 @@ android{
58-
defaultConfig{
59-
def versionNameResult = "$versionNumber-$versionType-${getBuildVersion().replace(" ", "-")}"
60-
41+
@@ -49 +49 @@ android{
6142
- applicationId "io.anuke.mindustry"
6243
+ applicationId "com.github.tinylake.mindustryX"
63-
minSdkVersion 14
64-
targetSdkVersion 33
65-
6644
diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml
6745
index d42ffe6d4a318ce558f1010eae46140f88ed5c99..bf44ead5c58abfb79c500e6daae30c3e7c322bed 100644
6846
--- a/android/res/values/strings.xml
6947
+++ b/android/res/values/strings.xml
70-
@@ -1,4 +1,4 @@
71-
<?xml version="1.0" encoding="utf-8"?>
72-
<resources>
48+
@@ -3 +3 @@
7349
- <string name="app_name">Mindustry</string>
7450
+ <string name="app_name">MindustryX</string>
75-
</resources>
7651
diff --git a/build.gradle b/build.gradle
7752
index 0cb5c6337c2d6a41243907d2c34c679b63112d61..fb6808e41d2fbff78c81f3904d01eb4e8e413492 100644
7853
--- a/build.gradle
7954
+++ b/build.gradle
80-
@@ -21,12 +21,12 @@ allprojects{
81-
apply plugin: 'maven-publish'
82-
83-
version = project.hasProperty("packageVersion") ? project.getProperty("packageVersion") : 'release'
55+
@@ -24 +24 @@ allprojects{
8456
- group = 'com.github.Anuken'
8557
+ group = 'cf.wayzer.MindustryX'
86-
87-
ext{
88-
versionNumber = '7'
89-
if(!project.hasProperty("versionModifier")) versionModifier = 'release'
58+
@@ -29 +29 @@ allprojects{
9059
- if(!project.hasProperty("versionType")) versionType = 'official'
9160
+ if(!project.hasProperty("versionType")) versionType = 'MindustryX'
92-
appName = 'Mindustry'
93-
steamworksVersion = '0b86023401880bb5e586bc404bedbaae9b1f1c94'
94-
rhinoVersion = '73a812444ac388ac2d94013b5cadc8f70b7ea027'
9561
diff --git a/core/build.gradle.kts b/core/build.gradle.kts
9662
index e2a6d4ede97677940bc6b73de42f6f5ff71fc0be..9d9d170c1fb00fbd4bf35c1a2f04bcff6dca09cf 100644
9763
--- a/core/build.gradle.kts
9864
+++ b/core/build.gradle.kts
99-
@@ -46,7 +46,7 @@ tasks{
100-
property("type", findProperty("versionType") ?: "official")
101-
property("modifier", findProperty("versionModifier") ?: "release")
102-
property("number", '7')
65+
@@ -49 +49 @@ tasks{
10366
- property("build", findProperty("buildversion") ?: "custom build")
10467
+ property("build", findProperty("upstreamBuild") ?: "custom build")
105-
}
106-
processResources.configure {
107-
dependsOn(generateLocales, generateBasePartNames, writeVersion)
10868
diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java
10969
index bc4c6a494aec88af73f001906598ba91a50ac6a3..d08d04a6f0e8107cec995876b2072c46aa85b3c2 100644
11070
--- a/core/src/mindustry/Vars.java
11171
+++ b/core/src/mindustry/Vars.java
112-
@@ -77,7 +77,7 @@ public class Vars implements Loadable{
113-
//TODO merge with v6 list upon release
114-
public static final String serverJsonURL = "https://raw.githubusercontent.com/Anuken/Mindustry/master/servers_v7.json";
115-
/** URL of the github issue report template.*/
72+
@@ -80 +80 @@ public class Vars implements Loadable{
11673
- public static final String reportIssueURL = "https://github.com/Anuken/Mindustry/issues/new?labels=bug&template=bug_report.md";
11774
+ public static final String reportIssueURL = "https://github.com/TinyLake/MindustryX/issues/new?labels=bug&template=bug_report.md";
118-
/** list of built-in servers.*/
119-
public static final Seq<ServerGroup> defaultServers = Seq.with();
120-
/** maximum size of any block, do not change unless you know what you're doing */
12175
diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java
12276
index 8171a89797a0d1cb29fb50364a94b6d3130698ae..6b05845bad6eb3862dea511563e099085d15b479 100644
12377
--- a/core/src/mindustry/core/NetClient.java
12478
+++ b/core/src/mindustry/core/NetClient.java
125-
@@ -135,6 +135,8 @@ public class NetClient implements ApplicationListener{
126-
Log.info("Received world data: @ bytes.", data.stream.available());
127-
NetworkIO.loadWorld(new InflaterInputStream(data.stream));
128-
79+
@@ -137,0 +138,2 @@ public class NetClient implements ApplicationListener{
12980
+ Call.serverPacketReliable("ARC", Version.mdtXBuild);
13081
+ Call.serverPacketReliable("MDTX", Version.mdtXBuild);
131-
finishConnecting();
132-
});
133-
}
13482
diff --git a/core/src/mindustry/core/Version.java b/core/src/mindustry/core/Version.java
13583
index 73bbd59416cc8e1b64bcb5538fdd73886a455451..8698103654e40dd4e85451e1020563ca562ed2d2 100644
13684
--- a/core/src/mindustry/core/Version.java
13785
+++ b/core/src/mindustry/core/Version.java
138-
@@ -6,6 +6,8 @@ import arc.files.*;
139-
import arc.struct.*;
140-
import arc.util.*;
141-
import arc.util.io.*;
86+
@@ -8,0 +9,2 @@ import arc.util.io.*;
14287
+import arc.util.serialization.*;
14388
+import mindustryX.*;
144-
145-
public class Version{
146-
/** Build type. 'official' for official releases; 'custom' or 'bleeding edge' are also used. */
147-
@@ -20,6 +22,8 @@ public class Version{
148-
public static int revision = 0;
149-
/** Whether version loading is enabled. */
150-
public static boolean enabled = true;
89+
@@ -22,0 +25,2 @@ public class Version{
15190
+ @MindustryXApi
15291
+ public static String mdtXBuild;
153-
154-
public static void init(){
155-
if(!enabled) return;
156-
@@ -44,6 +48,15 @@ public class Version{
157-
}else{
158-
build = Strings.canParseInt(map.get("build")) ? Integer.parseInt(map.get("build")) : -1;
159-
}
92+
@@ -46,0 +51,9 @@ public class Version{
16093
+ //MDTX: mdtXBuild
16194
+ if(Core.files == null) return;
16295
+ try{
@@ -166,39 +99,22 @@ index 73bbd59416cc8e1b64bcb5538fdd73886a455451..8698103654e40dd4e85451e1020563ca
16699
+ e.printStackTrace();
167100
+ mdtXBuild = "custom build";
168101
+ }
169-
}
170-
171-
/** @return whether the current game version is greater than the specified version string, e.g. "120.1"*/
172-
@@ -73,6 +86,7 @@ public class Version{
173-
if(build == -1){
174-
return "custom build";
175-
}
102+
@@ -76 +89,2 @@ public class Version{
176103
- return (type.equals("official") ? modifier : type) + " build " + build + (revision == 0 ? "" : "." + revision);
177104
+ return (type.equals("official") ? modifier : type) + " build " + build + (revision == 0 ? "" : "." + revision) +
178105
+ "\nMindustryX " + mdtXBuild;
179-
}
180-
}
181106
diff --git a/core/src/mindustry/net/NetworkIO.java b/core/src/mindustry/net/NetworkIO.java
182107
index 48599c6b96474117057e7ca2b87b545873a0ea31..4366eeef830845fb13132a0ae3534129b7a859dc 100644
183108
--- a/core/src/mindustry/net/NetworkIO.java
184109
+++ b/core/src/mindustry/net/NetworkIO.java
185-
@@ -107,7 +107,7 @@ public class NetworkIO{
186-
buffer.putInt(Core.settings.getInt("totalPlayers", Groups.player.size()));
187-
buffer.putInt(state.wave);
188-
buffer.putInt(Version.build);
110+
@@ -110 +110 @@ public class NetworkIO{
189111
- writeString(buffer, Version.type);
190112
+ writeString(buffer, "MindustryX");
191-
192-
buffer.put((byte)state.rules.mode().ordinal());
193-
buffer.putInt(netServer.admins.getPlayerLimit());
194113
diff --git a/gradle.properties b/gradle.properties
195114
index f43e22ea642fe0dcd62cf970a518de025db65ea4..b1921b8ac0d8d0ca7ac86e4d551a694d1ae38ed9 100644
196115
--- a/gradle.properties
197116
+++ b/gradle.properties
198-
@@ -28,3 +28,5 @@ org.gradle.caching=true
199-
org.gradle.internal.http.socketTimeout=100000
200-
org.gradle.internal.http.connectionTimeout=100000
201-
archash=7d6e89dffd
117+
@@ -30,0 +31,2 @@ archash=7d6e89dffd
202118
+
203119
+upstreamBuild=25087
204120
\ No newline at end of file

patches/client/0004-API-Hooks.patch

+3-21
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,14 @@ diff --git a/core/src/mindustry/ClientLauncher.java b/core/src/mindustry/ClientL
1515
index 2a7b133588279145272136f6aa2a02276f34d824..fa6e5c5b52cfdb83de5b50539d57c579aa6e0c95 100644
1616
--- a/core/src/mindustry/ClientLauncher.java
1717
+++ b/core/src/mindustry/ClientLauncher.java
18-
@@ -171,6 +171,7 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
19-
add(ui = new UI());
20-
add(netServer = new NetServer());
21-
add(netClient = new NetClient());
18+
@@ -173,0 +174 @@ public abstract class ClientLauncher extends ApplicationCore implements Platform
2219
+ add(new mindustryX.Hooks());
23-
24-
assets.load(schematics);
25-
2620
diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java
2721
index d08d04a6f0e8107cec995876b2072c46aa85b3c2..793c1759060a5e28e1df276bae2fdcf23f78284e 100644
2822
--- a/core/src/mindustry/Vars.java
2923
+++ b/core/src/mindustry/Vars.java
30-
@@ -269,6 +269,7 @@ public class Vars implements Loadable{
31-
}
32-
33-
public static void init(){
24+
@@ -271,0 +272 @@ public class Vars implements Loadable{
3425
+ mindustryX.Hooks.beforeInit();
35-
Groups.init();
36-
37-
if(loadLocales){
3826
diff --git a/core/src/mindustryX/Hooks.java b/core/src/mindustryX/Hooks.java
3927
new file mode 100644
4028
index 0000000000000000000000000000000000000000..499a9f3403c6769288ad44e7fb4a68ffb36bc591
@@ -62,11 +50,5 @@ diff --git a/server/src/mindustry/server/ServerLauncher.java b/server/src/mindus
6250
index 1aea11b2cc877ef9a35280575e6419d9fab16f01..1799c999b2affdc0de392841212edc1f544e4751 100644
6351
--- a/server/src/mindustry/server/ServerLauncher.java
6452
+++ b/server/src/mindustry/server/ServerLauncher.java
65-
@@ -76,6 +76,7 @@ public class ServerLauncher implements ApplicationListener{
66-
Core.app.addListener(netServer = new NetServer());
67-
Core.app.addListener(new ServerControl(args));
68-
Core.app.addListener(new ApplicationListener(){public void update(){ asyncCore.end(); }});
53+
@@ -78,0 +79 @@ public class ServerLauncher implements ApplicationListener{
6954
+ Core.app.addListener(new mindustryX.Hooks());
70-
71-
mods.eachClass(Mod::init);
72-

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

+4-18
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,14 @@ diff --git a/core/src/mindustryX/Hooks.java b/core/src/mindustryX/Hooks.java
1616
index 499a9f3403c6769288ad44e7fb4a68ffb36bc591..ca6144798666f96ee074838e489b51df1a10d19d 100644
1717
--- a/core/src/mindustryX/Hooks.java
1818
+++ b/core/src/mindustryX/Hooks.java
19-
@@ -1,12 +1,16 @@
20-
package mindustryX;
21-
22-
import arc.*;
19+
@@ -3,0 +4 @@ import arc.*;
2320
+import arc.files.*;
24-
import arc.util.*;
25-
21+
@@ -5,0 +7,2 @@ import arc.util.*;
2622
+import java.util.*;
2723
+
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");
24+
@@ -9,0 +13 @@ public class Hooks implements ApplicationListener{
3225
+ 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-
}
26+
@@ -16,0 +21,18 @@ public class Hooks implements ApplicationListener{
4027
+
4128
+ private static void registerBundle(){
4229
+ //MDTX: bundle overwrite
@@ -55,4 +42,3 @@ index 499a9f3403c6769288ad44e7fb4a68ffb36bc591..ca6144798666f96ee074838e489b51df
5542
+ Log.err(e);
5643
+ }
5744
+ }
58-
}

patches/client/0006-S-update-TypeIO.writeRequest.patch

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,9 @@ diff --git a/core/src/mindustry/io/TypeIO.java b/core/src/mindustry/io/TypeIO.ja
1111
index 70d1543c366b4eeef80c67f4eaeb05643c93451e..fe9682663342ccd1f3537cf82ea4c74996655440 100644
1212
--- a/core/src/mindustry/io/TypeIO.java
1313
+++ b/core/src/mindustry/io/TypeIO.java
14-
@@ -414,8 +414,9 @@ public class TypeIO{
15-
if(!plan.breaking){
16-
write.s(plan.block.id);
17-
write.b((byte)plan.rotation);
14+
@@ -417,2 +417,3 @@ public class TypeIO{
1815
- write.b(1); //always has config
1916
- writeObject(write, plan.config);
2017
+ boolean writePlan = !headless || !net.server();
2118
+ write.b(writePlan ? 1 : 0); //always has config
2219
+ writeObject(write, writePlan ? plan.config : null);
23-
}
24-
}
25-

patches/client/0007-API-Add-LogicBlock.running.patch

+4-28
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,12 @@ diff --git a/core/src/mindustry/world/blocks/logic/LogicBlock.java b/core/src/mi
1111
index 655cf48e4f974d2e05cdca66deb361f1ee9f65bf..6f4d08ac40d461d0c41dbb292866add7565ed784 100644
1212
--- a/core/src/mindustry/world/blocks/logic/LogicBlock.java
1313
+++ b/core/src/mindustry/world/blocks/logic/LogicBlock.java
14-
@@ -24,6 +24,7 @@ import mindustry.ui.*;
15-
import mindustry.world.*;
16-
import mindustry.world.blocks.ConstructBlock.*;
17-
import mindustry.world.meta.*;
14+
@@ -26,0 +27 @@ import mindustry.world.meta.*;
1815
+import mindustryX.*;
19-
20-
import java.io.*;
21-
import java.util.zip.*;
22-
@@ -31,6 +32,8 @@ import java.util.zip.*;
23-
import static mindustry.Vars.*;
24-
25-
public class LogicBlock extends Block{
16+
@@ -33,0 +35,2 @@ public class LogicBlock extends Block{
2617
+ @MindustryXApi
2718
+ public static boolean running = false;
28-
private static final int maxByteLen = 1024 * 100;
29-
public static final int maxNameLength = 32;
30-
31-
@@ -531,6 +534,7 @@ public class LogicBlock extends Block{
32-
33-
if(accumulator > maxInstructionScale * ipt) accumulator = maxInstructionScale * ipt;
34-
19+
@@ -533,0 +537 @@ public class LogicBlock extends Block{
3520
+ running = true;
36-
for(int i = 0; i < (int)accumulator; i++){
37-
executor.runOnce();
38-
accumulator --;
39-
@@ -539,6 +543,7 @@ public class LogicBlock extends Block{
40-
break;
41-
}
42-
}
21+
@@ -541,0 +546 @@ public class LogicBlock extends Block{
4322
+ running = false;
44-
}
45-
}
46-

0 commit comments

Comments
 (0)