Changes a lot of things to make everything cleaner. Closes #3
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good
Drops the idea of using serializable Adds a new controller object which takes care of profiles and saving Moves profile independent settings to its own file Makes saving and loading from file a lot cleaner Fixes the bug preventing lastly used profile from loading Makes the profile object only do profile things Moves gui initialization to the controller object Updates vanilla version from 1.16.1 to 1.16.2 Moves backup to common functions
This commit is contained in:
@ -6,7 +6,6 @@ import net.knarcraft.minecraftserverlauncher.userinterface.ServerConsoles;
|
||||
import net.knarcraft.minecraftserverlauncher.userinterface.ServerTab;
|
||||
|
||||
import javax.naming.ConfigurationException;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Acts as a wrapper for objects necessary for each server.
|
||||
@ -15,9 +14,9 @@ import java.io.Serializable;
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public class Collection implements Serializable {
|
||||
public class Collection {
|
||||
private final Server server;
|
||||
private final transient ServerTab serverTab;
|
||||
private final ServerTab serverTab;
|
||||
private final Console serverConsole;
|
||||
private final String name;
|
||||
|
||||
@ -45,25 +44,8 @@ public class Collection implements Serializable {
|
||||
this.server = server;
|
||||
this.serverConsole = ServerConsoles.addConsoleTab(serverName);
|
||||
this.name = serverName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new collection with the given parameters
|
||||
*
|
||||
* @param name <p>The name identifying the server, server tab, collection and server console</p>
|
||||
* @param serverPath <p>The path of the server folder</p>
|
||||
* @param enabled <p>Whether the server should be run when starting servers</p>
|
||||
* @param typeName <p>The name of the server type the server uses</p>
|
||||
* @param serverVersion <p>The version of the running server type.</p>
|
||||
* @param maxRam <p>The maximum amount of RAM the server is allowed to use.</p>
|
||||
*/
|
||||
Collection(String name, String serverPath, boolean enabled, String typeName, String serverVersion, String maxRam)
|
||||
throws ConfigurationException {
|
||||
this.serverTab = new ServerTab(name);
|
||||
this.server = new Server(name, serverPath, enabled, typeName, serverVersion, maxRam);
|
||||
this.serverConsole = ServerConsoles.addConsoleTab(name);
|
||||
this.name = name;
|
||||
this.serverTab.setData(serverPath, enabled, typeName, serverVersion, maxRam);
|
||||
this.serverTab.setData(server.getPath(), server.isEnabled(), server.getTypeName(), server.getServerVersion(),
|
||||
server.getMaxRam());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user