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


Java VillagerRegistry.VillagerProfession方法代码示例

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


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

示例1: getProfessionIdsAndNamesSortedById

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public static List<Map.Entry<Integer, String>> getProfessionIdsAndNamesSortedById()
{
	List<Map.Entry<Integer, String>> professions = new ArrayList<Map.Entry<Integer, String>>();

	for (VillagerRegistry.VillagerProfession profession : ForgeRegistries.VILLAGER_PROFESSIONS.getValues())
	{
		@SuppressWarnings("deprecation")
		int id = VillagerRegistry.getId(profession);
		String name = profession.getRegistryName().toString();
		professions.add(new AbstractMap.SimpleEntry<Integer, String>(id, name));
	}

	Collections.sort(professions, new Comparator<Map.Entry<Integer, String>>()
	{
		@Override
		public int compare(Map.Entry<Integer, String> o1, Map.Entry<Integer, String> o2)
		{
			return o1.getKey() - o2.getKey();
		}
	});

	return professions;

}
 
开发者ID:crazysnailboy,项目名称:VillagerTrades,代码行数:25,代码来源:VillagerRegistryHelper.java

示例2: getDefaultCorpses

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public static List<ItemStack> getDefaultCorpses() {
    List<ItemStack> list = new ArrayList<>();

    list.add(createCorpse(0, 1)); // Farmer - farmer
    list.add(createCorpse(0, 2)); // Farmer - fisherman
    list.add(createCorpse(0, 3)); // Farmer - shepherd
    list.add(createCorpse(0, 4)); // Farmer - fletcher
    list.add(createCorpse(1, 1)); // Librarian - librarian
    list.add(createCorpse(1, 2)); // Librarian - cartographer
    list.add(createCorpse(2, 1)); // Priest - cleric
    list.add(createCorpse(3, 1)); // Smith - armor
    list.add(createCorpse(3, 2)); // Smith - weapon
    list.add(createCorpse(3, 3)); // Smith - tool
    list.add(createCorpse(4, 1)); // Butcher - butcher
    list.add(createCorpse(4, 2)); // Butcher - leather
    list.add(createCorpse(5, 1)); // Nitwit - nitwit

    List<VillagerRegistry.VillagerProfession> villagers = ForgeRegistries.VILLAGER_PROFESSIONS.getValues();
    for (VillagerRegistry.VillagerProfession villagerProfession : villagers) {
        list.add(createCorpse(VillagerRegistry.getId(villagerProfession), villagerProfession.getRandomCareer(RANDOM)));
    }

    return list;
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:25,代码来源:ZombieVillagerCorpseHelper.java

示例3: getDefaultCorpses

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public static List<ItemStack> getDefaultCorpses() {
    List<ItemStack> list = new ArrayList<>();

    list.add(getDefaultVillagerCorpse(0, 1)); // Farmer - farmer
    list.add(getDefaultVillagerCorpse(0, 2)); // Farmer - fisherman
    list.add(getDefaultVillagerCorpse(0, 3)); // Farmer - shepherd
    list.add(getDefaultVillagerCorpse(0, 4)); // Farmer - fletcher
    list.add(getDefaultVillagerCorpse(1, 1)); // Librarian - librarian
    list.add(getDefaultVillagerCorpse(1, 2)); // Librarian - cartographer
    list.add(getDefaultVillagerCorpse(2, 1)); // Priest - cleric
    list.add(getDefaultVillagerCorpse(3, 1)); // Smith - armor
    list.add(getDefaultVillagerCorpse(3, 2)); // Smith - weapon
    list.add(getDefaultVillagerCorpse(3, 3)); // Smith - tool
    list.add(getDefaultVillagerCorpse(4, 1)); // Butcher - butcher
    list.add(getDefaultVillagerCorpse(4, 2)); // Butcher - leather
    list.add(getDefaultVillagerCorpse(5, 1)); // Nitwit - nitwit

    List<VillagerRegistry.VillagerProfession> villagers = ForgeRegistries.VILLAGER_PROFESSIONS.getValues();
    for (VillagerRegistry.VillagerProfession villagerProfession : villagers) {
        list.add(getDefaultVillagerCorpse(VillagerRegistry.getId(villagerProfession), villagerProfession.getRandomCareer(RANDOM)));
    }

    return list;
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:25,代码来源:VillagerCorpseHelper.java

示例4: getNotVanillaVillagerProfession

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
private static String getNotVanillaVillagerProfession(int type) {
        VillagerRegistry.VillagerProfession profession = VillagerRegistry.getById(type);
        String professionName = profession.getRegistryName().getResourceDomain() + ":" + profession.getRegistryName().getResourcePath();

        if (professionName.equals(VillagersHandler.UNDERTAKER_NAME)) {
            return "item.corpse.villager_type.undertaker";
        } else if (Compatibility.forestryInstalled && professionName.equals(CompatibilityForestry.getApicultureVillagerID())) {
            return "item.corpse.villager_type.beekeeper";
        } else if (Compatibility.forestryInstalled && professionName.equals(CompatibilityForestry.getArboricultureVillagerID())) {
            return "item.corpse.villager_type.lumberjack";
        }
//        else if (type == 10) {
//            return "item.corpse.villager_type.brewer";
//        } else if (type == 206) {
//            return "item.corpse.villager_type.thaumaturge";
//        }
        return "item.corpse.villager_type.unknown";
    }
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:19,代码来源:VillagerCorpseHelper.java

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

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

示例7: chooseForgeProfession

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
@Override
protected VillagerRegistry.VillagerProfession chooseForgeProfession(int count, VillagerRegistry.VillagerProfession prof)
{
	if (count == 0)
	{
		return ModVillagers.professionKrog;
	}
	else
	{
		return ModVillagers.professionTorg;
	}
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:13,代码来源:VillagerStructures.java

示例8: registerVillagers

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
@SubscribeEvent
public static void registerVillagers(RegistryEvent.Register<VillagerRegistry.VillagerProfession> event)
{
	VillagerRegistry.instance().registerVillageCreationHandler(new VillagerStructures.CaveHandler());
	MapGenStructureIO.registerStructureComponent(VillagerStructures.Cave.class, "btweagles:caveStructure");

	event.getRegistry().register(ModVillagers.professionKrog);
	event.getRegistry().register(ModVillagers.professionTorg);
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:10,代码来源:CommonProxy.java

示例9: bindVillagerTexture

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
private static void bindVillagerTexture(int profession) {
    switch (profession) {
        case 0:
            Minecraft.getMinecraft().renderEngine.bindTexture(Resources.VILLAGER_FARMER);
            break;
        case 1:
            Minecraft.getMinecraft().renderEngine.bindTexture(Resources.VILLAGER_LIBRARIAN);
            break;
        case 2:
            Minecraft.getMinecraft().renderEngine.bindTexture(Resources.VILLAGER_PRIEST);
            break;
        case 3:
            Minecraft.getMinecraft().renderEngine.bindTexture(Resources.VILLAGER_SMITH);
            break;
        case 4:
            Minecraft.getMinecraft().renderEngine.bindTexture(Resources.VILLAGER_BUTCHER);
            break;
        default:
            ResourceLocation skin = Resources.VILLAGER;
            if (MODDED_VILLAGERS.containsKey(profession)) {
                skin = MODDED_VILLAGERS.get(profession);
            } else {
                VillagerRegistry.VillagerProfession villager = VillagerRegistry.getById(profession);
                if (villager != null) {
                    skin = villager.getSkin();
                }
                MODDED_VILLAGERS.put(profession, skin);
            }

            Minecraft.getMinecraft().renderEngine.bindTexture(skin);
            break;
    }
}
 
开发者ID:NightKosh,项目名称:Gravestone-mod-Extended,代码行数:34,代码来源:CorpseRendererHelper.java

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

示例11: VTTVillagerProfession

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

示例12: getProfession

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
public static VillagerRegistry.VillagerProfession getProfession(String value)
{
	return ForgeRegistries.VILLAGER_PROFESSIONS.getValue(new ResourceLocation(value));
}
 
开发者ID:crazysnailboy,项目名称:VillagerTrades,代码行数:5,代码来源:VillagerRegistryHelper.java

示例13: registerVillagerProfessions

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
@SubscribeEvent
public final void registerVillagerProfessions(RegistryEvent.Register<VillagerRegistry.VillagerProfession> event) {
    InfinityLib.proxy.registerVillagerProfessions(this, event.getRegistry());
}
 
开发者ID:InfinityRaider,项目名称:InfinityLib,代码行数:5,代码来源:InfinityMod.java

示例14: registerVillagerProfessions

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
default void registerVillagerProfessions(InfinityMod mod, IForgeRegistry<VillagerRegistry.VillagerProfession> registry) {
    ReflectionHelper.forEachIn(mod.getModVillagerProfessionRegistry(), VillagerRegistry.VillagerProfession.class,
            profession -> register(mod, registry, profession, profession.toString()));
}
 
开发者ID:InfinityRaider,项目名称:InfinityLib,代码行数:5,代码来源:IProxy.java

示例15: chooseForgeProfession

import net.minecraftforge.fml.common.registry.VillagerRegistry; //导入方法依赖的package包/类
@Override
protected VillagerRegistry.VillagerProfession chooseForgeProfession(int count, net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession prof) {
    return VillagersHandler.petsSellerProfession;
}
 
开发者ID:NightKosh,项目名称:Sophisticated-wolves,代码行数:5,代码来源:ComponentVillagePetsSeller.java


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