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


Java Register类代码示例

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


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

示例1: onRecipeRegister

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void onRecipeRegister(Register<IRecipe> e)
{
	// TODO: shadows will probably make this better.. hopefully :-)
	OreDictionary.registerOre("formationAnima",
			new ItemStack(ModRegistry.ANIMA, 1, OreDictionary.WILDCARD_VALUE));

	for (Item i : ModRegistry.ITEMS)
		if (i instanceof IHasRecipe)
			((IHasRecipe) i).initRecipes(e);
	for (Block b : ModRegistry.BLOCKS)
		if (b instanceof IHasRecipe)
			((IHasRecipe) b).initRecipes(e);

	RecipeHelper.addShaped(BLANK_PARCHMENT, 3, 3, null, "paper", null, "paper", "dye", "paper", null, "paper",
			null);

	// @Shadows: The day I work with JSON recipes is the day the world ends.
	// @raphy: uhoh
	e.getRegistry().registerAll(RECIPES.toArray(new IRecipe[RECIPES.size()]));
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:22,代码来源:ModRegistry.java

示例2: registerSounds

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void registerSounds(Register<SoundEvent> event)
{
	IForgeRegistry<SoundEvent> registry = event.getRegistry();
	ArcaneMagicSoundHandler.register("spell", registry);
	ArcaneMagicSoundHandler.register("scepter_1", registry);
	ArcaneMagicSoundHandler.register("scepter_2", registry);
	ArcaneMagicSoundHandler.register("scepter_3", registry);
	ArcaneMagicSoundHandler.register("page_1", registry);
	ArcaneMagicSoundHandler.register("page_2", registry);
	ArcaneMagicSoundHandler.register("arcane_transfiguration_success", registry);
	ArcaneMagicSoundHandler.register("write_1", registry);
	ArcaneMagicSoundHandler.register("write_2", registry);
	ArcaneMagicSoundHandler.register("learn_1", registry);
	ArcaneMagicSoundHandler.register("learn_2", registry);
	ArcaneMagicSoundHandler.register("reconstruct", registry);
	ArcaneMagicSoundHandler.register("clack", registry);
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:19,代码来源:ModRegistry.java

示例3: onItemRegistry

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
/** Register items */
@SubscribeEvent
public void onItemRegistry(Register<Item> e) {
	ACItems.mainRegistry();
	
	for(Item i : ITEMS_TO_REGISTER) {
		e.getRegistry().register(i);
	}
	ITEMS_TO_REGISTER.clear();
	
	// ore dict before recipes!
	ACCraftingManager.addOreDictEntries();
	
	AdvancedCombat.proxy.registerModels();
	
	Log.logger.info("Items registered.");
}
 
开发者ID:sblectric,项目名称:AdvancedCombat,代码行数:18,代码来源:RegistryHelper.java

示例4: registerItems

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public static void registerItems(@Nonnull RegistryEvent.Register<Item> event) {
  Log.info("ModObjectRegistry:RegistryEvent.Register<Item>");
  for (IModObject elem : objects) {
    if (elem instanceof IModObject.Registerable) {
      IModObject.Registerable mo = (IModObject.Registerable) elem;

      final String itemMethodName = mo.getItemMethodName();
      if (itemMethodName != null) {
        createItem(mo, itemMethodName, event);
      } else {
        createBlockItem(mo, event);
      }
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:17,代码来源:ModObjectRegistry.java

示例5: createBlockItem

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
private static void createBlockItem(Registerable mo, @Nonnull Register<Item> event) {
  Block block = mo.getBlock();
  if (block instanceof IModObject.WithBlockItem) {
    final Item item = ((IModObject.WithBlockItem) block).createBlockItem(mo);
    if (item != null) {
      mo.setItem(item);
      event.getRegistry().register(item);
      reverseMapping.put(item, mo);
    }
  } else if (block == null) {
    Log.warn("ModObject:create: " + mo + " is does neither have a block nor an item");
  } else { // TODO: Remove this branch once all blocks have been changed
    final Item itemFromBlock = Item.getItemFromBlock(block);
    if (itemFromBlock != Items.AIR) {
      Log.error("ModObject:create: " + mo + " is still creating its blockItem in the block phase");
      mo.setItem(itemFromBlock);
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:20,代码来源:ModObjectRegistry.java

示例6: onAnimaRegister

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void onAnimaRegister(Register<Anima> event)
{
	event.getRegistry().registerAll(OZONE, DEPTH, INFERNO, HORIZON, PEACE, CHAOS, CREATION);
	OZONE.setItemForm(new ItemStack(ModRegistry.ANIMA));
	DEPTH.setItemForm(new ItemStack(ModRegistry.ANIMA, 1, 1));
	INFERNO.setItemForm(new ItemStack(ModRegistry.ANIMA, 1, 2));
	HORIZON.setItemForm(new ItemStack(ModRegistry.ANIMA, 1, 3));
	PEACE.setItemForm(new ItemStack(ModRegistry.ANIMA, 1, 4));
	CHAOS.setItemForm(new ItemStack(ModRegistry.ANIMA, 1, 5));
	CREATION.setItemForm(new ItemStack(ModRegistry.CREATION));
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:13,代码来源:Anima.java

示例7: init

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
	MinecraftForge.EVENT_BUS.post(
			new Register<Anima>(new ResourceLocation(ArcaneMagic.MODID, "essence_registry"), Anima.REGISTRY));
	NetworkRegistry.INSTANCE.registerGuiHandler(ArcaneMagic.instance, new GuiProxy());
	proxy.init(event);
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:9,代码来源:ArcaneMagic.java

示例8: onItemRegistry

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void onItemRegistry(Register<Item> event) {
	
	// register all the things!
	for (ItemBase item : ItemRegistry.Items().All)
	{
		item.register(event);
	}
	
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:11,代码来源:Registrar.java

示例9: registerItems

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
public static final void registerItems(Register<Item> e) {
	itemRegistry = e;
	addItems();
	LogUtils.info("Registered items.");
	
	for (BlockBase block : ModBlocks.getBlocks()) {
		registerItemBlock(block);
	}
	LogUtils.info("Registered block items.");
}
 
开发者ID:cjburkey01,项目名称:MiningWells,代码行数:11,代码来源:ModItems.java

示例10: onBlockRegistry

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
/** Register blocks */
@SubscribeEvent
public void onBlockRegistry(Register<Block> e) {
	ACBlocks.mainRegistry();
	
	for(Block b : BLOCKS_TO_REGISTER) {
		e.getRegistry().register(b);
	}
	BLOCKS_TO_REGISTER.clear();
	
	Log.logger.info("Blocks registered.");
}
 
开发者ID:sblectric,项目名称:AdvancedCombat,代码行数:13,代码来源:RegistryHelper.java

示例11: onRecipeRegistry

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
/** Register recipes */
@SubscribeEvent
public void onRecipeRegistry(Register<IRecipe> e) {
	ACCraftingManager.addCraftingRecipes();
	
	for(IRecipe r : RECIPES_TO_REGISTER) {
		e.getRegistry().register(r);
	}
	RECIPES_TO_REGISTER.clear();
	
	Log.logger.info("Recipes registered.");
}
 
开发者ID:sblectric,项目名称:AdvancedCombat,代码行数:13,代码来源:RegistryHelper.java

示例12: init

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public static void init(Register<Item> event) {
  INSTANCE_BLACK = new ItemChessControlWand(Side.BLACK);
  INSTANCE_WHITE = new ItemChessControlWand(Side.WHITE);
  event.getRegistry().register(INSTANCE_BLACK.setRegistryName(new ResourceLocation(ToroChess.MODID, NAME + "_black")));
  event.getRegistry().register(INSTANCE_WHITE.setRegistryName(new ResourceLocation(ToroChess.MODID, NAME + "_white")));
}
 
开发者ID:ToroCraft,项目名称:ToroChess,代码行数:8,代码来源:ItemChessControlWand.java

示例13: onRecipeRegistry

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void onRecipeRegistry(Register<IRecipe> e) {
	if (Loader.isModLoaded(AE2ID)) AEModule.loadRecipes();

	if (Loader.isModLoaded(RSID)) RSModule.loadRecipes();

	e.getRegistry().registerAll(INFO.getRecipeList().toArray(new IRecipe[0]));
}
 
开发者ID:Shadows-of-Fire,项目名称:Growable-Cells,代码行数:9,代码来源:GrowableCells.java

示例14: registerItem

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void registerItem(Register<Item> event) {
    
    for (Item item : items) {
        
        event.getRegistry().register(item);;
    }
}
 
开发者ID:Darkhax-Minecraft,项目名称:Tesla,代码行数:9,代码来源:TeslaTest.java

示例15: registerBlock

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void registerBlock(Register<Block> event) {
    
    for (Block block : blocks) {
        
        event.getRegistry().register(block);
    }
}
 
开发者ID:Darkhax-Minecraft,项目名称:Tesla,代码行数:9,代码来源:TeslaTest.java


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