Changes resource loading
Some checks failed
KnarCraft/Minecraft-Server-Launcher/master There was a failure building this commit
Some checks failed
KnarCraft/Minecraft-Server-Launcher/master There was a failure building this commit
Loads configuration and image files from resources folder Removes duplicate resources
This commit is contained in:
@ -6,6 +6,8 @@ import java.io.FileNotFoundException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Scanner;
|
||||
|
||||
import static net.knarcraft.minecraftserverlauncher.Shared.getResourceAsScanner;
|
||||
|
||||
/**
|
||||
* Contains the bare minimum to be a functional server type.
|
||||
*
|
||||
@ -80,11 +82,10 @@ public class ServerType {
|
||||
if (serverTypes.isEmpty()) {
|
||||
Scanner file;
|
||||
try {
|
||||
file = new Scanner(new File("config/servertypes.csv"));
|
||||
file = getResourceAsScanner("servertypes.csv");
|
||||
} catch (FileNotFoundException e) {
|
||||
file = new Scanner(ServerType.class.getResourceAsStream("/config/servertypes.csv"));
|
||||
throw new ConfigurationException("Server type configuration file is missing.");
|
||||
}
|
||||
|
||||
while (file.hasNextLine()) {
|
||||
String[] str = file.nextLine().split(";", -1);
|
||||
int len = str.length;
|
||||
|
Reference in New Issue
Block a user