當前位置: 首頁>>代碼示例>>Java>>正文


Java RegistryEvent.MissingMappings方法代碼示例

本文整理匯總了Java中net.minecraftforge.event.RegistryEvent.MissingMappings方法的典型用法代碼示例。如果您正苦於以下問題:Java RegistryEvent.MissingMappings方法的具體用法?Java RegistryEvent.MissingMappings怎麽用?Java RegistryEvent.MissingMappings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.event.RegistryEvent的用法示例。


在下文中一共展示了RegistryEvent.MissingMappings方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: missingItemMapping

import net.minecraftforge.event.RegistryEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void missingItemMapping(RegistryEvent.MissingMappings<Item> event)
{
	BetterThanWeagles.logger.warn("Caught missing item mappings! Attempting to repair them...");

	for (RegistryEvent.MissingMappings.Mapping<Item> mapping : event.getMappings())
	{
		switch (mapping.key.toString())
		{
			case "btweagles:os_music":
				BetterThanWeagles.logger.info("Item mapping for Every OS Sucks is missing, replacing it...");
				mapping.remap(ModItems.matt_music);
				break;
			default:
				BetterThanWeagles.logger.info("Item mapping for " + mapping.key + " is missing, taking default action.");
		}
	}
}
 
開發者ID:DarkMorford,項目名稱:BetterThanWeagles,代碼行數:19,代碼來源:EventHandlerMappings.java

示例2: missingSoundMapping

import net.minecraftforge.event.RegistryEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void missingSoundMapping(RegistryEvent.MissingMappings<SoundEvent> event)
{
	BetterThanWeagles.logger.warn("Caught missing sound mappings! Attempting to repair them...");

	for (RegistryEvent.MissingMappings.Mapping<SoundEvent> mapping : event.getMappings())
	{
		switch (mapping.key.toString())
		{
			case "btweagles:os_music":
				BetterThanWeagles.logger.info("Sound mapping for Every OS Sucks is missing, replacing it...");
				mapping.remap(ModSounds.matt_music);
				break;
			default:
				BetterThanWeagles.logger.info("Sound mapping for " + mapping.key + " is missing, taking default action.");
		}
	}
}
 
開發者ID:DarkMorford,項目名稱:BetterThanWeagles,代碼行數:19,代碼來源:EventHandlerMappings.java

示例3: mappingBlocks

import net.minecraftforge.event.RegistryEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void mappingBlocks(RegistryEvent.MissingMappings<Block> map){
    for(RegistryEvent.MissingMappings.Mapping<Block> mapping : map.getAllMappings()){
        ResourceLocation targetName = mapping.key;
        if(targetName != null && Objects.equals(targetName.getResourceDomain(), "simplesteel")){
            Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(MODID, targetName.getResourcePath()));
            if(block != null){
                mapping.remap(block);
            }
        }
    }
}
 
開發者ID:canitzp,項目名稱:Metalworks,代碼行數:13,代碼來源:Metalworks.java

示例4: mappingItems

import net.minecraftforge.event.RegistryEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void mappingItems(RegistryEvent.MissingMappings<Item> map){
    for(RegistryEvent.MissingMappings.Mapping<Item> mapping : map.getAllMappings()){
        ResourceLocation targetName = mapping.key;
        if(targetName != null && Objects.equals(targetName.getResourceDomain(), "simplesteel")){
            Item item = ForgeRegistries.ITEMS.getValue(new ResourceLocation(MODID, targetName.getResourcePath()));
            if(item != null){
                mapping.remap(item);
            }
        }
    }
}
 
開發者ID:canitzp,項目名稱:Metalworks,代碼行數:13,代碼來源:Metalworks.java

示例5: onBlockMissing

import net.minecraftforge.event.RegistryEvent; //導入方法依賴的package包/類
@SubscribeEvent
public static void onBlockMissing(RegistryEvent.MissingMappings<Block> event) {
    for (RegistryEvent.MissingMappings.Mapping<Block> mapping : event.getAllMappings()) {
        if (new ResourceLocation(MooncakeConstants.MODID, "jujube_plant").equals(mapping.key)) {
            mapping.remap(Blocks.WHEAT);
            break;
        }
    }
}
 
開發者ID:TeamCovertDragon,項目名稱:MooncakeCraft,代碼行數:10,代碼來源:MooncakeRegistries.java


注:本文中的net.minecraftforge.event.RegistryEvent.MissingMappings方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。