@IMCCallback public void processIMCRequests(FMLInterModComms.IMCEvent event) { Splitter splitter = Splitter.on("@").trimResults(); for (IMCMessage m : event.getMessages()) { if ("add-facade".equals(m.key)) { String[] array = Iterables.toArray(splitter.split(m.getStringValue()), String.class); if (array.length != 2) { Logger.getLogger("Buildcraft") .log( Level.INFO, String.format( "Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender())); continue; } Integer blId = Ints.tryParse(array[0]); Integer metaId = Ints.tryParse(array[1]); if (blId == null || metaId == null) { Logger.getLogger("Buildcraft") .log( Level.INFO, String.format( "Received an invalid add-facade request %s from mod %s", m.getStringValue(), m.getSender())); continue; } ItemFacade.addFacade(new ItemStack(blId, 1, metaId)); } } }
@PostInit public void postInit(FMLPostInitializationEvent evt) { ItemFacade.initialize(); }