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


Java IForgeRegistry類代碼示例

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


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

示例1: registerRecipes

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的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

示例2: registerGeoBurnables

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的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

示例3: registerSounds

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的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

示例4: registerBlocks

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的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

示例5: registerItems

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的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

示例6: onRegisterBlocks

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的package包/類
@SubscribeEvent
public static void onRegisterBlocks(RegistryEvent.Register<Block> e)
{
    IForgeRegistry<Block> reg = e.getRegistry();
    register(new BlockCrystal(), reg);
    register(new BlockCrystalGlass(), reg);
    Block ore_crysagnetite = new BlockBase("ore_crysagnetite", Material.ROCK).setHardness(3).setLightLevel(0.1f);
    ore_crysagnetite.setHarvestLevel("pickaxe", 2);
    register(ore_crysagnetite, reg);
    register(new BlockTranslationDesk(), reg);
    register(new BlockCrystalSmall(), reg);
    register(new BlockWallIfTablet(), reg);
    register(new BlockBrokenWallIfTablet(), reg);
    register(new BlockMicroscope(), reg);
    register(new BlockLuminousCrystalGlass(), reg);
    register(new BlockTest(), reg);
    register(new BlockBrulantaFlower(), reg);
    register(new BlockCodeStorage(), reg);
    register(new BlockMagibench(), reg);
    register(new BlockRopeCoil(), reg);
    register(new BlockStoneCrusher(), reg);
}
 
開發者ID:PearXTeam,項目名稱:PurificatiMagicae,代碼行數:23,代碼來源:BlockRegistry.java

