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


Java RegistryEvent類代碼示例

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


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

示例1: register

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public void register(RegistryEvent.Register<SoundEvent> event) {
	//System.out.println("SoundEvents:"+TF2Sounds.SOUND_EVENTS.size());
	TF2Sounds.registerSounds();
	//System.out.println("Registering sounds: "+ MapList.nameToData.values());
	for (WeaponData weapon : MapList.nameToData.values())
		for (PropertyType propType : weapon.properties.keySet())
			if (propType.name.contains("sound")) {
				ResourceLocation soundLocation = new ResourceLocation(propType.getString(weapon));
				if (!"".equals(soundLocation.getResourcePath())) {
					TF2Sounds.register(soundLocation);
					if (propType==WeaponData.PropertyType.FIRE_SOUND || propType==WeaponData.PropertyType.FIRE_LOOP_SOUND || propType==WeaponData.PropertyType.CHARGED_FIRE_SOUND)
						TF2Sounds.register(new ResourceLocation(propType.getString(weapon) + ".crit"));
				}
			}
	for(SoundEvent sevent:TF2Sounds.SOUND_EVENTS.values()) {
		event.getRegistry().register(sevent);
	}
}
 
開發者ID:rafradek,項目名稱:Mods,代碼行數:20,代碼來源:TF2EventsCommon.java

