Search in sources :

Example 1 with VillagerCareer

use of net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer in project Totemic by TeamTotemic.

the class ModVillagers method init.

@SubscribeEvent
public static void init(RegistryEvent.Register<VillagerProfession> event) {
    event.getRegistry().register(profTotemist);
    new VillagerCareer(profTotemist, "totemist").addTrade(1, new EmeraldsForItemsWithMeta(new ItemStack(ModItems.buffalo_items, 1, 0), new PriceInfo(9, 12)), new EmeraldsForItemsWithMeta(new ItemStack(ModItems.buffalo_items, 1, 1), new PriceInfo(6, 8)), new EmeraldForItems(ModItems.buffalo_meat, new PriceInfo(14, 18)), new ListItemForEmeralds(ModItems.flute, new PriceInfo(1, 1)), makeItemAndEmeraldToItemWithMeta(new ItemStack(ModItems.flute, 1, 0), new PriceInfo(1, 1), new ItemStack(ModItems.flute, 1, 1), new PriceInfo(1, 1)), new ListItemForEmeralds(Item.getItemFromBlock(ModBlocks.drum), new PriceInfo(1, 1)), new ListItemForEmeralds(Item.getItemFromBlock(ModBlocks.wind_chime), new PriceInfo(3, 4)), new ListItemForEmeralds(ModItems.totemic_staff, new PriceInfo(1, 1))).addTrade(2, new ListItemForEmeralds(ModItems.cooked_buffalo_meat, new PriceInfo(-6, -4)), new EmeraldForItems(Item.getItemFromBlock(ModBlocks.cedar_log), new PriceInfo(24, 32)), new EmeraldForItems(Item.getItemFromBlock(ModBlocks.stripped_cedar_log), new PriceInfo(14, 20)), new ListItemForEmeralds(Item.getItemFromBlock(ModBlocks.tipi), new PriceInfo(2, 3))).addTrade(3, new ItemAndEmeraldToItem(Item.getItemFromBlock(ModBlocks.cedar_log), new PriceInfo(10, 10), Item.getItemFromBlock(ModBlocks.stripped_cedar_log), new PriceInfo(10, 10))).addTrade(4, new EmeraldForItems(ModItems.medicine_bag, new PriceInfo(1, 1))).addTrade(5, new EmeraldsForItemsWithMeta(new ItemStack(ModItems.baykok_bow), new PriceInfo(-3, -2)));
}
Also used : VillagerCareer(net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer) ItemStack(net.minecraft.item.ItemStack) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 2 with VillagerCareer

use of net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer in project pnc-repressurized by TeamPneumatic.

the class VillagerHandler method init.

public static void init() {
    mechanicProfession = new VillagerProfession(Names.MOD_ID + ":mechanic", Textures.VILLAGER_MECHANIC, "minecraft:textures/entity/zombie_villager/zombie_villager.png");
    VillagerCareer career = new VillagerCareer(mechanicProfession, Names.MOD_ID + ".mechanic");
    career.addTrade(1, new ListItemForEmeralds(Itemss.PCB_BLUEPRINT, new PriceInfo(10, 19)), new ListItemForEmeralds(Itemss.NUKE_VIRUS, new PriceInfo(1, 5)), new ListItemForEmeralds(Itemss.STOP_WORM, new PriceInfo(1, 5)));
    for (int i = 0; i < ItemAssemblyProgram.PROGRAMS_AMOUNT; i++) {
        career.addTrade(1, new ListItemForEmeralds(new ItemStack(Itemss.ASSEMBLY_PROGRAM, 1, i), new PriceInfo(5, 11)));
    }
}
Also used : VillagerCareer(net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer) VillagerProfession(net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession) ItemStack(net.minecraft.item.ItemStack) ListItemForEmeralds(net.minecraft.entity.passive.EntityVillager.ListItemForEmeralds) PriceInfo(net.minecraft.entity.passive.EntityVillager.PriceInfo)

Example 3 with VillagerCareer

use of net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer in project BaseMetals by MinecraftModDevelopmentMods.

the class VillagerTradeHelper method insertTrades.

/**
 * Inserts one or more trades to the default villager trade table.
 *
 * @param professionRL
 *            Villager profession
 * @param careerID
 *            Villager career ID (1-3)
 * @param tradeLevel
 *            Level of trade (1+)
 * @param trades
 *            Trades to add to the given level
 */
public static void insertTrades(final ResourceLocation professionRL, final int careerID, final int tradeLevel, final EntityVillager.ITradeList... trades) {
    final VillagerProfession profession = ForgeRegistries.VILLAGER_PROFESSIONS.getValue(professionRL);
    final VillagerCareer career = profession.getCareer(careerID);
    career.addTrade(tradeLevel, trades);
}
Also used : VillagerCareer(net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer) VillagerProfession(net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession)

Aggregations

VillagerCareer (net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerCareer)3 ItemStack (net.minecraft.item.ItemStack)2 VillagerProfession (net.minecraftforge.fml.common.registry.VillagerRegistry.VillagerProfession)2 ListItemForEmeralds (net.minecraft.entity.passive.EntityVillager.ListItemForEmeralds)1 PriceInfo (net.minecraft.entity.passive.EntityVillager.PriceInfo)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1