本文整理汇总了Java中cpw.mods.fml.common.event.FMLInterModComms.IMCEvent方法的典型用法代码示例。如果您正苦于以下问题:Java FMLInterModComms.IMCEvent方法的具体用法?Java FMLInterModComms.IMCEvent怎么用?Java FMLInterModComms.IMCEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.event.FMLInterModComms
的用法示例。
在下文中一共展示了FMLInterModComms.IMCEvent方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleIMC
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
@EventHandler
public void handleIMC(FMLInterModComms.IMCEvent event) {
// IMCHandler
try {
log.info("Processing IMC messages...");
IMCHandler.processIMC(event.getMessages());
log.info("IMC Messages processed.");
} catch (Exception e) {
log.error("=============================ERROR!=============================");
log.error("Failed to process IMC Messages, printing stacktrace...");
log.error("Please report this as a bug report with the stacktrace, the minecraft log and a mod list + version to: " + issueURL);
log.error("=============================ERROR!=============================");
e.printStackTrace();
}
}
示例2: handleIMCMessage
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
@Mod.EventHandler
public void handleIMCMessage(FMLInterModComms.IMCEvent event) {
for (IMCMessage message : event.getMessages()) {
if ("addClassExclusion".equals(message.key) && message.isStringMessage()) {
try {
Class<?> clazz = Class.forName(message.getStringValue());
CommonProxy.excludedClasses.add(clazz);
} catch (ClassNotFoundException e) {
I18n.format("message.cartlivery.invalidExclusion", message.getSender(), message.getStringValue());
}
}
if ("addBuiltInLiveries".equals(message.key) && message.isStringMessage() && FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
String[] liveries = message.getStringValue().split(",");
log.info(I18n.format("message.cartlivery.registerBuiltIn", liveries.length, message.getSender()));
for(String livery : liveries) LiveryTextureRegistry.builtInLiveries.put(livery, message.getSender());
}
}
}
示例3: onIMC
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
public static void onIMC(FMLInterModComms.IMCEvent event)
{
for(final FMLInterModComms.IMCMessage msg : event.getMessages())
{
if(msg.key.equals("addODBlacklisted"))
{
OreDictHandler.addBlacklisted( msg.getItemStackValue( ) );
}
}
}
示例4: interCommHandler
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
@EventHandler
public void interCommHandler(FMLInterModComms.IMCEvent event)
{
for (FMLInterModComms.IMCMessage message : event.getMessages())
if (message != null)
IMCHandler.handleMessage(message);
}
示例5: processIMC
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
@EventHandler
public void processIMC(FMLInterModComms.IMCEvent event) {
for (FMLInterModComms.IMCMessage message : event.getMessages()) {
if (message.key.equals("EyeNotification")) { // OpenEye IMC Payload
NBTTagCompound eyeTag = message.getNBTValue(),
nbt = new NBTTagCompound();
String[] eyeMsg = eyeTag.getString("payload").replace("#", " ").split(";");
if (eyeMsg.length != 6) {
advpLogger.error("Mod received malformed EyeNotification! This is most likely a bug on my side, don't worry about this");
}
nbt.setString("modDisplayName", "Advanced Potions");
nbt.setString("oldVersion", eyeMsg[0]);
nbt.setString("newVersion", eyeMsg[1]);
nbt.setString("updateUrl", eyeMsg[2]);
nbt.setBoolean("isDirectLink", Boolean.parseBoolean(eyeMsg[3]));
nbt.setString("changeLog", eyeMsg[4]);
nbt.setString("newFileName", eyeMsg[5]);
FMLInterModComms.sendMessage("VersionChecker", "addUpdate", nbt); // Send update notification to Dynious' Version Checker if present
}
}
}
示例6: recieveIMC
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
public void recieveIMC(FMLInterModComms.IMCEvent event) {
OresPlus.log.info("Recieved IMC evemt");
for (IMCMessage message : event.getMessages()) {
try {
if (!message.isNBTMessage())
break;
NBTTagCompound messageData = message.getNBTValue();
if (message.key.equals("registerOre")) {
if (!messageData.getString("oreName").equals("") && !Ores.manager.isOreRegistered(messageData.getString("oreName"))) {
Ores.manager.registerOre(messageData.getString("oreName"), GameRegistry.findBlock(message.getSender(), messageData.getString("oreName")));
}
}
else if (message.key.equals("registerGenerator")) {
if (!messageData.getString("oreName").equals("") && !Ores.manager.isOreRegistered(messageData.getString("oreName"))) {
OreGenClass oreGen = new OreGenClass(
messageData.getString("genName"),
messageData.getString("oreName"),
messageData.getBoolean("genEnabled"),
messageData.getInteger("genDim"),
messageData.getInteger("numVeins"),
messageData.getInteger("veinSize"),
messageData.getInteger("minY"),
messageData.getInteger("maxY"),
messageData.getBoolean("doRegen"),
OreGenType.NORMAL,
messageData.getInteger("oreDensity"),
messageData.getString("regenKey"));
new WorldGenOre(oreGen);
}
}
}
catch (Exception e) {
OresPlus.log.info("Error, recieved invalid IMC message from " + message.getSender());
e.printStackTrace();
}
}
}
示例7: onIMC
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
@Mod.EventHandler
public void onIMC(FMLInterModComms.IMCEvent event)
{
IMCHandlerProjectU.onIMC(event);
}
示例8: handleIMC
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
@Mod.EventHandler
public void handleIMC(FMLInterModComms.IMCEvent event) {
IMCHandler.processMessages(event.getMessages());
}
示例9: handleIMCMessages
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
@Mod.EventHandler
public void handleIMCMessages(FMLInterModComms.IMCEvent event)
{
IMCHandler.processMessages(event.getMessages());
}
示例10: recieveIMC
import cpw.mods.fml.common.event.FMLInterModComms; //导入方法依赖的package包/类
@EventHandler
public void recieveIMC(FMLInterModComms.IMCEvent event) {
imcHandler.recieveIMC(event);
}