Program: 22457
Project: 22457
Buggy source:
/** 
 * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
 */
@Override public ItemStack onItemRightClick(ItemStack par1ItemStack,World par2World,EntityPlayer par3EntityPlayer){
  NBTTagCompound nbt=par1ItemStack.getTagCompound();
  boolean crouched=par3EntityPlayer.isSneaking();
  if (!crouched) {
    if (!par1ItemStack.hasTagCompound()) {
      par1ItemStack.setTagCompound(new NBTTagCompound());
      nbt=par1ItemStack.getTagCompound();
      nbt.setInteger("String_Node_Str",0);
      nbt.setBoolean("String_Node_Str",false);
      nbt.setInteger("String_Node_Str",0);
    }
    if (nbt.getInteger("String_Node_Str") > 0 || par3EntityPlayer.capabilities.isCreativeMode) {
      if (!par1ItemStack.stackTagCompound.hasKey("String_Node_Str") || par1ItemStack.stackTagCompound.getInteger("String_Node_Str") == 0) {
        float enhancementAccuracy=0.0F;
        float enhancementExplosionSize=0.0F;
        int enhancementDelay=0;
        if (UtilEnhancements.hasEnhancement(par1ItemStack)) {
          if (UtilEnhancements.getEnhancementFromItem(par1ItemStack) instanceof IEnhancementRocketLauncher) {
            enhancementAccuracy=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).getAccuracyChange(this);
            enhancementExplosionSize=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).getExplosionChange(this);
            enhancementDelay=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).getFireDelayChange(par1ItemStack);
          }
        }
        float var7=1.0F;
        if (var7 < 0.1D) {
          return par1ItemStack;
        }
        if (var7 > 1.0F) {
          var7=1.0F;
        }
        EntityRocket var8=new EntityRocket(par2World,par3EntityPlayer,((1.0F + accuracy + enhancementAccuracy) - var7),this.explosionSize + enhancementExplosionSize);
        int selectedRocketType=0;
        if (par1ItemStack.hasTagCompound()) {
          if (par1ItemStack.stackTagCompound.hasKey("String_Node_Str")) {
            selectedRocketType=par1ItemStack.stackTagCompound.getInteger("String_Node_Str");
          }
        }
        var8=SteamcraftRegistry.rockets.get(selectedRocketType).changeBullet(var8);
        if (UtilEnhancements.hasEnhancement(par1ItemStack)) {
          if (UtilEnhancements.getEnhancementFromItem(par1ItemStack) instanceof IEnhancementRocketLauncher) {
            var8=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).changeBullet(var8);
          }
        }
        par1ItemStack.damageItem(1,par3EntityPlayer);
        par2World.playSoundAtEntity(par3EntityPlayer,"String_Node_Str",(1.0F * (2F / 5F)) * (UtilEnhancements.getEnhancementFromItem(par1ItemStack) != null && UtilEnhancements.getEnhancementFromItem(par1ItemStack).getID() == "String_Node_Str" ? 0.4F : 1.0F),1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F);
        if (!par2World.isRemote) {
          par2World.spawnEntityInWorld(var8);
        }
        nbt.setInteger("String_Node_Str",nbt.getInteger("String_Node_Str") - 1);
        if (par2World.isRemote && !par3EntityPlayer.capabilities.isCreativeMode) {
          boolean crouching=par3EntityPlayer.isSneaking();
        }
        if (!(SteamcraftEventHandler.isJumping(par3EntityPlayer) && !par3EntityPlayer.capabilities.isFlying && UtilEnhancements.hasEnhancement(par1ItemStack)&& UtilEnhancements.getEnhancementFromItem(par1ItemStack) instanceof ItemEnhancementAirStrike)) {
          par1ItemStack.stackTagCompound.setInteger("String_Node_Str",this.timeBetweenFire + enhancementDelay);
        }
      }
    }
 else {
      NBTTagCompound nbtt=par1ItemStack.getTagCompound();
      if (par3EntityPlayer.capabilities.isCreativeMode) {
        int enhancementShells=0;
        if (UtilEnhancements.hasEnhancement(par1ItemStack)) {
          if (UtilEnhancements.getEnhancementFromItem(par1ItemStack) instanceof IEnhancementRocketLauncher) {
            enhancementShells=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).getClipSizeChange(this);
          }
        }
        nbtt.setInteger("String_Node_Str",1);
        nbtt.setInteger("String_Node_Str",this.shellCount + enhancementShells);
      }
      par3EntityPlayer.setItemInUse(par1ItemStack,this.getMaxItemUseDuration(par1ItemStack));
    }
  }
 else {
    if (!par1ItemStack.hasTagCompound()) {
      par1ItemStack.setTagCompound(new NBTTagCompound());
      nbt=par1ItemStack.getTagCompound();
      nbt.setInteger("String_Node_Str",0);
      nbt.setBoolean("String_Node_Str",false);
      nbt.setInteger("String_Node_Str",0);
    }
    int selectedRocketType=0;
    if (par1ItemStack.hasTagCompound()) {
      if (par1ItemStack.stackTagCompound.hasKey("String_Node_Str")) {
        selectedRocketType=par1ItemStack.stackTagCompound.getInteger("String_Node_Str");
      }
    }
    int prevRocketType=selectedRocketType;
    selectedRocketType=(selectedRocketType + 1) % SteamcraftRegistry.rockets.size();
    nbt.setInteger("String_Node_Str",selectedRocketType);
    if (selectedRocketType != prevRocketType && par1ItemStack.stackTagCompound.getInteger("String_Node_Str") > 0) {
      ItemStack stack=new ItemStack(((Item)SteamcraftRegistry.rockets.get(prevRocketType)),nbt.getInteger("String_Node_Str"),0);
      if (!par3EntityPlayer.worldObj.isRemote) {
        EntityItem entityItem=new EntityItem(par3EntityPlayer.worldObj,par3EntityPlayer.posX,par3EntityPlayer.posY,par3EntityPlayer.posZ,stack);
        par3EntityPlayer.worldObj.spawnEntityInWorld(entityItem);
      }
      nbt.setInteger("String_Node_Str",0);
    }
  }
  return par1ItemStack;
}