示例7: register

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的package包/類
public static void register(IForgeRegistry<Item> registry) {
	registry.register(itemBlock(ModBlocks.PRIMAL_STONE));
	registry.register(new ItemQuantumMirror());
	registry.register(new ItemBlockBaked(ModBlocks.GRAVITY_HOPPER));
	registry.register(new ItemBlockBaked(ModBlocks.SCHRODINGER_GLYPH));
	registry.register(new ItemBlinker());
	registry.register(itemBlock(ModBlocks.PHENOMENA));
	registry.register(new ItemCrystalQuartz());
	registry.register(itemBlock(ModBlocks.Q_SQUARED));
	registry.register(itemBlock(ModBlocks.THEOREMA));
	registry.register(itemBlock(ModBlocks.GRAVITY_INHIBITOR));
	registry.register(new ItemBlockBaked(ModBlocks.HYPER_CONDUCTOR));
	registry.register(new ItemBlockBaked(ModBlocks.ELECTRON));
	registry.register(itemBlock(ModBlocks.ASHEN));
	registry.register(itemBlock(ModBlocks.MONOLITHIC));
	registry.register(new ItemMonolithicGlyph());
	registry.register(new ItemAngstrom());
	registry.register(new ItemQimranut());
	registry.register(new ItemBlockBaked(ModBlocks.CELESTIAL_RESONATOR));
	registry.register(itemBlock(ModBlocks.LARGE_POT));
	registry.register(new ItemBase(LibNames.ASH));
	registry.register(new ItemBase(LibNames.SINGULARITY));
	registry.register(new ItemBase(LibNames.PLASMON));
	registry.register(new ItemVacuumConveyor());
	registry.register(new ItemMechanicalTranslocator());
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:27,代碼來源:ModItems.java

示例8: register

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的package包/類
public static void register(IForgeRegistry<Block> registry) {
	registry.register(new BlockBase(LibNames.PRIMAL_STONE, Material.ROCK).setHardness(4F).setResistance(2000F));
	registry.register(new BlockMonolithicGlyph());
	registry.register(new BlockQuantumMirror());
	registry.register(new BlockGravityHopper());
	registry.register(new BlockSchrodingerGlyph());
	registry.register(new BlockBlinker());
	registry.register(new BlockPhenomena());
	registry.register(new BlockQSquared());
	registry.register(new BlockTheorema());
	registry.register(new BlockGravityInhibitor());
	registry.register(new BlockHyperConductor());
	registry.register(new BlockElectron());
	registry.register(new BlockAshen());
	registry.register(new BlockMonolithic());
	registry.register(new BlockAngstrom());
	registry.register(new BlockQimranut());
	registry.register(new BlockCelestialResonator());
	registry.register(new BlockLargePot());
	registry.register(new BlockVacuumConveyor());
	registry.register(new BlockMechanicalTranslocator());
	registerTiles();
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:24,代碼來源:ModBlocks.java

示例9: addDyeRecipes

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的package包/類
public static void addDyeRecipes(IForgeRegistry<IRecipe> registry, BlockColored block) {
	ResourceLocation group = new ResourceLocation("thermionics_world", "dye");
	for(EnumDyeColor dye : EnumDyeColor.values()) {
		ShapelessOreRecipe recipe =
				new ShapelessOreRecipe(group, new ItemStack(TWBlocks.NORFAIRITE_CLEAR,1,dye.getMetadata()),
				new ItemStack(Items.DYE,1,dye.getDyeDamage()),
				new ItemStack(TWBlocks.NORFAIRITE_CLEAR,1,OreDictionary.WILDCARD_VALUE));
		recipe.setRegistryName(new ResourceLocation("thermionics_world", block.getRegistryName().getResourcePath()+"_DyeTo_"+dye.getUnlocalizedName()) );
		registry.register(recipe);
	}
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:12,代碼來源:ThermionicsWorld.java

示例10: addMeatCompressionRecipe

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的package包/類
public static void addMeatCompressionRecipe(IForgeRegistry<IRecipe> registry, EnumEdibleMeat meat, boolean cooked, ItemStack ingredient) {
	ResourceLocation group = new ResourceLocation("thermionics_world", "compress.meat");
	Ingredient input = Ingredient.fromStacks(ingredient);
	ShapedRecipes recipe = 
			new ShapedRecipes(group.toString(), 3, 3,
			NonNullList.withSize(3*3, input),
			new ItemStack(TWBlocks.MEAT_EDIBLE, 1, BlockMeatEdible.getMetaFromValue(meat, cooked)) );
	recipe.setRegistryName(new ResourceLocation("thermionics_world", meat.getName()+((cooked)?".cooked":".raw")+"_CompressToBlock"));
	registry.register(recipe);
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:11,代碼來源:ThermionicsWorld.java

示例11: addMeatUncraftingRecipe

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的package包/類
public static void addMeatUncraftingRecipe(IForgeRegistry<IRecipe> registry, EnumEdibleMeat meat, boolean cooked, ItemStack result) {
	ResourceLocation group = new ResourceLocation("thermionics_world", "uncompress.meat");
	ShapelessOreRecipe recipe = new ShapelessOreRecipe(group,
			result,
			new ItemStack(TWBlocks.MEAT_EDIBLE, 1, BlockMeatEdible.getMetaFromValue(meat, cooked)) );
	recipe.setRegistryName(new ResourceLocation("thermionics_world", meat.getName()+((cooked)?".cooked":".raw")+"_DecompressFromBlock"));
	registry.register(recipe);
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:9,代碼來源:ThermionicsWorld.java

示例12: addBrickRecipes

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的package包/類
public static void addBrickRecipes(IForgeRegistry<IRecipe> registry, BlockGemrock gem) {
	ResourceLocation group = new ResourceLocation("thermionics_world", "gemrock.chisel."+gem.getUnlocalizedName());
	ShapedOreRecipe a = new ShapedOreRecipe(group,
			new ItemStack(gem, 4, 1),
			"xx", "xx", 'x', new ItemStack(gem,1,0)
			);
	a.setRegistryName(new ResourceLocation("thermionics_world", "gemrock.chisel.intoBrick."+gem.getUnlocalizedName()));
	registry.register(a);
	
	registry.register(recipe("gemrock.chisel."+gem.getUnlocalizedName(),
			new ItemStack(gem, 1, 2),
			new ItemStack(gem, 1, 1)
			));
	registry.register(recipe("gemrock.chisel."+gem.getUnlocalizedName(),
			new ItemStack(gem, 1, 3),
			new ItemStack(gem, 1, 2)
			));
	registry.register(recipe("gemrock.chisel."+gem.getUnlocalizedName(),
			new ItemStack(gem, 1, 4),
			new ItemStack(gem, 1, 3)
			));
	registry.register(recipe("gemrock.chisel."+gem.getUnlocalizedName(),
			new ItemStack(gem, 1, 1),
			new ItemStack(gem, 1, 4)
			));
	
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:28,代碼來源:ThermionicsWorld.java

示例13: fluidBlock

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的package包/類
public static BlockFluidSimple fluidBlock(IForgeRegistry<Block> registry, Fluid f) {
	FluidRegistry.registerFluid(f);
	BlockFluidSimple result = block(registry, new BlockFluidSimple(f, f.getName()));
	f.setBlock(result);
	FluidRegistry.addBucketForFluid(f);
	return result;
}
 
開發者ID:elytra,項目名稱:ThermionicsWorld,代碼行數:8,代碼來源:TWBlocks.java

示例14: registerBlocks

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

    for (final IFluidBlock fluidBlock : MOD_FLUID_BLOCKS) {
        final Block block = (Block) fluidBlock;
        block.setRegistryName(RL("fluid." + fluidBlock.getFluid().getName()));
        block.setUnlocalizedName(fluidBlock.getFluid().getName());
        block.setCreativeTab(PneumaticCraftRepressurized.tabPneumaticCraft);
        registry.register(block);
        fluidToBlockMap.put(fluidBlock.getFluid().getName(), block);
        Log.info("registered block for fluid: " + fluidBlock.getFluid().getName());
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:15,代碼來源:Fluids.java

示例15: registerUpgrades

import net.minecraftforge.registries.IForgeRegistry; //導入依賴的package包/類
private static void registerUpgrades(IForgeRegistry<Item> registry) {
    for (EnumUpgrade upgrade : EnumUpgrade.values()) {
        if (upgrade != EnumUpgrade.THAUMCRAFT || Loader.isModLoaded(ModIds.THAUMCRAFT)) {
            String upgradeName = upgrade.toString().toLowerCase() + "_upgrade";
            Item upgradeItem = new ItemMachineUpgrade(upgradeName, upgrade.ordinal());
            registerItem(registry, upgradeItem);
            upgrades.put(upgrade, upgradeItem);
        }
    }
}
 
開發者ID:TeamPneumatic,項目名稱:pnc-repressurized,代碼行數:11,代碼來源:Itemss.java


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