本文整理汇总了Java中net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping.remap方法的典型用法代码示例。如果您正苦于以下问题:Java MissingMapping.remap方法的具体用法?Java MissingMapping.remap怎么用?Java MissingMapping.remap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping
的用法示例。
在下文中一共展示了MissingMapping.remap方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleMappings
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping; //导入方法依赖的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) {
}
}
}
}
}
示例2: handleFzPrefixStrip
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping; //导入方法依赖的package包/类
@EventHandler
public void handleFzPrefixStrip(FMLMissingMappingsEvent event) {
Map<String, Item> fixups = Registry.nameCleanup;
for (MissingMapping missed : event.get()) {
if (missed.type != GameRegistry.Type.ITEM) continue;
Item target = fixups.get(missed.name);
if (target != null) {
missed.remap(target);
}
}
}
示例3: replaceDerpyNames
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping; //导入方法依赖的package包/类
@EventHandler
public void replaceDerpyNames(FMLMissingMappingsEvent event) {
// NORELEASE: Can remove in 1.8
Object[][] corrections = new Object[][] {
{"factorization:tile.null", Core.registry.legacy_factory_block},
{"factorization:FZ factory", Core.registry.legacy_factory_block},
{"factorization:tile.factorization.ResourceBlock", Core.registry.resource_block},
{"factorization:FZ resource", Core.registry.resource_block},
{"factorization:tile.lightair", Core.registry.lightair_block},
{"factorization:FZ Lightair", Core.registry.lightair_block},
{"factorization:tile.factorization:darkIronOre", Core.registry.dark_iron_ore},
{"factorization:FZ dark iron ore", Core.registry.dark_iron_ore},
{"factorization:tile.bedrock", Core.registry.fractured_bedrock_block},
{"factorization:FZ fractured bedrock", Core.registry.fractured_bedrock_block},
{"factorization:tile.factorization:darkIronOre", Core.registry.dark_iron_ore},
{"factorization:FZ fractured bedrock", Core.registry.fractured_bedrock_block},
};
HashMap<String, Block> corr = new HashMap<String, Block>();
for (Object[] pair : corrections) {
corr.put((String) pair[0], (Block) pair[1]);
}
for (MissingMapping missed : event.get()) {
Block value = corr.get(missed.name);
if (value == null) {
continue;
}
if (missed.type == Type.BLOCK) {
missed.remap(value);
} else if (missed.type == Type.ITEM) {
Item it = DataUtil.getItem(value);
if (it != null) {
missed.remap(it);
}
}
}
}
示例4: processingMissingMap
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping; //导入方法依赖的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);
}
}
}
示例5: missingFix
import net.minecraftforge.fml.common.event.FMLMissingMappingsEvent.MissingMapping; //导入方法依赖的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.");
}
}
}
}