Examples of ItemBullet


Examples of com.flansmod.common.guns.ItemBullet

        {
          InfoType infoType = (typeClass.getConstructor(TypeFile.class).newInstance(typeFile));
          infoType.read(typeFile);
          switch(type)
          {
          case bullet : bulletItems.add((ItemBullet)new ItemBullet((BulletType)infoType).setUnlocalizedName(infoType.shortName)); break;
          case attachment : attachmentItems.add((ItemAttachment)new ItemAttachment((AttachmentType)infoType).setUnlocalizedName(infoType.shortName)); break;
          case gun : gunItems.add((ItemGun)new ItemGun((GunType)infoType).setUnlocalizedName(infoType.shortName)); break;
          case grenade : grenadeItems.add((ItemGrenade)new ItemGrenade((GrenadeType)infoType).setUnlocalizedName(infoType.shortName)); break;
          case part : partItems.add((ItemPart)new ItemPart((PartType)infoType).setUnlocalizedName(infoType.shortName)); break;
          case plane : planeItems.add((ItemPlane)new ItemPlane((PlaneType)infoType).setUnlocalizedName(infoType.shortName)); break;
View Full Code Here

Examples of com.flansmod.common.guns.ItemBullet

            int spread = 0;
            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
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.