Package com.flansmod.common.guns

Examples of com.flansmod.common.guns.EntityShootable


            int damageMultiplier = 1;
            float shellSpeed = 0F;

            ItemStack bulletStack = driveableData.getStackInSlot(slot);
            ItemBullet bulletItem = (ItemBullet)bulletStack.getItem();
            EntityShootable bulletEntity = bulletItem.getEntity(worldObj, Vec3.createVectorHelper(posX + gunVec.x, posY + gunVec.y, posZ + gunVec.z), axes.getYaw(), axes.getPitch(), motionX, motionY, motionZ, (EntityLivingBase)seats[0].riddenByEntity, damageMultiplier, driveableData.getStackInSlot(slot).getItemDamage(), type);
            worldObj.spawnEntityInWorld(bulletEntity);
           
            if(type.shootSound(secondary) != null)
              PacketPlaySound.sendSoundPacket(posX, posY, posZ, FlansMod.soundRange, dimension, type.shootSound(secondary), false);         
            if(seats[0].riddenByEntity instanceof EntityPlayer && !((EntityPlayer)seats[0].riddenByEntity).capabilities.isCreativeMode)
            {
              bulletStack.setItemDamage(bulletStack.getItemDamage() + 1);
              if(bulletStack.getItemDamage() == bulletStack.getMaxDamage())
              {
                bulletStack.setItemDamage(0);
                bulletStack.stackSize--;
                if(bulletStack.stackSize == 0)
                  bulletStack = null;
              }
              driveableData.setInventorySlotContents(slot, bulletStack);
            }
            setShootDelay(type.shootDelay(secondary), secondary);
          }
        }
        break;
      }   
      case MISSILE : //These two are actually almost identical
      case SHELL :
      {
        if(TeamsManager.shellsEnabled)
        {
          int slot = -1;
          for(int i = driveableData.getMissileInventoryStart(); i < driveableData.getMissileInventoryStart() + type.numMissileSlots; i++)
          {
            ItemStack shell = driveableData.getStackInSlot(i);
            if(shell != null && shell.getItem() instanceof ItemBullet && type.isValidAmmo(((ItemBullet)shell.getItem()).type, weaponType))
            {
              slot = i;
            }
          }
         
          if(slot != -1)
          {
            int spread = 0;
            int damageMultiplier = 1;
            float shellSpeed = 3F;

            ItemStack bulletStack = driveableData.getStackInSlot(slot);
            ItemBullet bulletItem = (ItemBullet)bulletStack.getItem();
            EntityShootable bulletEntity = bulletItem.getEntity(worldObj, Vector3f.add(new Vector3f(posX, posY, posZ), gunVec, null), lookVector, (EntityLivingBase)seats[0].riddenByEntity, spread, damageMultiplier, shellSpeed, driveableData.getStackInSlot(slot).getItemDamage(), type);
            worldObj.spawnEntityInWorld(bulletEntity);
           
            if(type.shootSound(secondary) != null)
              PacketPlaySound.sendSoundPacket(posX, posY, posZ, FlansMod.soundRange, dimension, type.shootSound(secondary), false);         
            if(seats[0].riddenByEntity instanceof EntityPlayer && !((EntityPlayer)seats[0].riddenByEntity).capabilities.isCreativeMode)
View Full Code Here

TOP

Related Classes of com.flansmod.common.guns.EntityShootable

Copyright © 2018 www.massapicom. 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.