示例2: registerRecipes

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public void registerRecipes(RegistryEvent.Register<IRecipe> evt) {	
	IForgeRegistry<IRecipe> r = evt.getRegistry();
	
	for(EnumEdibleMeat meat : EnumEdibleMeat.values()) {
		ItemStack uncraftedRaw = meat.getRawItem().copy(); uncraftedRaw.setCount(9);
		ItemStack uncraftedCooked = meat.getCookedItem().copy(); uncraftedCooked.setCount(9);
		addMeatCompressionRecipe(r, meat, false, meat.getRawItem().copy());
		addMeatCompressionRecipe(r, meat, true,  meat.getCookedItem().copy());
		addMeatUncraftingRecipe(r, meat, false, uncraftedRaw);
		addMeatUncraftingRecipe(r, meat, true, uncraftedCooked);
		
		FurnaceRecipes.instance().addSmeltingRecipe(
				TWItems.meat(meat, false),
				TWItems.meat(meat, true),
				0.0f);
	}
	
	for(BlockGemrock block : TWBlocks.GROUP_GEMROCK) addBrickRecipes(r, block);
	
	//Norfairite can be dyed. This is surprisingly hard to get right.
	addDyeRecipes(r, TWBlocks.NORFAIRITE_CLEAR);
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:24,代碼來源:ThermionicsWorld.java

示例3: registerEntityEntries

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public void registerEntityEntries(RegistryEvent.Register<EntityEntry> event) {
    EntityRegistry.registerModEntity(
            new ResourceLocation(MODID, "trumpet_skeleton"), EntityTrumpetSkeleton.class, "trumpetskeleton.TrumpetSkeleton", 0,
            this,
            80, 3, false,
            0xC1C1C1, 0xFCFC00
    );
    List<Biome> biomes = ForgeRegistries.BIOMES.getValues();
    EntityRegistry.addSpawn(
            EntityTrumpetSkeleton.class,
            25, 4, 4,
            EnumCreatureType.MONSTER,
            biomes.toArray(new Biome[biomes.size()])
    );
}
 
開發者ID:JamiesWhiteShirt,項目名稱:trumpet-skeleton,代碼行數:17,代碼來源:TrumpetSkeleton.java

示例4: registerSounds

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public static void registerSounds(RegistryEvent.Register<SoundEvent> event) {
    event.getRegistry().registerAll(
            buildSound("air_cannon"),
            buildSound("leaking_gas"),
            buildSound("pneumatic_crusher"),
            buildSound("interface_door"),
            buildSound("elevator_rising_start"),
            buildSound("elevator_rising_stop"),
            buildSound("elevator_rising"),
            buildSound("helmet_hack_finish"),
            buildSound("hud_init"),
            buildSound("hud_init_complete"),
            buildSound("hud_entity_lock"),
            buildSound("sci_fi"),
            buildSound("pneumatic_wrench"),
            buildSound("minigun"),
            buildSound("minigun_stop"),
            buildSound("drone_hurt"),
            buildSound("drone_death"),
            buildSound("short_hiss")
    );
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:24,代碼來源:Sounds.java

示例5: onRegisterRecipe

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public void onRegisterRecipe(RegistryEvent.Register<IRecipe> event) {
    FruitEnumLoader loader = FoodCraftReloaded.getProxy().getLoaderManager().getLoader(FruitEnumLoader.class).get();
    OreDictionary.registerOre("cakeOriginal", Items.CAKE);
    for (FruitType fruitType : FruitType.values()) {
        event.getRegistry().register(new ShapedOreRecipe(new ResourceLocation("food"), new ItemStack(loader.getInstanceMap(BlockFruitSapling.class).get(fruitType)), " F ", "FXF", " F ", 'F', "crop" + StringUtils.capitalize(fruitType.toString()), 'X', "treeSapling").setRegistryName("fruit_sapling"));
        event.getRegistry().register(new ShapelessOreRecipe(new ResourceLocation("food"), new ItemStack(loader.getInstanceMap(ItemFruitIcecream.class).get(fruitType)), "food" + StringUtils.capitalize(fruitType.toString()) + "juice", "foodIcecream").setRegistryName("fruit_icecream"));
        GameRegistry.addShapelessRecipe(
            new ResourceLocation(FoodCraftReloaded.MODID, NameBuilder.buildRegistryName("cake", "fruit", fruitType.toString())),
            new ResourceLocation(FoodCraftReloaded.MODID, "cake"),
            new ItemStack(loader.getInstanceMap(ItemFruitCake.class).get(fruitType)),
            OreIngredient.fromItem(loader.getInstanceMap(ItemFruitJuice.class).get(fruitType)),
            new OreIngredient("cakeOriginal")
        );
    }

    event.getRegistry().register(new KitchenKnifeRecipe().setRegistryName(FoodCraftReloaded.MODID, "kitchen_knife_recipe"));
    event.getRegistry().register(new CakeRecipe().setRegistryName(FoodCraftReloaded.MODID, "cake"));
    RecipeSorter.register("foodcraftreloaded:cake", CakeRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
}
 
開發者ID:LasmGratel,項目名稱:FoodCraft-Reloaded,代碼行數:21,代碼來源:EventLoader.java

示例6: init

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
public static void init(RegistryEvent.Register<Item> event) {
    ItemSeedNightshade = new ItemSeedNightshade();
    ItemGlassJar = new ItemGlassJar();
    ItemCinnabar = new ItemCinnabar();
    ItemBurdockSeeds = new ItemBurdockSeeds();

    event.getRegistry().register(ItemGlassJar);
    event.getRegistry().register(ItemSeedNightshade);
    event.getRegistry().register(ItemCinnabar);
    event.getRegistry().register(ItemBurdockSeeds);

    event.getRegistry().register(new ItemBlock(GeneraBlocks.BlockFaerieHome).setRegistryName("faerie_home"));
    event.getRegistry().register(new ItemBlock(GeneraBlocks.BlockNightshadeCrop).setRegistryName("nightshade"));
    event.getRegistry().register(new ItemBlock(GeneraBlocks.BlockWhiteMushroom).setRegistryName("white_mushroom"));
    event.getRegistry().register(new ItemBlock(GeneraBlocks.BlockBurdockCrop).setRegistryName("burdock"));
    event.getRegistry().register(new ItemBlock(GeneraBlocks.BlockAltar).setRegistryName("altar"));
}
 
開發者ID:BenjaminSutter,項目名稱:genera,代碼行數:18,代碼來源:GeneraItems.java

示例7: registerGeoBurnables

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public static void registerGeoBurnables(RegistryEvent.Register<IGeoburnable> event){
    IForgeRegistry<IGeoburnable> reg = event.getRegistry();
    reg.register(new BlockGeoburnable(Blocks.MAGMA, 40, 1));
    reg.register(new BlockGeoburnable(Blocks.FIRE, 80, 2){
        @Override
        public ItemStack getJEIIcon() {
            return new ItemStack(Items.FLINT_AND_STEEL);
        }
    });
    reg.register(new BlockGeoburnable(Blocks.LAVA, 160, 3){
        @Override
        public ItemStack getJEIIcon() {
            return FluidUtil.getFilledBucket(new FluidStack(FluidRegistry.LAVA, Fluid.BUCKET_VOLUME));
        }
    });
}
 
開發者ID:canitzp,項目名稱:Metalworks,代碼行數:18,代碼來源:Registry.java

示例8: 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

示例9: registerBlocks

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public static void registerBlocks(RegistryEvent.Register<Block> event) {
	
	event.getRegistry().register(new BlockLodestoneOre());
	event.getRegistry().register(new BlockBase("celestial_stone").setHardness(5F).setResistance(1000.0F));
	event.getRegistry().register(new BlockRift("rift"));
	event.getRegistry().register(new BlockPipe("pipe"));
	event.getRegistry().register(new BlockStabilityProjector());
	
	event.getRegistry().register(new BlockCreativeTank());
	event.getRegistry().register(new BlockTestTank());
	
	GameRegistry.registerTileEntity(TileEntityRift.class, Etheric.MODID + ":rift");
	GameRegistry.registerTileEntity(TileEntityPipe.class, Etheric.MODID + ":pipe");
	GameRegistry.registerTileEntity(TileEntityStabilityProjector.class, Etheric.MODID + ":stability_projector");
	
	GameRegistry.registerTileEntity(TileEntityCreativeTank.class, Etheric.MODID + ":creative_tank");
	GameRegistry.registerTileEntity(TileEntityTestTank.class, Etheric.MODID + ":test_tank");
	
}
 
開發者ID:the-realest-stu,項目名稱:Etheric,代碼行數:21,代碼來源:RegistryManager.java

示例10: registerItems

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public static void registerItems(RegistryEvent.Register<Item> event) {
	registry = event.getRegistry();

	wallet = register(new ItemWallet("wallet"));
	linkingCard = register(new ItemLinkingCard("linking_card"));

	penny = register(new ItemMoneyBase("penny", 0.01F));
	nickel = register(new ItemMoneyBase("nickel", 0.05F));
	dime = register(new ItemMoneyBase("dime", 0.10F));
	quarter = register(new ItemMoneyBase("quarter", 0.25F));

	dollarBill = register(new ItemMoneyBase("dollar_bill", 1F));
	fiveDollarBill = register(new ItemMoneyBase("five_dollar_bill", 5F));
	tenDollarBill = register(new ItemMoneyBase("ten_dollar_bill", 10F));
	twentyDollarBill = register(new ItemMoneyBase("twenty_dollar_bill", 20F));
	fiftyDollarBill = register(new ItemMoneyBase("fifty_dollar_bill", 50F));
	hundredDollarBill = register(new ItemMoneyBase("hundred_dollar_bill", 100F));

	for (ItemBlock ib : itemBlocks) {
		registry.register(ib);
		if (ib.getBlock() instanceof BlockBasic) {
			((BlockBasic) ib.getBlock()).registerItemModel(ib);
		}
	}
}
 
開發者ID:Zundrel,項目名稱:Never-Enough-Currency,代碼行數:27,代碼來源:ItemHandler.java

示例11: itemRegistry

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public static void itemRegistry(RegistryEvent.Register<Item> e) {
	IForgeRegistry<Item> reg = e.getRegistry();
	registerItemBlock(reg, ModItems.compressor);
	registerItemBlock(reg, ModItems.defier);
	registerItemBlock(reg, ModItems.patternmolder);
	registerItemBlock(reg, ModItems.energyprovider);

	reg.register(new DefierItem("largemass"));
	reg.register(new DefierItem("defiercore"));
	reg.register(new DefierItem("defierstar"));
	reg.register(new EnergyStarItem());
	reg.register(new DefierItem("strongstar"));
	reg.register(new DefierItem("speedstar"));
	reg.register(new PatternItem());
}
 
開發者ID:tiffit,項目名稱:Defier,代碼行數:17,代碼來源:CommonProxy.java

示例12: registerBlocks

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public static void registerBlocks (RegistryEvent.Register<Block> event) {
    IForgeRegistry<Block> registry = event.getRegistry();

    registry.registerAll(
        new BlockStoneMaterial("stone_block", makeName("stone_block")),
        new BlockMetalMaterial("metal_block", makeName("metal_block")),
        new BlockBloomeryFurnace("bloomery_furnace", makeName("bloomery_furnace")),
        new BlockFence("metal_fence", makeName("metal_fence")),
        new BlockLattice("metal_lattice", makeName("metal_lattice")),
        new BlockCandelabra("candelabra", makeName("candelabra")),
        new BlockCandelilla("candelilla", makeName("candelilla"))
    );

    GameRegistry.registerTileEntity(TileBloomeryFurnace.class, makeName("bloomery_furnace"));
    GameRegistry.registerTileEntity(TileCandelabra.class, makeName("candelabra"));
    GameRegistry.registerTileEntity(TileLattice.class, makeName("metal_lattice"));
}
 
開發者ID:jaquadro,項目名稱:GardenStuff,代碼行數:19,代碼來源:ModBlocks.java

示例13: registerItems

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public static void registerItems (RegistryEvent.Register<Item> event) {
    IForgeRegistry<Item> registry = event.getRegistry();

    registry.registerAll(
        new ChamMultiItemBlock(stoneMaterial, BlockStoneMaterial.VARIANT, BlockStoneMaterial.StoneType.class, BlockStoneMaterial.StoneType::byMetadata),
        new ChamMultiItemBlock(metalMaterial, BlockMetalMaterial.VARIANT, BlockMetalMaterial.MetalType.class, BlockMetalMaterial.MetalType::byMetadata),
        new ItemBlock(bloomeryFurnace).setRegistryName(bloomeryFurnace.getRegistryName()),
        new ChamMultiItemBlock(metalFence, BlockFence.VARIANT, BlockFence.Variant.class, BlockFence.Variant::byMetadata),
        new ChamMultiItemBlock(metalLattice, BlockLattice.VARIANT, BlockLattice.Variant.class, BlockLattice.Variant::byMetadata),
        new ChamMultiItemBlock(candelabra, BlockCandelabra.VARIANT, BlockCandelabra.Variant.class, BlockCandelabra.Variant::byMetadata)
    );

    OreDictionary.registerOre("blockCharcoal", new ItemStack(stoneMaterial, 1, BlockStoneMaterial.StoneType.CHARCOAL_BLOCK.getMetadata()));
    OreDictionary.registerOre("blockWroughtIron", new ItemStack(metalMaterial, 1, BlockMetalMaterial.MetalType.WROUGHT_IRON_BLOCK.getMetadata()));
}
 
開發者ID:jaquadro,項目名稱:GardenStuff,代碼行數:17,代碼來源:ModBlocks.java

示例14: onRegisterPotions

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public void onRegisterPotions(RegistryEvent.Register<Potion> event) {
	IForgeRegistry<Potion> r = event.getRegistry();
	
	POTION_EFFORTLESS_SPEED = potion(r, new PotionExpedience());
	POTION_TIPSY = potion(r, new PotionTipsy());
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:8,代碼來源:Thermionics.java

示例15: registerBiomes

import net.minecraftforge.event.RegistryEvent; //導入依賴的package包/類
@SubscribeEvent
public static void registerBiomes(RegistryEvent.Register<Biome> event) {
	NEO_HELL.registryObjects.values().forEach((it)->{
		System.out.println("Registering "+it.getRegistryName());
		event.getRegistry().register(it);
		for(BiomeDictionary.Type type : it.getTypes()) {
			BiomeDictionary.addTypes(it, type);
		}
	});
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:11,代碼來源:BiomeRegistry.java


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