Skip to content

Commit d369f1b

Browse files
committed
Fix Server loading from Config
1 parent 1a7fff7 commit d369f1b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/xyz/jadonfowler/phasebot/PhaseBot.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ else if (line.startsWith("Password: ")) { // Password:Derp
102102
PASSWORD = line.split(": ")[1];
103103
}
104104
else if (line.startsWith("Server: ")) { // Server:minecraft.net:25565
105-
HOST = line.split(": ")[1];
106-
PORT = Integer.parseInt(line.split(":")[2]);
105+
HOST = line.split(": ")[1].split(":")[0];
106+
PORT = Integer.parseInt(line.split(": ")[1].split(":")[1]);
107107
}
108108
else if (line.startsWith("Proxy")) { // Proxy:123.456.789:860
109109
PROXY = new Proxy(Proxy.Type.HTTP,
@@ -143,7 +143,12 @@ public static void reloadScripts() {
143143

144144
public static ArrayList<File> getFiles(String directoryName) {
145145
File directory = new File(directoryName);
146+
146147
ArrayList<File> files = new ArrayList<File>();
148+
if(!directory.isDirectory()){
149+
console.println("No files found in " + directoryName);
150+
return files;
151+
}
147152
// Get all the files from a directory
148153
File[] fList = directory.listFiles();
149154
for (File file : fList) {

0 commit comments

Comments
 (0)