Program: 174574
Project: 174574
Buggy source:
/** 
 * Methods related to entity interaction.                
 */
public boolean processInteract(EntityPlayer player,EnumHand hand){
  if (!this.world.isRemote) {
    if (hand == EnumHand.MAIN_HAND) {
      ItemStack stack=player.getHeldItemMainhand();
      if (stack.getItem() == ModItems.GEM_STAFF) {
        if (this.isTamed()) {
          if (player.isSneaking()) {
            this.alternateInteract(player);
            this.playObeySound();
          }
 else {
            if (this.isOwner(player)) {
              this.setSitting(player);
              this.playObeySound();
            }
 else {
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              return true;
            }
          }
        }
 else {
          this.setOwnerId(player.getUniqueID());
          this.setLeader(player);
          this.setServitude(EntityGem.SERVE_HUMAN);
          this.navigator.clearPathEntity();
          this.setAttackTarget(null);
          this.setHealth(this.getMaxHealth());
          this.playTameEffect();
          this.world.setEntityState(this,(byte)7);
          this.playObeySound();
          player.addStat(ModAchievements.I_MADE_YOU);
          player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
          return true;
        }
      }
 else       if (stack.getItem() == ModItems.CRACKED_BLUE_DIAMOND_GEM || stack.getItem() == ModItems.CRACKED_YELLOW_DIAMOND_GEM || stack.getItem() == ModItems.BLUE_DIAMOND_GEM || stack.getItem() == ModItems.YELLOW_DIAMOND_GEM) {
        if (this.getServitude() != EntityGem.SERVE_HUMAN) {
          this.setOwnerId(player.getUniqueID());
          this.setLeader(player);
          this.setServitude(EntityGem.SERVE_HUMAN);
          this.navigator.clearPathEntity();
          this.setAttackTarget(null);
          this.setHealth(this.getMaxHealth());
          this.playTameEffect();
          this.world.setEntityState(this,(byte)7);
          this.playObeySound();
          player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
          return true;
        }
      }
 else       if (stack.getItem() == ModItems.TRANSFER_CONTRACT) {
        if (this.isTamed()) {
          if (this.isOwner(player)) {
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            return true;
          }
 else {
            ItemTransferContract contract=(ItemTransferContract)stack.getItem();
            if (this.isOwnerId(contract.getOwner(stack))) {
              if (contract.getOwner(stack).equals(this.getOwnerId())) {
                if (this.leader.equals(this.getOwnerId())) {
                  this.setLeader(player);
                }
                this.getOwner().sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
              }
 else {
                for (                UUID ownerId : this.jointOwners) {
                  if (contract.getOwner(stack).equals(ownerId)) {
                    if (this.leader.equals(this.getOwnerId())) {
                      this.setLeader(player);
                    }
                    try {
                      this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
                    }
 catch (                    Exception e) {
                    }
                    ownerId=EntityPlayer.getUUID(player.getGameProfile());
                  }
                }
              }
              this.playObeySound();
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              this.setOwnerId(EntityPlayer.getUUID(player.getGameProfile()));
              if (!player.capabilities.isCreativeMode) {
                stack.shrink(1);
              }
              return true;
            }
 else {
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              return true;
            }
          }
        }
      }
 else       if (stack.getItem() == ModItems.JOINT_CONTRACT) {
        if (this.isTamed()) {
          if (this.isOwner(player)) {
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            return true;
          }
 else {
            ItemJointContract contract=(ItemJointContract)stack.getItem();
            if (this.isOwnerId(contract.getOwner(stack))) {
              this.getOwner().sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
              for (              UUID ownerId : this.jointOwners) {
                try {
                  this.world.getPlayerEntityByUUID(ownerId).sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
                }
 catch (                Exception e) {
                }
              }
              this.jointOwners.add(EntityPlayer.getUUID(player.getGameProfile()));
              this.playObeySound();
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              if (!player.capabilities.isCreativeMode) {
                stack.shrink(1);
              }
              return true;
            }
 else {
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              return true;
            }
          }
        }
      }
 else       if (stack.getItem() == ModItems.LIBERATION_CONTRACT) {
        if (this.isTamed()) {
          ItemLiberationContract contract=(ItemLiberationContract)stack.getItem();
          if (this.isOwnerId(contract.getOwner(stack))) {
            if (contract.getOwner(stack).equals(this.getOwnerId())) {
              this.getOwner().sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
            }
 else {
              for (              UUID ownerId : this.jointOwners) {
                if (contract.getOwner(stack).equals(ownerId)) {
                  try {
                    this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
                  }
 catch (                  Exception e) {
                  }
                  ownerId=EntityPlayer.getUUID(player.getGameProfile());
                }
              }
            }
            this.playObeySound();
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            if (!player.capabilities.isCreativeMode) {
              stack.shrink(1);
            }
            this.setServitude(EntityGem.SERVE_NONE);
            this.setOwnerId((UUID)null);
            this.setLeader((UUID)null);
            return true;
          }
 else {
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            return true;
          }
        }
      }
 else       if (stack.getItem() == ModItems.AUTONOMY_CONTRACT) {
        if (this.isTamed()) {
          ItemAutonomyContract contract=(ItemAutonomyContract)stack.getItem();
          if (this.isOwnerId(contract.getOwner(stack))) {
            if (contract.getOwner(stack).equals(this.getOwnerId())) {
              if (this.leader.equals(this.getOwnerId())) {
                this.setLeader(player);
              }
              this.getOwner().sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
            }
 else {
              for (              UUID ownerId : this.jointOwners) {
                if (contract.getOwner(stack).equals(ownerId)) {
                  if (this.leader.equals(this.getOwnerId())) {
                    this.setLeader(player);
                  }
                  try {
                    this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
                  }
 catch (                  Exception e) {
                  }
                  ownerId=EntityPlayer.getUUID(player.getGameProfile());
                }
              }
            }
            this.playObeySound();
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            if (!player.capabilities.isCreativeMode) {
              stack.shrink(1);
            }
            this.setOwnerId((UUID)null);
            this.setLeader((UUID)null);
            this.setServitude(EntityGem.SERVE_ITSELF);
            return true;
          }
 else {
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            return true;
          }
        }
      }
 else       if (stack.getItem() == Items.DYE && this.canChangeInsigniaColorByDefault()) {
        if (this.isTamed()) {
          if (this.isOwner(player)) {
            this.setInsigniaColor(15 - stack.getItemDamage());
            return true;
          }
        }
      }
 else       if (stack.isEmpty()) {
        this.setAttackWeapon(player,hand,stack);
      }
 else       if (this.isSoldier) {
        return super.processInteract(player,hand) || this.setAttackWeapon(player,hand,stack);
      }
    }
  }
  return super.processInteract(player,hand);
}

