本文整理匯總了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.");
}
}
}
示例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.");
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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;
}
}
}