• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Register类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: initBlocks

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
public static void initBlocks(Register event) {
	oreTin = new Block(Material.ROCK).setHardness(.5F).setUnlocalizedName("oreTin").setCreativeTab(Registry.tabsAllomancy).setRegistryName(new ResourceLocation(Allomancy.MODID,"oreTin"));
	oreTin.setHarvestLevel("pickaxe", 1);
	oreLead = new Block(Material.ROCK).setHardness(.5F).setUnlocalizedName("oreLead").setCreativeTab(Registry.tabsAllomancy).setRegistryName(new ResourceLocation(Allomancy.MODID,"oreLead"));
	oreLead.setHarvestLevel("pickaxe", 1);
	oreCopper = new Block(Material.ROCK).setHardness(.5F).setUnlocalizedName("oreCopper").setCreativeTab(Registry.tabsAllomancy).setRegistryName(new ResourceLocation(Allomancy.MODID,"oreCopper"));
	oreCopper.setHarvestLevel("pickaxe", 1);
	oreZinc = new Block(Material.ROCK).setHardness(.5F).setUnlocalizedName("oreZinc").setCreativeTab(Registry.tabsAllomancy).setRegistryName(new ResourceLocation(Allomancy.MODID,"oreZinc"));
	oreZinc.setHarvestLevel("pickaxe", 1);
	blockIronLever = new BlockIronLever();
	
	event.getRegistry().registerAll(oreTin,oreLead,oreCopper,oreZinc, blockIronLever);
}
 
开发者ID:legobmw99,项目名称:Allomancy,代码行数:14,代码来源:Registry.java


示例17: setupRecipes

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
public static void setupRecipes(Register event) {
	event.getRegistry().register(new RecipeItemVial());
	GameRegistry.addSmelting(oreTin, new ItemStack(itemTinIngot, 1), 5);
	GameRegistry.addSmelting(oreCopper, new ItemStack(itemCopperIngot, 1), 5);
	GameRegistry.addSmelting(oreLead, new ItemStack(itemLeadIngot, 1), 5);
	GameRegistry.addSmelting(oreZinc, new ItemStack(itemZincIngot, 1), 5);
}
 
开发者ID:legobmw99,项目名称:Allomancy,代码行数:8,代码来源:Registry.java


示例18: onSoundEventRegister

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void onSoundEventRegister(Register<SoundEvent> e) {
    IForgeRegistry<SoundEvent> reg = e.getRegistry();
    reg.register(EntityOwl.SND_HOOT);
    reg.register(EntityOwl.SND_HOOT2);
    reg.register(EntityOwl.SND_HURT);
}
 
开发者ID:SleepyTrousers,项目名称:EnderZoo,代码行数:8,代码来源:RegistryHandler.java


示例19: onEntityRegister

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void onEntityRegister(Register<EntityEntry> e) {
    for (MobInfo mob : MobInfo.values()) {
    	EntityEntry entry = new EntityEntry(mob.getClz(), mob.getName());
    	ResourceLocation name = new ResourceLocation(EnderZoo.MODID, mob.getName());
    	entry.setRegistryName(name);
    	entry.setEgg(new EntityEggInfo(name, mob.getEggBackgroundColor(), mob.getEggForegroundColor()));
    	e.getRegistry().register(entry);
        registerEntity(mob);
      }
}
 
开发者ID:SleepyTrousers,项目名称:EnderZoo,代码行数:12,代码来源:RegistryHandler.java


示例20: registerBlocks

import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent(priority = EventPriority.NORMAL)
public static void registerBlocks(@Nonnull RegistryEvent.Register<Block> event) {
  Log.info("ModObjectRegistry:RegistryEvent.Register<Block>");
  for (IModObject elem : objects) {
    if (elem instanceof IModObject.Registerable) {
      IModObject.Registerable mo = (IModObject.Registerable) elem;
      final String blockMethodName = mo.getBlockMethodName();
      if (blockMethodName != null) {
        createBlock(mo, blockMethodName, event);
      }
    }
  }
}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:14,代码来源:ModObjectRegistry.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Link类代码示例发布时间:2022-05-22
下一篇:
Java SecurityReference类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap