Examples of onSheared()


Examples of net.minecraftforge.common.IShearable.onSheared()

        if (entity instanceof IShearable)
        {
            IShearable target = (IShearable) entity;
            if (target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ))
            {
                ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ,
                        EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));

                Random rand = new Random();
                for (ItemStack stack : drops)
                {
View Full Code Here

Examples of net.minecraftforge.common.IShearable.onSheared()

        if (id instanceof IShearable)
        {
            IShearable target = (IShearable) id;
            if (target.isShearable(itemstack, player.worldObj, x, y, z))
            {
                ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
                Random rand = new Random();

                for (ItemStack stack : drops)
                {
                    float f = 0.7F;
View Full Code Here

Examples of net.minecraftforge.common.IShearable.onSheared()

      return false;

    if(entity instanceof IShearable) {
      IShearable target = (IShearable)entity;
      if(target.isShearable(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
        ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));

        Random rand = new Random();
        for(ItemStack stack : drops) {
          EntityItem ent = entity.entityDropItem(stack, 1.0F);
          ent.motionY += rand.nextFloat() * 0.05F;
 
View Full Code Here

Examples of net.minecraftforge.common.IShearable.onSheared()

    Block block = player.worldObj.getBlock(x, y, z);
    if(block instanceof IShearable) {
      IShearable target = (IShearable)block;
      if(target.isShearable(itemstack, player.worldObj, x, y, z)) {
        ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
        Random rand = new Random();

        for(ItemStack stack : drops) {
          float f = 0.7F;
          double d  = rand.nextFloat() * f + (1D - f) * 0.5;
 
View Full Code Here

Examples of net.minecraftforge.common.IShearable.onSheared()

            items.addAll(mouseoverBlock.getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0));
        } catch (Exception ignored) {}
        if (mouseoverBlock instanceof IShearable) {
            IShearable shearable = (IShearable) mouseoverBlock;
            if (shearable.isShearable(new ItemStack(Items.shears), world, x, y, z))
                items.addAll(shearable.onSheared(new ItemStack(Items.shears), world, x, y, z, 0));
        }

        if (items.size() == 0)
            items.add(0, new ItemStack(mouseoverBlock, 1, world.getBlockMetadata(x, y, z)));
View Full Code Here

Examples of net.minecraftforge.common.IShearable.onSheared()

        if (hitMOP != null && hitMOP.entityHit instanceof IShearable) {
            IShearable target = (IShearable) hitMOP.entityHit;
            Entity entity = hitMOP.entityHit;
            if (target.isShearable(stack, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
                ArrayList<ItemStack> drops = target.onSheared(stack, entity.worldObj, (int) entity.posX, (int) entity.posY,
                        (int) entity.posZ,
                        EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));

                Random rand = new Random();
                for (ItemStack drop : drops) {
View Full Code Here

Examples of net.minecraftforge.common.IShearable.onSheared()

            return false;
        }
        if (block instanceof IShearable && ElectricItemUtils.getPlayerEnergy(player) > ModuleManager.computeModularProperty(itemstack, SHEARING_ENERGY_CONSUMPTION)) {
            IShearable target = (IShearable) block;
            if (target.isShearable(itemstack, player.worldObj, x, y, z)) {
                ArrayList<ItemStack> drops = target.onSheared(itemstack, player.worldObj, x, y, z,
                        EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
                Random rand = new Random();

                for (ItemStack stack : drops) {
                    float f = 0.7F;
View Full Code Here

Examples of net.minecraftforge.common.IShearable.onSheared()

            }
            Block block = world.getBlock(hitMOP.blockX, hitMOP.blockY, hitMOP.blockZ);
            if (block instanceof IShearable) {
                IShearable target = (IShearable) block;
                if (target.isShearable(this.shootingItem, world, hitMOP.blockX, hitMOP.blockY, hitMOP.blockZ) && !world.isRemote) {
                    ArrayList<ItemStack> drops = target.onSheared(this.shootingItem, world, hitMOP.blockX, hitMOP.blockY, hitMOP.blockZ,
                            EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, this.shootingItem));
                    Random rand = new Random();

                    for (ItemStack stack : drops) {
                        float f = 0.7F;
View Full Code Here

Examples of net.minecraftforge.common.IShearable.onSheared()

        } else if (hitMOP.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && hitMOP.entityHit != this.shootingEntity) {
            if (hitMOP.entityHit instanceof IShearable) {
                IShearable target = (IShearable) hitMOP.entityHit;
                Entity entity = hitMOP.entityHit;
                if (target.isShearable(this.shootingItem, entity.worldObj, (int) entity.posX, (int) entity.posY, (int) entity.posZ)) {
                    ArrayList<ItemStack> drops = target.onSheared(this.shootingItem, entity.worldObj,
                            (int) entity.posX, (int) entity.posY, (int) entity.posZ,
                            EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, this.shootingItem));

                    Random rand = new Random();
                    for (ItemStack drop : drops) {
View Full Code Here

Examples of net.minecraftforge.common.IShearable.onSheared()

                sheep = i1.next();
                if (sheep.isShearable(par5ItemStack, par1World, par2, par3, par4))
                {
                    if (rand.nextInt(2) == 0)
                    {
                        ArrayList<ItemStack> drops = sheep.onSheared(par5ItemStack, par1World, par2, par3, par4, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, par5ItemStack));
                        if (sheep instanceof EntityLivingBase)
                        {
                            par5ItemStack.damageItem(1, (EntityLivingBase) sheep);
                        }
                        Iterator<ItemStack> i2 = drops.iterator();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.