コード例 #1
0
ファイル: SlotCrafting.java プロジェクト: sbaixas/MCMadCow
  /** the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. */
  protected void onCrafting(ItemStack par1ItemStack) {
    par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted);
    this.amountCrafted = 0;

    if (par1ItemStack.itemID == Block.workbench.blockID) {
      this.thePlayer.addStat(AchievementList.buildWorkBench, 1);
    } else if (par1ItemStack.itemID == Item.pickaxeWood.shiftedIndex) {
      this.thePlayer.addStat(AchievementList.buildPickaxe, 1);
    } else if (par1ItemStack.itemID == Block.stoneOvenIdle.blockID) {
      this.thePlayer.addStat(AchievementList.buildFurnace, 1);
    } else if (par1ItemStack.itemID == Item.hoeWood.shiftedIndex) {
      this.thePlayer.addStat(AchievementList.buildHoe, 1);
    } else if (par1ItemStack.itemID == Item.bread.shiftedIndex) {
      this.thePlayer.addStat(AchievementList.makeBread, 1);
    } else if (par1ItemStack.itemID == Item.cake.shiftedIndex) {
      this.thePlayer.addStat(AchievementList.bakeCake, 1);
    } else if (par1ItemStack.itemID == Item.pickaxeStone.shiftedIndex) {
      this.thePlayer.addStat(AchievementList.buildBetterPickaxe, 1);
    } else if (par1ItemStack.itemID == Item.swordWood.shiftedIndex) {
      this.thePlayer.addStat(AchievementList.buildSword, 1);
    } else if (par1ItemStack.itemID == Block.enchantmentTable.blockID) {
      this.thePlayer.addStat(AchievementList.enchantments, 1);
    } else if (par1ItemStack.itemID == Block.bookShelf.blockID) {
      this.thePlayer.addStat(AchievementList.bookcase, 1);
    }
  }
コード例 #2
0
  protected void func_48434_c(ItemStack par1ItemStack) {
    par1ItemStack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.field_48436_g);
    this.field_48436_g = 0;

    if (Util.isWooden(par1ItemStack)
        || Util.isStone(par1ItemStack)
        || Util.isIron(par1ItemStack)
        || Util.isGold(par1ItemStack)
        || Util.isDiamond(par1ItemStack)) {
      ItemCrossbow item = (ItemCrossbow) par1ItemStack.getItem();
      //            this.thePlayer.addStat(mod_CrossbowMod.createCrossbow, 1); TODO
    }
  }