本文整理汇总了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()]));
}
示例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);
}
示例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.");
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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));
}
示例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);
}
示例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);
}
}
示例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.");
}
示例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.");
}
示例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.");
}
示例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")));
}
示例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]));
}
示例14: registerItem
import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void registerItem(Register<Item> event) {
for (Item item : items) {
event.getRegistry().register(item);;
}
}
示例15: registerBlock
import net.minecraftforge.event.RegistryEvent.Register; //导入依赖的package包/类
@SubscribeEvent
public void registerBlock(Register<Block> event) {
for (Block block : blocks) {
event.getRegistry().register(block);
}
}