mirror of
https://github.com/GTNewHorizons/ModTweaker.git
synced 2026-11-20 12:29:45 +00:00
Also changes like all packages inb4 "jared changes a package name in ModTweaker2 breaking compatability with everything" drama tweet.
This commit is contained in:
1 parent
4fd2551072
commit
ec562b62ea
187 files changed
+977
-991
No files matched your search
@@ -0,0 +1,9 @@
|
||||
package modtweaker2.mods.imc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class IMC {
|
||||
|
||||
public static ArrayList<ArrayList<String>> IMCmessages = new ArrayList<ArrayList<String>>();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package modtweaker2.mods.imc.handler;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FilenameFilter;
|
||||
import java.util.Scanner;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||
|
||||
public class Message {
|
||||
|
||||
public static String destination;
|
||||
public File[] files;
|
||||
public Scanner fileReader;
|
||||
|
||||
public Message(String destination) {
|
||||
this.destination = destination;
|
||||
|
||||
files = new File(destination).listFiles(new FilenameFilter() {
|
||||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
if (name.toLowerCase().endsWith(".imc")) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
try {
|
||||
for (File file : files) {
|
||||
|
||||
this.fileReader = new Scanner(file);
|
||||
while (fileReader.hasNextLine()) {
|
||||
String command = fileReader.nextLine().trim();
|
||||
if (command.toLowerCase().startsWith("sendimc(") && command.substring(command.length() - 1).equals(";")) {
|
||||
command = command.substring("sendimc(".length()).replace(command.substring(command.length() - 1), "").replace(command.substring(command.length() - 1), "").replaceAll("\"", "");
|
||||
|
||||
String[] input = command.split(",");
|
||||
FMLInterModComms.sendMessage(input[0], input[1], input[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user