当前位置: 首页>>代码示例>>Java>>正文


Java FMLMissingMappingsEvent类代码示例

本文整理汇总了Java中net.minecraftforge.fml.common.event.FMLMissingMappingsEvent的典型用法代码示例。如果您正苦于以下问题:Java FMLMissingMappingsEvent类的具体用法?Java FMLMissingMappingsEvent怎么用?Java FMLMissingMappingsEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FMLMissingMappingsEvent类属于net.minecraftforge.fml.common.event包,在下文中一共展示了FMLMissingMappingsEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleMappings

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
public static void handleMappings(FMLMissingMappingsEvent event) {
  for (MissingMapping mapping : event.getAll()) {
    if (EnderIO.DOMAIN.equals(mapping.resourceLocation.getResourceDomain())) {
      final String resourcePath = mapping.resourceLocation.getResourcePath();
      if ("blockEnderIo".equals(resourcePath)) {
        mapping.ignore();
      } else if (mapping.type == Type.BLOCK && "blockConduitFacade".equals(resourcePath)) {
        mapping.ignore();
      } else if (mapping.type == Type.ITEM && "blockConduitFacade".equals(resourcePath)) {
        mapping.remap(ModObject.itemConduitFacade.getItem());
      } else {
        try {
          ModObject modObject = ModObject.valueOf(resourcePath.replaceAll("([A-Z])", "_$0").toLowerCase(Locale.ENGLISH));
          if (mapping.type == Type.BLOCK && modObject.getBlock() != null) {
            mapping.remap(modObject.getBlockNN());
          } else if (mapping.type == Type.ITEM && modObject.getItem() != null) {
            mapping.remap(modObject.getItemNN());
          }
        } catch (Exception e) {
        }
      }
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:25,代码来源:MigrationMapper.java

示例2: onRemap

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
public void onRemap(FMLMissingMappingsEvent event) {
	for (final MissingMapping mapping : event.get()) {
		if (mapping.resourceLocation.getResourceDomain().equals(BaseFoods.MODID)) {
			if (mapping.type.equals(GameRegistry.Type.BLOCK)) {
			} else if (mapping.type.equals(GameRegistry.Type.ITEM)) {
			}
		}
	}
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:BaseFoods,代码行数:10,代码来源:CommonProxy.java

示例3: onMissingMappingsEvent

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
@EventHandler
public void onMissingMappingsEvent(FMLMissingMappingsEvent event)
{
    // The lit_furnace item was removed in Minecraft 1.9, so pre-1.9 files will produce a warning when
    // loaded. This is harmless for a human user, but it breaks Malmo's FileWorldGenerator handler, since
    // it will bring up a GUI and wait for the user to click a button before continuing.
    // To avoid this, we specifically ignore lit_furnace item mapping.
    for (MissingMapping mapping : event.getAll())
    {
        if (mapping.type == GameRegistry.Type.ITEM && mapping.name.equals("minecraft:lit_furnace"))
            mapping.ignore();
    }
}
 
开发者ID:Microsoft,项目名称:malmo,代码行数:14,代码来源:MalmoMod.java

示例4: onRemap

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
public void onRemap(FMLMissingMappingsEvent event) {
	for (final MissingMapping mapping : event.get()) {
		if (mapping.resourceLocation.getResourceDomain().equals(BaseGems.MODID)) {
			if (mapping.type.equals(GameRegistry.Type.BLOCK)) {
				// Dummy
			} else if (mapping.type.equals(GameRegistry.Type.ITEM)) {
				// Dummy
			}
		}
	}
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:BaseGems,代码行数:12,代码来源:CommonProxy.java

示例5: processingMissingMap

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
public static void processingMissingMap(FMLMissingMappingsEvent event)
{
    List<MissingMapping> missingMappings = event.get();
    for (MissingMapping map : missingMappings)
    {
    	if(map.name.equals("corn:corn")){
    		map.remap(ObjectList.CORN);
    	}else
    		if(map.name.equals("corn:corncob")){
    			map.remap(ObjectList.COB);
    		}else
    			if(map.name.equals("corn:kernels")){
    				map.remap(ObjectList.KERNELS);
    			}else
    				if(map.name.equals("corn:poppedcorn")){
    					map.remap(ObjectList.POPCORN);
    				}else
    					if(map.name.equals("corn:roastedcornn")){
    						map.remap(ObjectList.ROASTED_CORN);
    					}else
    						if(map.name.equals("corn:popfirework")){
    							map.remap(ObjectList.POP_FIREWORK);
    						}else
    							if(map.name.equals("corn:chickencornchowder")){
    								map.remap(ObjectList.CHICKEN_CHOWDER);
    							}else
    								if(map.name.equals("corn:cornchowder")){
    									map.remap(ObjectList.CHOWDER);
    								}


    }
}
 
开发者ID:cleverpanda,项目名称:SimpleCorn,代码行数:34,代码来源:RemapHandler.java

示例6: missingMappings

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
@Mod.EventHandler
public void missingMappings(FMLMissingMappingsEvent e) {
    for (FMLMissingMappingsEvent.MissingMapping mapping : e.getAll()) {
        if ("ukeboxreloaded:blockJukebox".equals(mapping.name)) { //You know, because FML has a small mapping issue.
            try {
                setFinal(FMLMissingMappingsEvent.MissingMapping.class.getField("type"), GameRegistry.Type.BLOCK, mapping);
            } catch (Exception ignored) {}
            Map.Entry

            mapping.remap(proxy.jukeBox);
        }
    }
}
 
开发者ID:Cazzar,项目名称:JukeboxReloaded,代码行数:14,代码来源:JukeboxReloaded.java

示例7: onRemap

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
@EventHandler
public void onRemap(FMLMissingMappingsEvent event) {
	PROXY.onRemap(event);
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:BaseFoods,代码行数:5,代码来源:BaseFoods.java

示例8: missingItems

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
@EventHandler
public void missingItems(FMLMissingMappingsEvent event){
	MissingItemHandler.missingFix(event);
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:5,代码来源:CrystalMod.java

示例9: missingFix

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
public static void missingFix(FMLMissingMappingsEvent event){
	List<MissingMapping> missing = event.getAll();
	for(MissingMapping mapping : missing){
		if(mapping.resourceLocation.getResourceDomain().equalsIgnoreCase(CrystalMod.MODID)){
			ModLogger.warning("Found missing block/item ["+mapping.resourceLocation+"]!");
			final ResourceLocation rl = mapping.resourceLocation;
			
			boolean fixed = false;
			
			//Hardcoded
			if(mapping.resourceLocation.getResourcePath().equalsIgnoreCase("backpacklock")){
				mapping.remap(ModItems.lock);
				ModLogger.info("Fixed "+rl+". Remapped it to "+ModItems.lock.getRegistryName());
				fixed = true;
			} 
			if(mapping.type == GameRegistry.Type.ITEM && !fixed){
				
				if(mapping.resourceLocation.getResourcePath().equalsIgnoreCase("bluecrystalbush")||
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("redcrystalbush") ||
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("greencrystalbush") || 
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("darkcrystalbush")){
					mapping.ignore();
					fixed = true;
				}
				
				if(mapping.resourceLocation.getResourcePath().equalsIgnoreCase("bluecrystalplant")||
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("redcrystalplant") ||
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("greencrystalplant") || 
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("darkcrystalplant")){
					mapping.ignore();
					fixed = true;
				}
				
				ModLogger.info(remapItems.toString());
				if(remapItems.containsKey(rl)){
					Item item = remapItems.get(rl);
					mapping.remap(item);
					ModLogger.info("Fixed "+rl+". Remapped it to "+item.getRegistryName());
					fixed = true;
				}
			} 
			if(mapping.type == GameRegistry.Type.BLOCK && !fixed){
				if(mapping.resourceLocation.getResourcePath().equalsIgnoreCase("bluecrystalbush")||
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("redcrystalbush") ||
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("greencrystalbush") || 
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("darkcrystalbush")){
					mapping.ignore();
					fixed = true;
				}
				
				if(mapping.resourceLocation.getResourcePath().equalsIgnoreCase("bluecrystalplant")||
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("redcrystalplant") ||
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("greencrystalplant") || 
						mapping.resourceLocation.getResourcePath().equalsIgnoreCase("darkcrystalplant")){
					mapping.ignore();
					fixed = true;
				}
				
				if(remapBlocks.containsKey(rl)){
					Block block = remapBlocks.get(rl);
					mapping.remap(block);
					ModLogger.info("Fixed "+rl+". Remapped it to "+block.getRegistryName());
					fixed = true;
				}
			}
			if(!fixed){
				ModLogger.warning("Warning! "+rl+" was not remapped. Continue with caution.");
				//throw new RuntimeException("Warning "+rl+" needs to be remapped.");
			}
		}
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:73,代码来源:MissingItemHandler.java

示例10: remapBlocks

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
@Mod.EventHandler
	public void remapBlocks(FMLMissingMappingsEvent event) { // TODO: Remove legacy support
		for(FMLMissingMappingsEvent.MissingMapping mapping : event.getAll()) {
			if(mapping != null) {
				if(mapping.name.equals("ffs:blockFluidValve")) {
					if(mapping.type == GameRegistry.Type.BLOCK) {
						mapping.remap(blockFluidValve);
					}
					else if(mapping.type == GameRegistry.Type.ITEM) {
						mapping.remap(Item.getItemFromBlock(blockFluidValve));
					}
				}
				if(mapping.name.equals("ffs:blockMetaphaser")) {
					if(mapping.type == GameRegistry.Type.BLOCK) {
						mapping.remap(blockMetaphaser);
					}
					else if(mapping.type == GameRegistry.Type.ITEM) {
						mapping.remap(Item.getItemFromBlock(blockMetaphaser));
					}
				}
				if(mapping.name.equals("ffs:blockTankComputer")) {
					if(mapping.type == GameRegistry.Type.BLOCK) {
						mapping.remap(blockTankComputer);
					}
					else if(mapping.type == GameRegistry.Type.ITEM) {
						mapping.remap(Item.getItemFromBlock(blockTankComputer));
					}
				}
				if(mapping.name.equals("ffs:blockTankFrame")) {
					if(mapping.type == GameRegistry.Type.BLOCK) {
						mapping.remap(blockFrameNormalizer);
					}
//					else if(mapping.type == GameRegistry.Type.ITEM) {
//						mapping.remap(Item.getItemFromBlock(blockFrameNormalizer));
//					}
				}
				if(mapping.name.equals("ffs:blockTankFrameOpaque")) {
					if(mapping.type == GameRegistry.Type.BLOCK) {
						mapping.remap(blockFrameNormalizerOpaque);
					}
//					else if(mapping.type == GameRegistry.Type.ITEM) {
//						mapping.remap(Item.getItemFromBlock(blockFrameNormalizerOpaque));
//					}
				}
			}
		}
	}
 
开发者ID:Lordmau5,项目名称:FFS,代码行数:48,代码来源:FancyFluidStorage.java

示例11: onRemap

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
@EventHandler
public static void onRemap(FMLMissingMappingsEvent event) {
	proxy.onRemap(event);
}
 
开发者ID:MinecraftModDevelopmentMods,项目名称:BaseGems,代码行数:5,代码来源:BaseGems.java

示例12: missingMapping

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
@EventHandler
  public void missingMapping(FMLMissingMappingsEvent event)
  {
RemapHandler.processingMissingMap(event);
  }
 
开发者ID:cleverpanda,项目名称:SimpleCorn,代码行数:6,代码来源:Corn.java

示例13: missMap

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
@EventHandler
public void missMap(final FMLMissingMappingsEvent event) {
    FMLLog.info("Core Nord Mod start FMLMissingMappingsEvent");
}
 
开发者ID:Dark32,项目名称:NordMod,代码行数:5,代码来源:NordCore.java

示例14: remap

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
/**
 * Remap old item names for consistency
 * @param mapping received from the event
 * @return true if remap was successful
 */
public static boolean remap(FMLMissingMappingsEvent.MissingMapping mapping) {
    if(mapping.type == GameRegistry.Type.ITEM){
        if(mapping.name.contains("item."+MODID)){
            for(Item sheild:shield){
                if(sheild!=null && mapping.name.contains(sheild.getUnlocalizedName().substring(5))) {
                    mapping.remap(sheild);
                    return true;
                }
            }
            for(Item armor:knightArmor){
                if(armor!=null && mapping.name.contains(armor.getUnlocalizedName().substring(5))){
                    mapping.remap(armor);
                    return true;
                }
            }
            try {
                for (Field f : BattlegearConfig.class.getFields()) {
                    if (Item.class.isAssignableFrom(f.getType())) {
                        Item it = (Item) f.get(null);
                        if (it != null && mapping.name.contains(it.getUnlocalizedName().substring(5))) {
                            mapping.remap(it);
                            return true;
                        }
                    }
                }
            }catch (Exception ignored){}
        }
    }
    if(mapping.name.contains(MODID+MODID+"flagpole")) {
        if (banner != null) {
            if(mapping.type == GameRegistry.Type.ITEM){
                mapping.remap(Item.getItemFromBlock(banner));
            }
            else {
                mapping.remap(banner);
            }
            return true;
        }
    }
    return false;
}
 
开发者ID:Mine-and-blade-admin,项目名称:Battlegear2,代码行数:47,代码来源:BattlegearConfig.java

示例15: handleMappings

import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent; //导入依赖的package包/类
@EventHandler
public static void handleMappings(FMLMissingMappingsEvent event) {
  MigrationMapper.handleMappings(event);
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:5,代码来源:EnderIO.java


注:本文中的net.minecraftforge.fml.common.event.FMLMissingMappingsEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。