Add possible simpler way to send IMC facade requests

IMC has a built-in way of sending ItemStacks through it, and it would be simpler if mods could simply use that, instead of encoding the ID and metadata a string. Decoding is a lot simpler too, just one line.
This commit is contained in:
viliml 2013-11-25 21:12:14 +01:00
parent 65bff981e5
commit 1e24cf4d85

View file

@ -38,6 +38,7 @@ public class InterModComms {
public static void processFacadeIMC(IMCEvent event, IMCMessage m) {
try {
if (m.isStringMessage()) {
Splitter splitter = Splitter.on("@").trimResults();
String[] array = Iterables.toArray(splitter.split(m.getStringValue()), String.class);
@ -52,6 +53,9 @@ public class InterModComms {
ItemFacade.addFacade(new ItemStack(blId, 1, metaId));
}
}
} else if (m.isItemStackMessage()) {
ItemFacade.addFacade(m.getItemStackValue());
}
} catch (Exception ex) {
}