Java 类net.minecraft.entity.passive.EntityVillager.EmeraldForItems 实例源码

项目:VillagerTrades    文件:TradeHandlers.java   
@Override
public ItemStack getBuyingStack(ITradeList t)
{
    EmeraldForItems trade = (EmeraldForItems)t;
    ItemStack stack = new ItemStack(trade.buyingItem, 1, 0);
    return stack;
}
项目:Cyclic    文件:VillagerCreateModule.java   
private EntityVillager.ITradeList[][] buildDruidTrades() {
  return new EntityVillager.ITradeList[][] {
      {
          new EmeraldForItems(Items.COOKED_FISH, new PriceInfo(9, 12)), // GROUP 1
          new EmeraldForItems(Items.APPLE, new PriceInfo(3, 6)),
          new EmeraldForItems(Items.BEETROOT, new PriceInfo(8, 12))
      }, {
          new EmeraldForItems(Items.FEATHER, new PriceInfo(12, 13)), //GROUP 2
          new EmeraldForItems(Items.WHEAT_SEEDS, new PriceInfo(50, 64)),
          new EmeraldForItems(Items.POISONOUS_POTATO, new PriceInfo(1, 3))
      }, {
          new EmeraldForItems(Item.getItemFromBlock(Blocks.BROWN_MUSHROOM), new PriceInfo(8, 12)), //GROUP 3
          new EmeraldForItems(Item.getItemFromBlock(Blocks.RED_MUSHROOM), new PriceInfo(8, 12))
      }, {
          new EmeraldForItems(Items.BEEF, new PriceInfo(14, 17)), //GROUP 4
          new EmeraldForItems(Items.RABBIT, new PriceInfo(14, 17)),
          new EmeraldForItems(Items.CHICKEN, new PriceInfo(14, 17))
      }, {
          new EmeraldForItems(Items.WRITTEN_BOOK, new PriceInfo(1, 1)), //GROUP 5
          new EmeraldForItems(Items.FISH, new PriceInfo(9, 12)),
          new EmeraldForItems(Items.SPIDER_EYE, new PriceInfo(3, 6))
      }, {
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.GRASS, 32), new PriceInfo(1, 2)), //GROUP 6
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.FARMLAND, 32), new PriceInfo(1, 2)),
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.DIRT, 32, BlockDirt.DirtType.PODZOL.getMetadata()), new PriceInfo(1, 2)),
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.GRASS_PATH, 32), new PriceInfo(1, 2))
      }, {
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.MYCELIUM, 1), new PriceInfo(12, 16)), //GROUP 7
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.WATERLILY, 32), new PriceInfo(1, 2)),
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.SAND, 32, BlockSand.EnumType.RED_SAND.ordinal()), new PriceInfo(1, 3)),
          new ListItemForEmeraldsFixed(new ItemStack(Items.DYE, 16, EnumDyeColor.BLACK.getDyeDamage()), new PriceInfo(1, 3)) }
  };
}
项目:Cyclic    文件:VillagerCreateModule.java   
private EntityVillager.ITradeList[][] buildSageTrades() {
  return new EntityVillager.ITradeList[][] {
      {
          new EmeraldForItems(Items.GUNPOWDER, new PriceInfo(5, 8)), //GROUP 1
          new EmeraldForItems(Items.NETHER_WART, new PriceInfo(12, 16))
      }, {
          new EmeraldForItems(Items.BONE, new PriceInfo(8, 16)), //GROUP 2
          new EmeraldForItems(Items.MUTTON, new PriceInfo(4, 12))
      }, {
          new EmeraldForItems(Items.BLAZE_ROD, new PriceInfo(8, 16)), //GROUP 3
          new EmeraldForItems(Items.SLIME_BALL, new PriceInfo(8, 16))
      }, {
          new EmeraldForItems(Items.GHAST_TEAR, new PriceInfo(1, 2)), //GROUP 4
          new EmeraldForItems(Items.REDSTONE, new PriceInfo(4, 6))
      }, {
          new EmeraldForItems(Items.GLOWSTONE_DUST, new PriceInfo(6, 8)), //GROUP 5
          new EmeraldForItems(Items.DIAMOND, new PriceInfo(8, 12)),
          new EmeraldForItems(Items.ENDER_PEARL, new PriceInfo(12, 16))
      }, {
          new ListItemForEmeraldsFixed(new ItemStack(Items.EXPERIENCE_BOTTLE, 8), new PriceInfo(1, 4)), //GROUP 6
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.CLAY, 16), new PriceInfo(1, 1)),
      }, {
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.QUARTZ_BLOCK, 16), new PriceInfo(2, 4)), //GROUP 7
          new ListItemForEmeraldsFixed(new ItemStack(Blocks.OBSIDIAN, 16), new PriceInfo(2, 4)),
          new ListItemForEmeraldsFixed(new ItemStack(Items.FISH, 4, ItemFishFood.FishType.PUFFERFISH.getMetadata()), new PriceInfo(1, 2)),
      }
  };
}
项目:OpenBlocks    文件:RadioVillagerTrades.java   
public static void registerUselessVillager() {
    final VillagerProfession prof = new VillagerProfession(
            "openblocks:radio",
            "openblocks:textures/models/king-ish.png",
            "minecraft:textures/entity/zombie_villager/zombie_villager.png"); // TODO: zombie texture?

    GameRegistry.findRegistry(VillagerProfession.class).register(prof);

    final VillagerCareer career = new VillagerCareer(prof, "audiophile")
            .addTrade(1, new EmeraldForItems(Item.getItemFromBlock(Blocks.NOTEBLOCK), new PriceInfo(5, 7)))
            .addTrade(2, new ListItemForEmeralds(Item.getItemFromBlock(Blocks.JUKEBOX), new PriceInfo(10, 15))); // extra for sound quality!

    for (ItemStack record : OreDictionary.getOres("record"))
        career.addTrade(3, new ListItemForEmeralds(record.getItem(), new PriceInfo(3, 6)));
}