本文整理匯總了Java中net.minecraftforge.fml.common.event.FMLInterModComms.IMCEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java FMLInterModComms.IMCEvent方法的具體用法?Java FMLInterModComms.IMCEvent怎麽用?Java FMLInterModComms.IMCEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.minecraftforge.fml.common.event.FMLInterModComms
的用法示例。
在下文中一共展示了FMLInterModComms.IMCEvent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onIMCMessage
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@EventHandler
public void onIMCMessage(FMLInterModComms.IMCEvent event)
{
for(FMLInterModComms.IMCMessage message : event.getMessages())
{
if(message.key.equalsIgnoreCase("blacklist") && message.isItemStackMessage())
{
if(!blacklist.contains(message.getItemStackValue().getItem()))
{
blacklist.add(message.getItemStackValue().getItem());
logger.info("Registered " + message.getItemStackValue().getItem().toString() + " to Item blacklist");
}
}
else if(message.key.equalsIgnoreCase("backtool") && message.isItemStackMessage())
{
if(!orientationMap.containsKey(message.getItemStackValue().getItem().getClass()))
{
orientationMap.put(message.getItemStackValue().getItem().getClass(), message.getItemStackValue().getCount());
logger.warn("Registered " + message.getItemStackValue().getItem().getClass().getName() + " to backtools");
}
}
}
}
示例2: onReceiveIMC
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void onReceiveIMC(FMLInterModComms.IMCEvent event) {
for (FMLInterModComms.IMCMessage message : event.getMessages()) {
if (message.key.equalsIgnoreCase("possess_handler")) {
if (message.isStringMessage()) {
try {
Class<? extends EntityPossessHandler> clazz = (Class<? extends EntityPossessHandler>) Class.forName(message.getStringValue());
EntityPossessHandler handler = clazz.getDeclaredConstructor().newInstance();
PossessHandler.registerHandler(handler);
} catch (Exception e) {
System.err.println("Received invalid IMC EntityPossessHandler class from mod " + message.getSender() + " (" + message.getStringValue() + ")");
e.printStackTrace();
}
}
}
}
}
示例3: imcCallback
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void imcCallback(FMLInterModComms.IMCEvent event) {
for (FMLInterModComms.IMCMessage message : event.getMessages()) {
if (message.key.equalsIgnoreCase("getTheWheel")) {
Optional<Function<IInteractionWheel, Void>> value = message.getFunctionValue(IInteractionWheel.class, Void.class);
if (value.isPresent()) {
value.get().apply(interactionWheelImp);
} else {
logger.warn("Some mod didn't return a valid result with getTheWheel!");
}
}
}
}
示例4: handleImc
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void handleImc(FMLInterModComms.IMCEvent event) {
for (FMLInterModComms.IMCMessage message : event.getMessages()) {
try {
RecipeViewer.handleImc(message);
handleImc(message);
} catch (Throwable t) {
t.printStackTrace();
}
}
}
示例5: onIMC
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
public static void onIMC(FMLInterModComms.IMCEvent event) {
for (final FMLInterModComms.IMCMessage imcMessage : event.getMessages()) {
if (imcMessage.key.toLowerCase().equals("lootblacklist") && imcMessage.isItemStackMessage()) {
lootBlacklist.add(imcMessage.getItemStackValue());
}
}
}
示例6: onIMCMessage
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void onIMCMessage(FMLInterModComms.IMCEvent event)
{
for(FMLInterModComms.IMCMessage message : event.getMessages())
{
if(message.key.equalsIgnoreCase("blacklist"))
{
try
{
Class clz = Class.forName(message.getStringValue());
if(ModelBase.class.isAssignableFrom(clz))
{
if(ModelList.modelBlacklist.contains(clz))
{
Tabula.LOGGER.warn(message.getStringValue() + " is already blacklisted");
}
else
{
ModelList.modelBlacklist.add(clz);
Tabula.LOGGER.warn(message.getStringValue() + " blacklisted from Tabula's import list");
}
}
else
{
Tabula.LOGGER.warn(message.getStringValue() + " is not a model class!");
}
}
catch(Exception e)
{
Tabula.LOGGER.warn("Could not find class " + message.getStringValue() + " for blacklist");
}
}
}
}
示例7: processIMC
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
public void processIMC(final FMLInterModComms.IMCEvent event) {
for (final FMLInterModComms.IMCMessage message : event.getMessages()) {
if ("checkUpdate".equals(message.key) && message.isStringMessage()) {
processMessage(message.getSender(), message.getStringValue());
}
}
}
示例8: processMessage
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@EventHandler
public void processMessage(FMLInterModComms.IMCEvent event) {
for (FMLInterModComms.IMCMessage m : event.getMessages()) {
if (m.isStringMessage() && "donateUrl".equalsIgnoreCase(m.key)) {
DonationUrlManager.instance().addUrl(m.getSender(), m.getStringValue());
}
if (m.isItemStackMessage() && "bucket".equalsIgnoreCase(m.key)) {
filledBuckets.add(m.getItemStackValue());
}
}
}
示例9: handleIMC
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void handleIMC(FMLInterModComms.IMCEvent event) {
modCompat.processIMC(event.getMessages());
}
示例10: imcMessage
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void imcMessage(FMLInterModComms.IMCEvent event) {
LogUtil.logInfo("Handling IMC Messages");
IMCHandler.processIMCMessages(event.getMessages());
}
示例11: onIMC
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@EventHandler
public void onIMC(FMLInterModComms.IMCEvent event) {
IMCManager.onIMC(event);
}
示例12: processMessages
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void processMessages(FMLInterModComms.IMCEvent event) {
for (final FMLInterModComms.IMCMessage msg : event.getMessages()) {
WeaponRegistry.INSTANCE.processMessage(msg);
}
}
示例13: processIMC
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void processIMC(final FMLInterModComms.IMCEvent event) {
proxy.processIMC(event);
}
示例14: handleIMCMessages
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@Mod.EventHandler
public void handleIMCMessages(FMLInterModComms.IMCEvent event)
{
IMCHandler.processMessages(event.getMessages());
}
示例15: processIMCRequests
import net.minecraftforge.fml.common.event.FMLInterModComms; //導入方法依賴的package包/類
@EventHandler
public void processIMCRequests(FMLInterModComms.IMCEvent event){
proxy.processIMC(event);
}