Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-67949

Unnecessary code in BlockLeaves.java

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • Minecraft 1.7.10
    • None
    • Unconfirmed

      the code says:
      public void harvestBlock(World world, EntityPlayer player, int p_149636_3_, int p_149636_4_, int p_149636_5_, int p_149636_6_)
      {
      if (!world.isClient && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears) // The unnecesarry code

      { player.addStat(StatList.mineBlockStatArray[Block.getIdFromBlock(this)], 1); this.dropBlockAsItem_do(world, p_149636_3_, p_149636_4_, p_149636_5_, new ItemStack(Item.getItemFromBlock(this), 1, p_149636_6_ & 3)); }

      else

      { super.harvestBlock(world, player, p_149636_3_, p_149636_4_, p_149636_5_, p_149636_6_); }

      }

      Wouldn't it be enough to test if the player holds a shear since he can't have nothing in his hand AND shears?

            Unassigned Unassigned
            AntherusCraft Marcel Schauer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: