mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 10:15:52 +01:00
Correct value replacement for server.properties
This commit is contained in:
parent
d877e80b9f
commit
a12ff22645
@ -432,7 +432,7 @@ public class InternalSubCreator extends SubCreator {
|
||||
File file = new File(dir, "server.properties");
|
||||
if (!file.exists()) file.createNewFile();
|
||||
InputStream stream = new FileInputStream(file);
|
||||
String content = Util.readAll(new BufferedReader(new InputStreamReader(stream))).replace("server-port=", "server-port=" + port).replace("server-ip=", "server-ip=" + host.getAddress().getHostAddress());
|
||||
String content = Util.readAll(new BufferedReader(new InputStreamReader(stream))).replaceAll("server-port=.*(\r?\n)", "server-port=" + port + "$1").replaceAll("server-ip=.*(\r?\n)", "server-ip=" + host.getAddress().getHostAddress() + "$1");
|
||||
stream.close();
|
||||
file.delete();
|
||||
PrintWriter writer = new PrintWriter(file, "UTF-8");
|
||||
|
@ -7,4 +7,4 @@ Template:
|
||||
Shell-Location: 'build.sh'
|
||||
Permission: '+x'
|
||||
Settings:
|
||||
Executable: 'java -Xmx1024M -Dorg.bukkit.craftbukkit.libs.jline.terminal=unix -Djansi.passthrough=true -jar Spigot.jar'
|
||||
Executable: 'java -Xmx1024M -Dorg.bukkit.craftbukkit.libs.jline.terminal=unix -Djansi.passthrough=true -jar Spigot.jar -p $port$'
|
@ -429,7 +429,7 @@ public class SubCreator {
|
||||
File file = new File(dir, "server.properties");
|
||||
if (!file.exists()) file.createNewFile();
|
||||
FileInputStream is = new FileInputStream(file);
|
||||
String content = Util.readAll(new BufferedReader(new InputStreamReader(is))).replace("server-port=", "server-port=" + port).replace("server-ip=", "server-ip=" + host.config.get().getSection("Settings").getRawString("Server-Bind"));
|
||||
String content = Util.readAll(new BufferedReader(new InputStreamReader(is))).replaceAll("server-port=.*(\r?\n)", "server-port=" + port + "$1").replaceAll("server-ip=.*(\r?\n)", "server-ip=" + host.config.get().getSection("Settings").getRawString("Server-Bind") + "$1");
|
||||
is.close();
|
||||
file.delete();
|
||||
PrintWriter writer = new PrintWriter(file, "UTF-8");
|
||||
|
Loading…
Reference in New Issue
Block a user