Fixed version (ground truth):
/** 
 * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
 */
@Override public ItemStack onItemRightClick(ItemStack par1ItemStack,World par2World,EntityPlayer par3EntityPlayer){
  System.out.println("String_Node_Str" + par3EntityPlayer.worldObj.isRemote);
  NBTTagCompound nbt=par1ItemStack.getTagCompound();
  boolean crouched=par3EntityPlayer.isSneaking();
  if (!crouched) {
    if (!par1ItemStack.hasTagCompound()) {
      par1ItemStack.setTagCompound(new NBTTagCompound());
      nbt=par1ItemStack.getTagCompound();
      nbt.setInteger("String_Node_Str",0);
      nbt.setBoolean("String_Node_Str",false);
      nbt.setInteger("String_Node_Str",0);
    }
    System.out.println("String_Node_Str" + par3EntityPlayer.worldObj.isRemote);
    if (nbt.getInteger("String_Node_Str") > 0 || par3EntityPlayer.capabilities.isCreativeMode) {
      System.out.println("String_Node_Str" + par3EntityPlayer.worldObj.isRemote);
      if (!par1ItemStack.stackTagCompound.hasKey("String_Node_Str") || par1ItemStack.stackTagCompound.getInteger("String_Node_Str") == 0) {
        System.out.println("String_Node_Str" + par3EntityPlayer.worldObj.isRemote);
        float enhancementAccuracy=0.0F;
        float enhancementExplosionSize=0.0F;
        int enhancementDelay=0;
        if (UtilEnhancements.hasEnhancement(par1ItemStack)) {
          if (UtilEnhancements.getEnhancementFromItem(par1ItemStack) instanceof IEnhancementRocketLauncher) {
            enhancementAccuracy=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).getAccuracyChange(this);
            enhancementExplosionSize=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).getExplosionChange(this);
            enhancementDelay=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).getFireDelayChange(par1ItemStack);
          }
        }
        float var7=1.0F;
        if (var7 < 0.1D) {
          return par1ItemStack;
        }
        if (var7 > 1.0F) {
          var7=1.0F;
        }
        EntityRocket var8=new EntityRocket(par2World,par3EntityPlayer,((1.0F + accuracy + enhancementAccuracy) - var7),this.explosionSize + enhancementExplosionSize);
        int selectedRocketType=0;
        if (par1ItemStack.hasTagCompound()) {
          if (par1ItemStack.stackTagCompound.hasKey("String_Node_Str")) {
            selectedRocketType=par1ItemStack.stackTagCompound.getInteger("String_Node_Str");
          }
        }
        var8=SteamcraftRegistry.rockets.get(selectedRocketType).changeBullet(var8);
        if (UtilEnhancements.hasEnhancement(par1ItemStack)) {
          if (UtilEnhancements.getEnhancementFromItem(par1ItemStack) instanceof IEnhancementRocketLauncher) {
            var8=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).changeBullet(var8);
          }
        }
        par1ItemStack.damageItem(1,par3EntityPlayer);
        par2World.playSoundAtEntity(par3EntityPlayer,"String_Node_Str",(1.0F * (2F / 5F)) * (UtilEnhancements.getEnhancementFromItem(par1ItemStack) != null && UtilEnhancements.getEnhancementFromItem(par1ItemStack).getID() == "String_Node_Str" ? 0.4F : 1.0F),1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + var7 * 0.5F);
        if (!par2World.isRemote) {
          par2World.spawnEntityInWorld(var8);
        }
        nbt.setInteger("String_Node_Str",nbt.getInteger("String_Node_Str") - 1);
        if (par2World.isRemote && !par3EntityPlayer.capabilities.isCreativeMode) {
          boolean crouching=par3EntityPlayer.isSneaking();
        }
        if (!(SteamcraftEventHandler.isJumping(par3EntityPlayer) && !par3EntityPlayer.capabilities.isFlying && UtilEnhancements.hasEnhancement(par1ItemStack)&& UtilEnhancements.getEnhancementFromItem(par1ItemStack) instanceof ItemEnhancementAirStrike)) {
          par1ItemStack.stackTagCompound.setInteger("String_Node_Str",this.timeBetweenFire + enhancementDelay);
        }
      }
    }
 else {
      NBTTagCompound nbtt=par1ItemStack.getTagCompound();
      if (par3EntityPlayer.capabilities.isCreativeMode) {
        int enhancementShells=0;
        if (UtilEnhancements.hasEnhancement(par1ItemStack)) {
          if (UtilEnhancements.getEnhancementFromItem(par1ItemStack) instanceof IEnhancementRocketLauncher) {
            enhancementShells=((IEnhancementRocketLauncher)UtilEnhancements.getEnhancementFromItem(par1ItemStack)).getClipSizeChange(this);
          }
        }
        nbtt.setInteger("String_Node_Str",1);
        nbtt.setInteger("String_Node_Str",this.shellCount + enhancementShells);
      }
      par3EntityPlayer.setItemInUse(par1ItemStack,this.getMaxItemUseDuration(par1ItemStack));
    }
  }
 else {
    if (!par1ItemStack.hasTagCompound()) {
      par1ItemStack.setTagCompound(new NBTTagCompound());
      nbt=par1ItemStack.getTagCompound();
      nbt.setInteger("String_Node_Str",0);
      nbt.setBoolean("String_Node_Str",false);
      nbt.setInteger("String_Node_Str",0);
    }
    int selectedRocketType=0;
    if (par1ItemStack.hasTagCompound()) {
      if (par1ItemStack.stackTagCompound.hasKey("String_Node_Str")) {
        selectedRocketType=par1ItemStack.stackTagCompound.getInteger("String_Node_Str");
      }
    }
    int prevRocketType=selectedRocketType;
    selectedRocketType=(selectedRocketType + 1) % SteamcraftRegistry.rockets.size();
    nbt.setInteger("String_Node_Str",selectedRocketType);
    if (selectedRocketType != prevRocketType && par1ItemStack.stackTagCompound.getInteger("String_Node_Str") > 0) {
      ItemStack stack=new ItemStack(((Item)SteamcraftRegistry.rockets.get(prevRocketType)),nbt.getInteger("String_Node_Str"),0);
      if (!par3EntityPlayer.worldObj.isRemote) {
        EntityItem entityItem=new EntityItem(par3EntityPlayer.worldObj,par3EntityPlayer.posX,par3EntityPlayer.posY,par3EntityPlayer.posZ,stack);
        par3EntityPlayer.worldObj.spawnEntityInWorld(entityItem);
      }
      nbt.setInteger("String_Node_Str",0);
    }
  }
  return par1ItemStack;
}