Skip to content

Commit 550dc71

Browse files
committed
Allow setting a custom MOTD for <= beta 1.7.3 servers
Closes #88
1 parent f000cdb commit 550dc71

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ tasks.register("runViaProxy", JavaExec) {
111111
mainClass = "net.raphimc.viaproxy.ViaProxy"
112112
classpath = viaProxyConfiguration
113113
workingDir = file("run")
114+
jvmArgs = ["-DskipUpdateCheck"]
114115

115116
doFirst {
116117
def jarsDir = file("$workingDir/jars")

src/main/java/net/raphimc/vialegacy/ViaLegacyConfig.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public class ViaLegacyConfig extends Config implements net.raphimc.vialegacy.pla
3535
private boolean soundEmulation;
3636
private boolean oldBiomes;
3737
private boolean enableB1_7_3Sprinting;
38+
private String b1_7_3Motd;
3839
private int classicChunkRange;
3940
private boolean enableClassicFly;
4041

@@ -56,6 +57,7 @@ private void loadFields() {
5657
this.soundEmulation = this.getBoolean("sound-emulation", true);
5758
this.oldBiomes = this.getBoolean("old-biomes", true);
5859
this.enableB1_7_3Sprinting = this.getBoolean("enable-b1_7_3-sprinting", false);
60+
this.b1_7_3Motd = this.getString("b1_7_3-motd", "The server seems to be running!\nWait 5 seconds between each connection");
5961
this.classicChunkRange = this.getInt("classic-chunk-range", 10);
6062
this.enableClassicFly = this.getBoolean("enable-classic-fly", false);
6163
}
@@ -109,6 +111,11 @@ public boolean enableB1_7_3Sprinting() {
109111
return this.enableB1_7_3Sprinting;
110112
}
111113

114+
@Override
115+
public String getB1_7_3Motd() {
116+
return this.b1_7_3Motd;
117+
}
118+
112119
@Override
113120
public int getClassicChunkRange() {
114121
return this.classicChunkRange;

src/main/java/net/raphimc/vialegacy/platform/ViaLegacyConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public interface ViaLegacyConfig extends Config {
3535

3636
boolean enableB1_7_3Sprinting();
3737

38+
String getB1_7_3Motd();
39+
3840
int getClassicChunkRange();
3941

4042
boolean enableClassicFly();

src/main/java/net/raphimc/vialegacy/protocol/beta/b1_7_0_3tob1_8_0_1/Protocolb1_7_0_3Tob1_8_0_1.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ public void register() {
243243
wrapper.cancel();
244244
}
245245
final PacketWrapper pingResponse = PacketWrapper.create(ClientboundPacketsb1_8.DISCONNECT, wrapper.user());
246-
pingResponse.write(Types1_6_4.STRING, "The server seems to be running!\nWait 5 seconds between each connection§0§1");
246+
pingResponse.write(Types1_6_4.STRING, ViaLegacy.getConfig().getB1_7_3Motd() + "§0§1");
247247
pingResponse.send(Protocolb1_7_0_3Tob1_8_0_1.class);
248248
});
249249
this.registerServerbound(ServerboundPacketsb1_8.LOGIN, new PacketHandlers() {

src/main/resources/assets/vialegacy/vialegacy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ old-biomes: true
2121
# Enables sprinting for versions below beta 1.8. !THIS CAN CAUSE ISSUES WITH ANTI-CHEAT PLUGINS!
2222
enable-b1_7_3-sprinting: false
2323
#
24+
# The MOTD to use for <= beta 1.7.3 servers. Supports newlines. Doesn't support color codes.
25+
b1_7_3-motd: |
26+
The server seems to be running!
27+
Wait 5 seconds between each connection
28+
#
2429
# Classic chunk loading range
2530
classic-chunk-range: 10
2631
#

0 commit comments

Comments
 (0)