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


Java VillagerRegistry.VillagerCareer方法代码示例

本文整理汇总了Java中net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer方法的典型用法代码示例。如果您正苦于以下问题:Java VillagerRegistry.VillagerCareer方法的具体用法?Java VillagerRegistry.VillagerCareer怎么用?Java VillagerRegistry.VillagerCareer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.fml.common.registry.VillagerRegistry的用法示例。


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

示例1: registerVillagers

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public static void registerVillagers() {
    undertakerProfession = new VillagerRegistry.VillagerProfession(UNDERTAKER_NAME, Resources.UNDERTAKER, Resources.UNDERTAKER_ZOMBIE);
    IForgeRegistry<VillagerRegistry.VillagerProfession> villagerProfessions = ForgeRegistries.VILLAGER_PROFESSIONS;
    villagerProfessions.register(undertakerProfession);

    undertakerCareer = new VillagerRegistry.VillagerCareer(undertakerProfession, UNDERTAKER_NAME);
    undertakerCareer.addTrade(1,
            new EntityVillager.ListItemForEmeralds(new ItemStack(Items.SKULL, 1), new EntityVillager.PriceInfo(5, 10)),// skeleton
            new EntityVillager.ListItemForEmeralds(new ItemStack(Items.SKULL, 1, 2), new EntityVillager.PriceInfo(5, 10))// zombie
    );
    undertakerCareer.addTrade(2,
            new EntityVillager.ListItemForEmeralds(new ItemStack(Items.SKULL, 1, 3), new EntityVillager.PriceInfo(10, 20)),// steve
            new EntityVillager.ListItemForEmeralds(new ItemStack(Items.SKULL, 1, 4), new EntityVillager.PriceInfo(15, 25))// creeper
    );
    undertakerCareer.addTrade(3, new EntityVillager.ListItemForEmeralds(new ItemStack(Items.SKULL, 1, 1), new EntityVillager.PriceInfo(25, 35)));// wither
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:17,代码来源:VillagersHandler.java

示例2: init

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public static void init() {
	if (CoreInit.isInit()) {
		CoreInit.log.info("Loading Villager Handler");
		VillagerRegistry.instance().registerVillageCreationHandler(new VillageHouseScientist.VillageManager());
		professionScientist = new VillagerRegistry.VillagerProfession(CoreInit.modid + ":vScientist", "tomsmod:textures/models/villager_scientist.png", "textures/entity/zombie_villager/zombie_librarian.png");
		VillagerRegistry.instance().register(professionScientist);
		MapGenStructureIO.registerStructureComponent(VillageHouseScientist.class, Configs.Modid + ":vh_scientist");
		VillagerRegistry.VillagerCareer career1 = new VillagerRegistry.VillagerCareer(professionScientist, Configs.Modid + ":vScientist1");
		career1.addTrade(1, new CircuitRecipe(CraftingMaterial.ELECTRIC_MOTOR, 0.25F, 3));
		career1.addTrade(2, new CircuitRecipe(CraftingMaterial.BASIC_CIRCUIT, 1), new CircuitRecipe(CraftingMaterial.NORMAL_CIRCUIT, 2), new CircuitRecipe(CraftingMaterial.ADVANCED_CIRCUIT, 5));
		career1.addTrade(3, new EliteBlueprintRecipe());
		career1.addTrade(4, new CircuitRecipe(CraftingMaterial.ELITE_CIRCUIT, 12));
		career1.addTrade(5, new AdvFluixReactorBlueprintRecipe());
		career1.addTrade(6, new CircuitRecipe(CraftingMaterial.QUANTUM_CIRCUIT, 35));
	} else {
		CoreInit.log.fatal("Somebody tries to corrupt the villager handler!");
		throw new RuntimeException("Somebody tries to corrupt the villager handler!");
	}
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:20,代码来源:VillageInit.java

示例3: getCareer

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public VillagerRegistry.VillagerCareer getCareer(String name)
{
	for (VillagerRegistry.VillagerCareer career : this.getCareers())
	{
		if (career.getName().equals(name)) return career;
	}
	return null;
}
 
开发者ID:crazysnailboy,项目名称:VillagerTrades,代码行数:9,代码来源:VillagerRegistryHelper.java

示例4: registerVillagers

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public static void registerVillagers() {
    petsSellerProfession = new VillagerRegistry.VillagerProfession(PETS_SELLER_NAME, Resources.PETS_SELLER, Resources.PETS_SELLER_ZOMBIE);
    IForgeRegistry<VillagerRegistry.VillagerProfession> villagerProfessions = ForgeRegistries.VILLAGER_PROFESSIONS;
    villagerProfessions.register(petsSellerProfession);

    petsSellerCareer = new VillagerRegistry.VillagerCareer(petsSellerProfession, PETS_SELLER_NAME);
    petsSellerCareer.addTrade(1,
            new EntityVillager.ListItemForEmeralds(new ItemStack(SWItems.DOG_TAG), new EntityVillager.PriceInfo(1, 2)),
            new EntityVillager.ListItemForEmeralds(new ItemStack(SWItems.DOG_TREAT), new EntityVillager.PriceInfo(1, 3))
    );
    petsSellerCareer.addTrade(2,
            new EntityVillager.ListItemForEmeralds(new ItemStack(SWBlocks.DOG_BOWL), new EntityVillager.PriceInfo(5, 10)),
            new EntityVillager.ListItemForEmeralds(new ItemStack(SWItems.PET_CARRIER), new EntityVillager.PriceInfo(6, 12))
    );
    petsSellerCareer.addTrade(3,
            (merchant, recipeList, random) -> {
                recipeList.add(getMerchantRecipe(EntityChicken.class, random, 13, 15));
            },
            (merchant, recipeList, random) -> {
                recipeList.add(getMerchantRecipe(EntityRabbit.class, random, 15, 20));
            },
            (merchant, recipeList, random) -> {
                recipeList.add(getMerchantRecipe(EntityWolf.class, random, 20, 25));
            }
    );
    petsSellerCareer.addTrade(4,
            (merchant, recipeList, random) -> {
                recipeList.add(getMerchantRecipe(EntityParrot.class, random, 20, 25));
            },
            (merchant, recipeList, random) -> {
                recipeList.add(getMerchantRecipe(EntityOcelot.class, random, 30, 40));
            },
            (merchant, recipeList, random) -> {
                recipeList.add(getMerchantRecipe(EntitySophisticatedWolf.class, random, 30, 40));
            }
    );
}
 
开发者ID:NightKosh,项目名称:Sophisticated-wolves,代码行数:38,代码来源:VillagersHandler.java

示例5: getCareers

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public List<VillagerRegistry.VillagerCareer> getCareers()
{
	return ReflectionHelper.getFieldValue(professionCareersField, this.profession);
}
 
开发者ID:crazysnailboy,项目名称:VillagerTrades,代码行数:5,代码来源:VillagerRegistryHelper.java

示例6: VTTVillagerCareer

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public VTTVillagerCareer(VillagerRegistry.VillagerCareer career)
{
	this.career = career;
}
 
开发者ID:crazysnailboy,项目名称:VillagerTrades,代码行数:5,代码来源:VillagerRegistryHelper.java


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