Package com.flansmod.common.guns

Examples of com.flansmod.common.guns.ShootableType


      for(EntityItem ammoEntity : event.drops)
      {
        ItemStack ammoItemstack = ammoEntity.getEntityItem();
        if(ammoItemstack != null && ammoItemstack.getItem() instanceof ItemShootable)
        {
          ShootableType bulletType = ((ItemShootable)ammoItemstack.getItem()).type;
          if(gunType.isAmmo(bulletType))
          {
            gunEntity.ammoStacks.add(ammoItemstack.copy());
            ammoItemstack.stackSize = 0;
         
View Full Code Here


 
          ItemStack bulletItemStack = driveable.getDriveableData().ammo[seatInfo.gunnerID];
          //Check that neither is null and that the bullet item is actually a bullet
          if(gun != null && bulletItemStack != null && bulletItemStack.getItem() instanceof ItemShootable)
          {
            ShootableType bullet = ((ItemShootable)bulletItemStack.getItem()).type;
            if(gun.isAmmo(bullet))
            {
              //Gun origin
              Vector3f gunOrigin = Vector3f.add(driveable.axes.findLocalVectorGlobally(seatInfo.gunOrigin), new Vector3f(driveable.posX, driveable.posY, driveable.posZ), null);
              //Calculate the look axes globally
View Full Code Here

          for(int i = 0; i < player.inventory.getSizeInventory(); i++)
          {
            ItemStack stack = player.inventory.getStackInSlot(i);
            if(stack != null && stack.getItem() instanceof ItemShootable)
            {
              ShootableType bulletType = ((ItemShootable)stack.getItem()).type;
              if(gunType.isAmmo(bulletType))
              {
                newAmmoStacks.add(stack.copy());
                player.inventory.setInventorySlotContents(i, null);
              }
View Full Code Here

      }
      //If there was a valid non-empty magazine / bullet item somewhere in the inventory, take one to put in the gun
      if(bestSlot != -1)
      {
        ItemStack newBulletStack = clientPlayer.inventory.getStackInSlot(bestSlot);
        ShootableType newBulletType = ((ItemShootable)newBulletStack.getItem()).type;
        //Remove the magazine from the inventory
        if(!clientPlayer.capabilities.isCreativeMode)
          newBulletStack.stackSize--;
        if(newBulletStack.stackSize <= 0)
          newBulletStack = null;
View Full Code Here

      GunType gunType = pilotGun.type;
      ItemStack bulletItemStack = driveableData.ammo[getDriveableType().numPassengerGunners + currentGun];
      //Check that neither is null and that the bullet item is actually a bullet
      if(gunType != null && bulletItemStack != null && bulletItemStack.getItem() instanceof ItemShootable && TeamsManager.bulletsEnabled)
      {
        ShootableType bullet = ((ItemShootable)bulletItemStack.getItem()).type;
        if(gunType.isAmmo(bullet))
        {
          //Spawn a new bullet item
          worldObj.spawnEntityInWorld(((ItemShootable)bulletItemStack.getItem()).getEntity(worldObj, Vector3f.add(gunVec, new Vector3f((float)posX, (float)posY, (float)posZ), null), lookVector, (EntityLivingBase)seats[0].riddenByEntity, gunType.bulletSpread / 2, gunType.damage, 2.0F,bulletItemStack.getItemDamage(), type));
          //Play the shoot sound
View Full Code Here

TOP

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

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.