Fixed version (ground truth):
/** 
 * Methods related to entity interaction.				
 */
public boolean processInteract(EntityPlayer player,EnumHand hand){
  if (!this.world.isRemote) {
    if (hand == EnumHand.MAIN_HAND) {
      ItemStack stack=player.getHeldItemMainhand();
      if (stack.getItem() == ModItems.GEM_STAFF) {
        if (this.isTamed()) {
          if (player.isSneaking()) {
            this.alternateInteract(player);
            this.playObeySound();
          }
 else {
            if (this.isOwner(player)) {
              this.setSitting(player);
              this.playObeySound();
            }
 else {
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              return true;
            }
          }
        }
 else {
          this.setOwnerId(player.getUniqueID());
          this.setLeader(player);
          this.setServitude(EntityGem.SERVE_HUMAN);
          this.navigator.clearPathEntity();
          this.setAttackTarget(null);
          this.setHealth(this.getMaxHealth());
          this.playTameEffect();
          this.world.setEntityState(this,(byte)7);
          this.playObeySound();
          player.addStat(ModAchievements.I_MADE_YOU);
          player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
          return true;
        }
      }
 else       if (stack.getItem() == ModItems.CRACKED_BLUE_DIAMOND_GEM || stack.getItem() == ModItems.CRACKED_YELLOW_DIAMOND_GEM || stack.getItem() == ModItems.BLUE_DIAMOND_GEM || stack.getItem() == ModItems.YELLOW_DIAMOND_GEM) {
        if (this.getServitude() != EntityGem.SERVE_HUMAN) {
          this.setOwnerId(player.getUniqueID());
          this.setLeader(player);
          this.setServitude(EntityGem.SERVE_HUMAN);
          this.navigator.clearPathEntity();
          this.setAttackTarget(null);
          this.setHealth(this.getMaxHealth());
          this.playTameEffect();
          this.world.setEntityState(this,(byte)7);
          this.playObeySound();
          player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
          return true;
        }
      }
 else       if (stack.getItem() == ModItems.TRANSFER_CONTRACT) {
        if (this.isTamed()) {
          if (this.isOwner(player)) {
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            return true;
          }
 else {
            ItemTransferContract contract=(ItemTransferContract)stack.getItem();
            if (this.isOwnerId(contract.getOwner(stack))) {
              if (contract.getOwner(stack).equals(this.getOwnerId())) {
                if (this.leader.equals(this.getOwnerId())) {
                  this.setLeader(player);
                }
                this.getOwner().sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
              }
 else {
                for (                UUID ownerId : this.jointOwners) {
                  if (contract.getOwner(stack).equals(ownerId)) {
                    if (this.leader.equals(this.getOwnerId())) {
                      this.setLeader(player);
                    }
                    try {
                      this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
                    }
 catch (                    Exception e) {
                    }
                    ownerId=EntityPlayer.getUUID(player.getGameProfile());
                  }
                }
              }
              this.playObeySound();
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              this.setOwnerId(EntityPlayer.getUUID(player.getGameProfile()));
              if (!player.capabilities.isCreativeMode) {
                stack.shrink(1);
              }
              return true;
            }
 else {
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              return true;
            }
          }
        }
      }
 else       if (stack.getItem() == ModItems.JOINT_CONTRACT) {
        if (this.isTamed()) {
          if (this.isOwner(player)) {
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            return true;
          }
 else {
            ItemJointContract contract=(ItemJointContract)stack.getItem();
            if (this.isOwnerId(contract.getOwner(stack))) {
              this.getOwner().sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
              for (              UUID ownerId : this.jointOwners) {
                try {
                  this.world.getPlayerEntityByUUID(ownerId).sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
                }
 catch (                Exception e) {
                }
              }
              this.jointOwners.add(EntityPlayer.getUUID(player.getGameProfile()));
              this.playObeySound();
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              if (!player.capabilities.isCreativeMode) {
                stack.shrink(1);
              }
              return true;
            }
 else {
              player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
              return true;
            }
          }
        }
      }
 else       if (stack.getItem() == ModItems.LIBERATION_CONTRACT) {
        if (this.isTamed()) {
          ItemLiberationContract contract=(ItemLiberationContract)stack.getItem();
          if (this.isOwnerId(contract.getOwner(stack))) {
            if (contract.getOwner(stack).equals(this.getOwnerId())) {
              this.getOwner().sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
            }
 else {
              for (              UUID ownerId : this.jointOwners) {
                if (contract.getOwner(stack).equals(ownerId)) {
                  try {
                    this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
                  }
 catch (                  Exception e) {
                  }
                  ownerId=EntityPlayer.getUUID(player.getGameProfile());
                }
              }
            }
            this.playObeySound();
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            if (!player.capabilities.isCreativeMode) {
              stack.shrink(1);
            }
            this.setServitude(EntityGem.SERVE_NONE);
            this.setOwnerId((UUID)null);
            this.setLeader((UUID)null);
            return true;
          }
 else {
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            return true;
          }
        }
      }
 else       if (stack.getItem() == ModItems.AUTONOMY_CONTRACT) {
        if (this.isTamed()) {
          ItemAutonomyContract contract=(ItemAutonomyContract)stack.getItem();
          if (this.isOwnerId(contract.getOwner(stack))) {
            if (contract.getOwner(stack).equals(this.getOwnerId())) {
              if (this.leader.equals(this.getOwnerId())) {
                this.setLeader(player);
              }
              this.getOwner().sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
            }
 else {
              for (              UUID ownerId : this.jointOwners) {
                if (contract.getOwner(stack).equals(ownerId)) {
                  if (this.leader.equals(this.getOwnerId())) {
                    this.setLeader(player);
                  }
                  try {
                    this.world.getPlayerEntityByUUID(EntityPlayer.getUUID(player.getGameProfile())).sendMessage(new TextComponentTranslation("String_Node_Str",this.getName(),player.getName()));
                  }
 catch (                  Exception e) {
                  }
                  ownerId=EntityPlayer.getUUID(player.getGameProfile());
                }
              }
            }
            this.playObeySound();
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            if (!player.capabilities.isCreativeMode) {
              stack.shrink(1);
            }
            this.setOwnerId((UUID)null);
            this.setLeader((UUID)null);
            this.setServitude(EntityGem.SERVE_ITSELF);
            return true;
          }
 else {
            player.sendMessage(new TextComponentTranslation("String_Node_Str",this.getName()));
            return true;
          }
        }
      }
 else       if (stack.getItem() == Items.DYE && this.canChangeInsigniaColorByDefault()) {
        if (this.isTamed()) {
          if (this.isOwner(player)) {
            this.setInsigniaColor(15 - stack.getItemDamage());
            return true;
          }
        }
      }
 else       if (stack.isEmpty()) {
        this.setAttackWeapon(player,hand,stack);
      }
 else       if (this.isSoldier) {
        return super.processInteract(player,hand) || this.setAttackWeapon(player,hand,stack);
      }
    }
  }
  return super.processInteract(player,hand);
}